File tree Expand file tree Collapse file tree 4 files changed +33
-9
lines changed Expand file tree Collapse file tree 4 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,9 @@ for more details.
41
41
42
42
### Source browsing with [ Tagbar] [ tgbr ]
43
43
44
- ` rust.vim ` has builtin ` ctags/ ` definitions for [ Tagbar] [ tgbr ] which
45
- are loaded if Tagbar is installed.
44
+ The installation of Tagbar along with [ Universal Ctags] ( uctags ) is recommended
45
+ for a good Tagbar experience. For other kinds of setups, ` rust.vim ` tries to
46
+ configure Tagbar to some degree.
46
47
47
48
### Formatting with [ rustfmt] [ rfmt ]
48
49
@@ -102,6 +103,7 @@ LICENSE-MIT for details.
102
103
[ rfmt ] : https://github.com/rust-lang-nursery/rustfmt
103
104
[ syn ] : https://github.com/scrooloose/syntastic
104
105
[ tgbr ] : https://github.com/majutsushi/tagbar
106
+ [ uctags ] : https://ctags.io
105
107
[ wav ] : https://github.com/mattn/webapi-vim
106
108
[ pp ] : https://play.rust-lang.org/
107
109
[ vim8pack ] : http://vimhelp.appspot.com/repeat.txt.html#packages
Original file line number Diff line number Diff line change
1
+ " Tagbar support code, for the sake of not automatically overriding its
2
+ " configuration in case Universal Ctags is detected.
3
+
4
+ let s: ctags_is_uctags = 0
5
+ let s: checked_ctags = 0
6
+
7
+ function ! rust#tags#IsUCtags () abort
8
+ if s: checked_ctags == 0
9
+ if system (' ctags --version' ) = ~? ' universal ctags'
10
+ let s: ctags_is_uctags = 1
11
+ endif
12
+ let s: checked_ctags = 1
13
+ endif
14
+ return s: ctags_is_uctags
15
+ endfunction
16
+
17
+ " vim: set et sw = 4 sts = 4 ts = 8 :
Original file line number Diff line number Diff line change @@ -91,12 +91,17 @@ g:rust_use_custom_ctags_defs~
91
91
and do not wish for those included with rust.vim to be used: >
92
92
let g:rust_use_custom_ctags_defs = 1
93
93
<
94
- Note that rust.vim's built-in definitions are only used for the Tagbar
95
- Vim plugin, if you have it installed--it is not automatically used
96
- when generating | tags | files that Vim can use to navigate to
97
- definitions across different source files. Feel free to copy
98
- `rust.vim /ctags/ rust.ctags` into your own `~/.ctags ` if you wish to
99
- generate | tags | files.
94
+
95
+ NOTE: rust.vim's built-in definitions are only used for the Tagbar Vim
96
+ plugin, if you have it installed, AND if Universal Ctags is not
97
+ detected. This is because Universal Ctags already has built-in
98
+ support for Rust when used with Tagbar.
99
+
100
+ Also, note that when using ctags other than Universal Ctags, it is not
101
+ automatically used when generating | tags | files that Vim can use to
102
+ navigate to definitions across different source files. Feel free to
103
+ copy `rust.vim /ctags/ rust.ctags` into your own `~/.ctags ` if you wish
104
+ to generate | tags | files.
100
105
101
106
102
107
*g:ftplugin_rust_source_path*
Original file line number Diff line number Diff line change 1
1
"
2
2
" Support for Tagbar -- https://github.com/majutsushi/tagbar
3
3
"
4
- if ! exists (' :Tagbar' ) || system ( ' ctags --version ' ) = ~? ' universal ctags '
4
+ if ! exists (' :Tagbar' ) || rust#tags#IsUCtags ()
5
5
finish
6
6
endif
7
7
You can’t perform that action at this time.
0 commit comments