Vim configuration persistent logging

1. Create a .vimrc file in the home directory

  set nu # set the line number

  set tabstop=4 # tab tab indent

  set autoindent # auto indent

  set showmatch # bracket matching highlight

  execute pathogen#infect() # # # # # #
  
syntax on These three lines are pathogen vim plugin manager configuration

  filetype plugin indent on   # # # # # #

  colorscheme evening # color scheme

  set laststatus=2 # Display the status
  line 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, shortcut key binding, such as pressing F2 to open or close the directory list

2. Install the pathogen vim plugin manager

  The official installation method is at https://github.com/tpope/vim-pathogen. The ~/.vim/autoload/ and ~/.vim/bundle directories will be generated, and each plugin will be a separate folder in the bundle directory

  Install plugins: For example: nerdtree, git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree 然后重启vim,按F12即可查看目录

  Delete plugin: Go to ~/.vim/bundle/ and delete the corresponding plugin directory

  Update the plugin: Enter the specific plugin directory and execute git pull origin

3. vim creates a new file in a new tab: tabnew path/filename

   Edit existing files in new tabs: tabedit path/filename

   Switch between tabs: tabn means the next tab

   Reference: https://www.cnblogs.com/hnrainll/archive/2011/04/29/2032660.html

4. vim multi-window split and switch exit, reference: http://www.jb51.net/LINUXjishu/118276.html

5. After vim uses tabnew to create a new file, the nerdtree directory tree is not automatically updated, first switch to the directory list, press shift + r, and refresh manually

6. When vim is editing, it needs to be undone. First esc to exit the editing state, press u to undo the last operation. crtl + r to restore undo

7. To delete a line in vim command line mode, press dd. To delete a character, press X

8. vim single-line, multi-line copy and paste, reference: https://blog.csdn.net/achejq/article/details/42148865

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324805664&siteId=291194637