Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.78 KB

vim-tips.md

File metadata and controls

62 lines (40 loc) · 1.78 KB

VIM Tips and Tricks

Keyboard shortcuts

IntelliJ Idea VIM Plugin - https://plugins.jetbrains.com/plugin/164-ideavim (documentation)

Bookmarks

  • mark* locations

    • ma -- set the mark a at the current position
    • `a -- jump to mark a
    • :marks -- show bookmarks
  • search

    • f+<char> - jump to a character on the line
      • ; - after using f, this will jump to next match, , go back
    • t+<char> - jump to character before
    • F+<char> - jump backwards to character
  • yank and paste

    • yy -- yank current line
    • yf<char> -- yank to character (including character)
    • yt<char> -- yank to character (excluding character)
    • p -- paste after cursor
    • P -- paste before cursor
  • scroll*

    • zt -- scroll current line to top of screen
    • z. -- scroll current line to middle of screen
    • zb -- scroll current line to bottom of screen
  • goto

    • G - jump to bottom of file
    • gg - jump to top of file

.vimrc files

vim tricks

  • for a case insensitive search use the \c escape sequence

      /\ccopyright
    
  • delete empty lines from selected text

    • after selecting text in visual mode, type :g/^$/d