mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-10-12 12:31:15 +02:00
nvim: improved rust compiler to use cargo
This commit is contained in:
@@ -42,6 +42,8 @@ case "$file" in
|
|||||||
*\.lua) lua "$file" ;;
|
*\.lua) lua "$file" ;;
|
||||||
*\.sent) setsid sent "$file" 2>/dev/null & ;;
|
*\.sent) setsid sent "$file" 2>/dev/null & ;;
|
||||||
*\.r|*\.R) Rscript "$file" ;;
|
*\.r|*\.R) Rscript "$file" ;;
|
||||||
*\.rs) rustc "$file" && "$base" ;;
|
*\.rs) (cd "$dir" && cargo locate-project >/dev/null 2>&1) \
|
||||||
|
&& (cd "$(dirname "$(cd "$dir" && cargo locate-project --message-format plain)")" && cargo run) \
|
||||||
|
|| (rustc "$file" && "./$(basename "${file%.rs}")") ;;
|
||||||
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
|
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user