Vim_configuration

1. Commands:

1)

2)

3)

4)

5)

6)

 

 7)  (num of lines to move) - shift - >>  " move a Tab to right side

          (num of lines to move) - shift - <<  " move a Tab to left side 

    

 8)  ctrl - t  " move a Tab to right side

          ctrl - d     " move a Tab to left side

    (used in insert mode)

 9)  : vs - ' filepath/name '  " create a new window vertically

          : sp - ' filepath/name'  " create a new window horizontally

10)  : ls  " the command list just input

     : sb - 'num'  " to choose the num

     : vert sb -'num'  " will create a vertically window

11)  : tabe(dit) - ' filepath/name'  " create a new tab window

     g - t  " go to the forward tab window

          g - T  " go to backward tab window

12)  shift - v  " into 'visual line' mode, could select several lines to indent, input the same command will go to 'command' mode

 

2. Set Commands:

1)  set: list  " to show the symbol of spaces and tab

2)  set: expandtab  " when press tab, it will convert to four spaces, in condition that set tabstop=4

3)  set: shiftwidth=4  

4)  set: autoindent  " combining this command with 'expandtab' is the best result

5)  set: smartindent  " when using commands "o, O", it will indent automatically

6)  set: cursorline  " the place where the cursor is in will come out a line

7)  set: splitbelow  " the direction of creating a new window

8)  set: splitright  " the direction of creating a new window

 

 

 

 

using this command to configure Vim editor:

   sudo vim <~/vim/vimrc>

and input:

  set tabstop=4

  set nu

  set autoindent (because python use spaces, not set in vimrc, just set when write HTML file)

     set title

" Indent automatically depending on filetype
filetype indent on
set autoindent

" Turn on line numbering. Turn it off with "set nonu"
set number

" Set syntax on
syntax on

" Case insensitive search
set ic

" Higlhight search
set hls

" Wrap text instead of being on one line
set lbr

" Change colorscheme from default to delek
colorscheme delek

 

Reference Link:

https://help.ubuntu.com/community/VimHowto

 

posted @ 2016-04-24 12:43  bajunma123  阅读(139)  评论(0编辑  收藏  举报