-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathvim-rusty-tags.sh
More file actions
executable file
·30 lines (28 loc) · 932 Bytes
/
vim-rusty-tags.sh
File metadata and controls
executable file
·30 lines (28 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
#### Script to add rust tags to vim, so that you can move back and forth from within vim.
####
#### Script will check all the subdirs with a Cargo.toml file within, and add rust tags.
if ! command -v rusty-tags &> /dev/null
then
echo "Command 'rusty-tags' could not be found."
echo ""
echo "1. Install 'ctags' using apt, yum, dnf, or brew."
echo "2. Install 'rusty-tags' with: 'cargo install rusty-tags'"
echo "Setup editor: https://docs.rs/crate/rusty-tags/1.0.1"
echo
exit
fi
if [ $# -eq 0 ]; then
echo
echo "Error: need an argument of \"vi\" or \"emacs\"!"
echo
exit 1
fi
#SCRIPT_DIR= scripts directory no matter where it was called from
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
for tag_this in $(find .|grep Cargo.toml); do
tag_dir=${tag_this/\/Cargo.toml/}
tag_dir=$SCRIPT_DIR/${tag_dir/\.\//}
cd $tag_dir
rusty-tags vi
done