Skip to content

Instantly share code, notes, and snippets.

@kave-me
Last active June 2, 2023 06:39
Show Gist options
  • Save kave-me/40ae627dfab8bd8616801ea70339a07d to your computer and use it in GitHub Desktop.
Save kave-me/40ae627dfab8bd8616801ea70339a07d to your computer and use it in GitHub Desktop.
How do I use Ideavim plugin

How do I use Ideavim plugin

I was taking notes while watching the following video.

Mouseless Development with IdeaVim - Miguel Beltran - Berlindroid

I recommend visiting The repo Miguel Beltran has made for the talk.

Vim has three different modes

The order and structure of the gist is a 1-to-1 mapping of the video flow.

  • Modes

    • Normal => default mode
    • Insert => activate it using 'i'
    • Visual => activate it using 'v'
  • Commands

    • /string => search 'string' in current file
    • ci) => change in parentheses
  • Recommendation

    • Map CapsLock to ESC
    • Make vim your git editor => git config --global core.editor "vim"
    • Put your .vimrc file in a source control platform and share it with people
    • Learning
  • Navigation

    • Simple movement
      • h => left
      • j => down
      • k => up
      • l => right
    • w => jump beginning of the next word
    • b => jump previous word
    • e => jump end of the next word
    • :lineNumber => jumps to lineNumber
  • Editing

    • $ => end of the line
    • A => append to the end of the line as same as $a
    • Simple command
      • x => delete a character
      • d => delete command
        • dj => delete current and below lines
        • dw => delete word
        • dd => delete the line
        • D => delete up to the end of the line
      • u => undo as same as CTRL+z
  • Visual mode

    • V => select current line then you can extend selection using navigation commands e.g. hjkl
    • vip => select lines between empty lines i.e. visual selection paragraph
  • Searching

    • /string => search for string
    • * => search the word under cursor
    • n => repeat search
    • N => repeat search backwards
  • More advance

    • :%s/foo/bar/g => replace all foo with bar, you can also use CTRL+R to have the same effect
    • :sort => select some lines using visual mode then type this command to sort the lines
    • Macro
      • qa => starts recording a macro with label 'a', do your stuff the press q again to stop recording the macro
      • @a => applies macro 'a' to the selected characters/lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment