vimrc
vimrc copied to clipboard
example to config vim and use github to sync
Use github to sync vi config
- Tested on Ubuntu14.04, 16.04 and 18.04
- Only for C and Assembly language development
How to use
git, vim and gtags* must be installed
git clone https://github.com/howhow/vimrc ~/.my_config/vim
cd ~/.my_config/vim
./install.sh build-essential cmake ctags cscope python3.7 silversearcher-ag nodejs npm
NOTE: For older systems (e.g. Ubuntu 14.04) you may run into compilation
issues with cmake. Therefore, install the cmake3 instead:
./install.sh build-essential cmake3 ctags cscope python3.7 silversearcher-ag
- you could clone to anywhere, but I like to save all my configs into one place
- If you have old vim config, install script will ask if you like to backup
- git installation guide
- gtags installtion guide
wget http://tamacom.com/global/global-6.6.2.tar.gz && \
tar -xvzf global-6.6.2.tar.gz && \
cd ./global-6.6.2 && \
./configure && \
make && \
sudo make install && \
cd -
- vim installation guide
- vim version must higher than 8.0
- Please pay attention to vim version and change corresponding
VIMRUNTIMEDIRduring make, eg,
right now vim version already upgrade to v8.2, therefore:make VIMRUNTIMEDIR=/usr/local/share/vim/vim80make VIMRUNTIMEDIR=/usr/local/share/vim/vim82
NOTE: ctags will be redirected to Exuberant Ctags, which without maintenance long time ago, recommend to install Universal Ctags to instead
Integrated plugins
- plugin manager: vim-plug
- git: fugitive, gitgutter, gv
- complete: ~~YouCompleteMe*~~, coc
- status line: airline
- color schemes: gruvbox, solarized, dracula
- syntax checking: ~~syntastic~~, ale
- searching: ~~CrtlP~~,LeaderF, fzf, ack, vim-easymotion
- document: vimtex, ~~slumlord~~
- code: ~~tagbar~~, ~~nerdtree~~, ~~cscopemaps~~, gutentags, gutentags_plus, ultisnips, vim-snippets
*YCM need compile after download, if you like it, please refer to the guide
Some features
- check tab and EOL whitespace
- update tags in async mode by gutentags
Keymaps
| Keymap | Desc |
|---|---|
| space | leader |
<leader> + f |
Open file list |
<leader> + F |
Open current file function list |
<leader> + a |
Grep current word under cursor |
| jj/hh/hj/jh | Exit insert mode |
<leader> + 3 |
Open quickfix window |
<leader> + 4 |
Close quickfix window |
<leader> + 5 |
Previous quickfix item |
<leader> + 6 |
Next quickfix item |
<leader> + 7 |
Previous file buffer |
<leader> + 8 |
Next file buffer |
<leader> + cs |
Find symbol (reference) under cursor |
<leader> + cg |
Find symbol definition under cursor |
<leader> + cd |
Functions called by this function |
<leader> + cc |
Functions calling this function |
<leader> + ct |
Find text string under cursor |
<leader> + ce |
Find egrep pattern under cursor |
<leader> + cf |
Find file name under cursor |
<leader> + ci |
Find files #including the file name under cursor |
<leader> + ca |
Find places where current symbol is assigned |
<leader> + e |
Strip trailing white space |
<leader> + wn |
Find trailing white space |
<leader> + tn |
Find tab |
TODO
- [x] Compile and install YCM in install.sh
- [x] Migrate all plugins to async in order to fast vi speed
- [ ] Support python project
- [ ] More error handling in install.sh
LICENSE
MIT