Advertisement
otku

VIM

Apr 24th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. ,cc - comment out lines
  2. ,cu - uncomment out lines
  3.  
  4.  
  5. rw switch between vim tabs hjkl
  6. df <Esc>
  7. :'<,'>s/old/new/g search & replace selected
  8. H top line of screen
  9. M middle line of screen
  10. L bottom line of screen
  11. e end of current word
  12. b beginning of current word
  13. w beginning of next word
  14. gg first line
  15. G last line
  16. 0 beginning of current line
  17. $ end of current line
  18. % move to matching parenthesisjjj
  19. o insert line below, then enter insert
  20. O insert line above, then enter insert
  21. r overwrite one character, then command mode
  22.  
  23. dd in command mode (after pressing escape) will cut the line,
  24. p in command mode will paste.
  25. d and then a movement will cut the equivalent of that movement,
  26. dw will cut a word
  27. d will cut this line and the line below,
  28. d50w will cut 50 words
  29. yy is copy line, and works like dd.
  30. D cuts from cursor to end of line.
  31. v (visual mode)
  32. V (visual line mode)
  33. v (visual block modej)
  34.  
  35.  
  36. VIM Sessions
  37.  
  38. :mks ~/.vim/sessions/rooster.vim
  39. vim -S ~/.vim/sessions/rooster.vim
  40.  
  41.  
  42. :FOLDS
  43.  
  44. set foldmethod=indent
  45. zo opens a fold at the cursor.
  46. zO opens all folds at the cursor.
  47. zc closes a fold at the cursor.
  48. zm increases the foldlevel by one.
  49. zM closes all open folds.
  50. zr decreases the foldlevel by one.
  51. zR decreases the foldlevel to zero -- all folds will be open.
  52.  
  53. TABS:
  54.  
  55. gt next tab
  56. gT previous tab
  57. gt go to nnn tab
  58. gm move tab left
  59. gM move tab right
  60.  
  61.  
  62. NERDTree:
  63.  
  64. tw opens nerdtree
  65. ts tree find
  66. :Bookmark create bookmark
  67. B show bookmarks
  68. D delete bookmark
  69.  
  70. FILESYSTEM:
  71.  
  72. m opens up node/files menu
  73. U move up directory & leave old root open
  74. u move up directory
  75. C change tree root to this directory
  76. R refresh current root
  77. r refresh cursor directory
  78. cd change CWD to selectred directory
  79. CD change tree root to CWD
  80.  
  81. DIRECTORIES:
  82.  
  83. o open & close
  84. O recursively open
  85. x close parent
  86. X close all children recursively
  87. e explore selected dir
  88.  
  89. TREE NAVIGATION:
  90.  
  91. p go to parent
  92. P go to root
  93. K go to first child
  94. J go to last child
  95. go to prev sibling
  96. go to next sibling
  97.  
  98. FILES:
  99.  
  100. o open in previous window
  101. t open in new tab
  102. T open in new tab silently
  103. i open split
  104. s open vsplit
  105.  
  106. TREE FILTERING
  107.  
  108. l hidden files (off)
  109. f file filters (on)
  110. F files on
  111. B bookmarks (off)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement