Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

useful .vimrc

set tabstop=2
set shiftwidth=2
set expandtab
inoremap <S-Tab> <C-V><Tab>
syntax on
set t_Co=256
set colorcolumn=80

“crazy vim, do not allow copy/paste
set mouse=v

setlocal spell spelllang=en_us

“for vert term  ( split vertical vim window)

:set splitright
:set splitbelow

 

useful .screenrc

# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@

 

Split Multiple windows:

:vsplit  filename

:split  filename

Ctr-W arrow to move between windows

:vert term  ( bring a term window )

 

Commenting Multiple Lines

Follow the steps given below for commenting multiple using the terminal.

  1. First, press ESC
  2. Go to the line from which you want to start commenting. Then, press ctrl + v, this will enable the visual block mode.( not shift+v)
  3. use the down arrow to select multiple lines that you want to comment.
  4. Now, press SHIFT + I to enable insert mode.
  5. Press # and it will add a comment to the first line. Then press ECS and wait for a second, # will be added to all the lines.

You Might Like: Learn DevOps: The Complete Kubernetes Course 174

Uncommenting Multiple Lines

  1. Press CTRL + V to enable visual block mode.
  2. Move down and select the lines till you want to uncomment.
  3. press x and it will uncomment all the selected lines at once.

 

:help command

remove unwanted space till end

1,$s/\s\+$//g  ( remember to escape + as \+)

Replace 1  to “1”  in a line:  1,$s/ \([0-9]\+\)/ “\1″/g

:11,22t. (copy 11,22 to current focus)

:11,22m. (move line 11,22 to current focus)

:tabe . ( tabedit open a new tab),   gt, gT switch between tab

line move/edit

w,e,b move to next word, end, backword word ,  ( W, E, B use space as seperator)

r ( replace one char), R ( replace one line)

s (substitutte one char ) , S (substitute one line)

 

 

https://www.youtube.com/watch?v=Yk4s-WLjxug&t=8s&ab_channel=GammaRay%E8%BB%9F%E9%AB%94%E5%B7%A5%E4%BD%9C%E5%AE%A4