Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vim introduction

Vim introduction

Dmitrijs Vrublevskis

July 12, 2014
Tweet

More Decks by Dmitrijs Vrublevskis

Other Decks in Programming

Transcript

  1. Vim introduction
    @Dmitrijs Vrublevskis

    View full-size slide

  2. About me
    • Developer @ “Transact PRO”
    • Unhappy with PHP
    • In love with Ruby
    • Believe in Linux

    View full-size slide

  3. Backup plan
    https://www.codebox.io

    View full-size slide

  4. Intro
    • Programmer's text editor
    • Released publicly in 1991
    • Based on the vi editor
    • Vim is a tool, the use of which
    must be learned.
    • Shortcuts & no-mouse

    View full-size slide

  5. My use cases
    • Ruby (Rails) development (sometimes)
    • One-time source editing (bugfixes, types and etc)
    • Editing via SSH (nginx, apache, hosts and etc)
    • Diff (rarely)
    • Development (Intellij IDEA plugin)

    View full-size slide

  6. $ vim file.txt
    § - command sequences for pro

    View full-size slide

  7. Modes
    • Insert
    • Normal
    !
    • Visual
    • Command

    View full-size slide

  8. Modes[Insert]
    1. Insert
    A. Cursor -
    B. Append -
    C. On new line -
    2. Type text
    3. Exit -

    View full-size slide

  9. Modes[Normal]
    • Left - -
    • Right - -
    • Down - -
    • Up - -
    !
    • § 5l
    • § 2j

    View full-size slide

  10. Modes[Normal]
    • Word -
    • End word -
    • Back word -
    • Find -
    !
    • § F2e
    • § t”

    View full-size slide

  11. Modes[Normal]
    • Delete under cursor -
    • Replace -
    • Delete -
    • Change -
    • Motion - || …
    !
    • § d5k
    • § ca”

    View full-size slide

  12. Modes[Visual]
    • Visual -
    • Line visual -
    • Block visual -

    View full-size slide

  13. Modes[Command]
    • Write - <:>
    • Quit - <:>
    • Write and quit - <:>
    • Write and quit - <:>
    • Quit without save - <:>
    • Search - >
    • Next / Prev - /

    View full-size slide

  14. Useful
    • § <“> - Delete all in “” and put in insert
    mode.
    • § <)> - Delete all till first ‘)’
    • § <.> - Write some text and repeat
    • § <(> - Move cursor to first ‘(‘, backwards

    View full-size slide

  15. Learn vim
    • http://www.viemu.com/
    a_vi_vim_graphical_cheat_sheet_tutorial.html
    • http://vim-adventures.com/
    • https://www.shortcutfoo.com

    View full-size slide

  16. Vim projects
    • http://neovim.org/ - New next generation
    • https://github.com/gmarik/Vundle.vim - Plugin
    manager
    • https://github.com/Valloric/YouCompleteMe -
    Autocompletion
    • https://github.com/FylmTM/dotfiles/blob/master/
    vim/vimrc - Mine ‘.vimrc’

    View full-size slide