Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.22 KB

vim.md

File metadata and controls

67 lines (54 loc) · 1.22 KB
  1. find the vimrc

enter :version enter :echo $VIM enter :echo $HOME

  1. Search and replace the word under the cursor

  • Put the cursor on foo.
  • Press * to search for the next occurrence.
  • Type ciw (change inner word) then bar then press Escape.
  • Press n (move to next occurrence) then . (repeat change).
  • Repeat last step.
* -> ciw -> n -> .
find->replace->next occurance -> repeat action
  1. comment or uncomment multi line

  • press ESC
  • press ctr+v (visual block mode)
  • up/down arrow to select lines
  • shit+i
  • insert #
  • press ESC ESC
  1. encoding.

set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
  1. replace.

:%s/\<foo\>/bar/gc
  1. sublime

//settings 
{
    "ignored_packages":[],
    "vintage_ctrl_keys": true
}
//key-binds 
{ 
    "keys": ["command+c"], "command": "exit_insert_mode",
    "context":[
        { "key": "setting.command_mode", "operand": false },
        { "key": "setting.is_widget", "operand": false }]
}
  1. visual studio code.

//settings 
"vim.insertModeKeyBindings": [{
    "before":["j","j"],
    "after":["<Esc>","l"]
}].