Abstract
In order to make an IDE for rust, I followed the Ultimate vimrc, and installed Tagbar, YouCompleteMe to support the RUST language.
Details
-
Install the Ultimate vimrc, you can follow the readme.
12git clone https://github.com/amix/vimrc.git ~/.vim_runtimesh ~/.vim_runtime/install_awesome_vimrc.sh -
Install Your Plugins to the directory sources_non_forked.
12cd ~/vim_runtimegit clone git://github.com/tpope/vim-rails.git sources_non_forked/vim-rails-
Install tagbar
1git clone https://github.com/majutsushi/tagbar.git sources_non_forked/tagbar -
Config tagbar for Rust, Put this into ~/.ctags
1234567891011--langdef=Rust--langmap=Rust:.rs--regex-Rust=/^[ t]*(#[[^]]][ t]*)*(pub[ t]+)?(extern[ t]+)?("[^"]+"[ t]+)?(unsafe[ t]+)?fn[ t]+([a-zA-Z0-9_]+)/6/f,functions,function definitions/--regex-Rust=/^[ t]*(pub[ t]+)?type[ t]+([a-zA-Z0-9_]+)/2/T,types,type definitions/--regex-Rust=/^[ t]*(pub[ t]+)?enum[ t]+([a-zA-Z0-9_]+)/2/g,enum,enumeration names/--regex-Rust=/^[ t]*(pub[ t]+)?struct[ t]+([a-zA-Z0-9_]+)/2/s,structure names/--regex-Rust=/^[ t]*(pub[ t]+)?mod[ t]+([a-zA-Z0-9_]+)/2/m,modules,module names/--regex-Rust=/^[ t]*(pub[ t]+)?(static|const)[ t]+(mut[ t]+)?([a-zA-Z0-9_]+)/4/c,consts,static constants/--regex-Rust=/^[ t]*(pub[ t]+)?(unsafe[ t]+)?trait[ t]+([a-zA-Z0-9_]+)/3/t,traits,traits/--regex-Rust=/^[ t]*(pub[ t]+)?(unsafe[ t]+)?impl([ tn]*<[^>]*>)?[ t]+(([a-zA-Z0-9_:]+)[ t]*(<[^>]*>)?[ t]+(for)[ t]+)?([a-zA-Z0-9_]+)/5 7 8/i,impls,trait implementations/--regex-Rust=/^[ t]*macro_rules![ t]+([a-zA-Z0-9_]+)/1/d,macros,macro definitions/
-
and add configuration to the my_configs.vim as step 4.
-
Install YouCompleteMe for rust follow the README:
123456789cd ~/.vim_runtime/sources_non_forkedgit clone https://github.com/Valloric/YouCompleteMe.git sources_non_forked/YouCompleteMecd YouCompleteMegit submodule update --init --recursive./install.py --racer-completermkdir -p ~/Developermkdir -p ~/Developercd ~/Developergit clone --depth 1 --branch master https://github.com/rust-lang/rust rust-master -
Add your configurations to the file ~/vim_runtime/my_configs.vim.
1234567891011121314151617181920212223242526272829"YouCompleteMe for rustlet g:ycm_rust_src_path="/home/huang/Developer/rust-master/src/""enable mouse supportset mouse=a"Arrage the NERDTreePanel to the rightlet NERDTreeWinPos = "right""Arrage the tagbar to the leftlet g:tagbar_left = 1let g:tagbar_width = 30let g:tagbar_autofocus = 1let g:tagbar_sort = 0let g:tagbar_compact = 1"enable tagbar for rustlet g:tagbar_type_rust = {'ctagstype' : 'rust','kinds' : ['T:types,type definitions','f:functions,function definitions','g:enum,enumeration names','s:structure names','m:modules,module names','c:consts,static constants','t:traits,traits','i:impls,trait implementations',]}"shortcutsnmap <F5> :TagbarToggle<cr>nmap <F6> :NERDTreeToggle<cr>
Other Resources
[1]: Awesome Rust Collections, https://github.com/kud1ing/awesome-rust#ides
[2]: Vim Cheet Sheet, http://vim.rtorr.com/
[3]: VimAwesome, http://vimawesome.com/
近期评论