1. Home directory create the. vimrc file
Set Nu # Sets line number
Set tabstop=4 # tab TAB indent
Set Autoindent # Auto Indent
Set Showmatch # parentheses match highlighting
Execute Pathogen#infect () # # # # # # # # # # #
Syntax on this three line is pathogen Vim plug-in Manager configuration
FileType plugin indent on # # # # # # # # #
ColorScheme Evening # Color Style
Set laststatus=2 # Show status bar
Set statusline=\%<%f[%1*%m%*%n%r%h]%=\%y\%0 (%{&fileformat}\ [%{(&fenc==\ "\" &enc:&fenc). ( &bomb?\ ", bom\": \ "\")}]\%c:%l/%l%) # status bar display format
Map <F2>:nerdtreetoggle<cr> # Nerdtree directory tree, accelerator bindings, such as press F2 to open or close the directory list
2. Install the pathogen Vim plugin Manager
The official installation method is Https://github.com/tpope/vim-pathogen. Will generate ~/.vim/autoload/and ~/.vim/bundle directories, each plugin as a standalone folder under the bundle directory
Install plugins: For example: Nerdtree ,git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
然后重启vim,按F12即可查看目录
Remove plugins: Go to ~/.vim/bundle/to delete the corresponding plugin directory
Update plugin: Go to the specific plugin directory and execute Git pull origin
3. Vim creates new file on new tab: tabnew path/file name
Edit an existing file in a new tab: Tabedit path/file name
Toggle between tabs: TABN represents the next label
Reference: https://www.cnblogs.com/hnrainll/archive/2011/04/29/2032660.html
4. Vim Multi-window segmentation and switch exit, reference: http://www.jb51.net/LINUXjishu/118276.html
5. Vim use tabnew new file, Nerdtree tree is not automatically updated, first switch to directory list, press SHIFT + R, manually refresh
6. Vim needs to be revoked when editing. ESC exits the edit state, pressing U to undo the last action. CRTL + R recoverable undo
7. In the VIM command line mode, delete a row and press DD. Delete a character, press X
8. Vim single row, multi-line copy sticky, ref: 42148865
VIM Configuration Continuous logging