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

Vim + tmux

Nick Nisi
February 25, 2015

Vim + tmux

This is a talk given at the Omaha Maker Group's monthly Code meeting, OMG!Code, discussing vim and tmux

Nick Nisi

February 25, 2015
Tweet

More Decks by Nick Nisi

Other Decks in Technology

Transcript

  1. 3

  2. Why vim? 4 highly customizable 4 runs everywhere 4 works

    with many programming languages 4 scriptable 8
  3. Modal editing Change the meaning of the keys in each

    mode of operation 4 Normal mode - navigate the structure of the file 4 Insert mode - editing the file 4 Visual mode - highlight portions of the file to manipulate at once 4 Ex mode - command mode 14
  4. 4 ^E - scroll the window down 4 ^Y -

    scroll the window up 4 ^F - scroll down one page 4 ^B - scroll up one page 4 H - move cursor to the top of the window 4 M - move cursor to the middle of the window 4 L - move cursor to the bottom of the window 4 gg - go to top of file 20
  5. text objects 4 w - words 4 s - sentences

    4 p - paragraphs 4 t - tags1 1 tags available in XML/HTML files 26
  6. Motions 4 a- all 4 i - in 4 t

    - 'til 4 f - find forward 4 F - find backward 27
  7. Commands 4 d - delete (also cut) 4 c -

    change (delete, then place in insert mode) 4 y - yank (copy) 4 v - visually select 29
  8. Additional commands 4 dd / yy - delete/yank the current

    line 4 D / C - delete/change until end of line 4 ^ / $ - move to the beginning/end of line 4 I / A - move to the beginning/end of line and insert 4 o / O - insert new line above/below current line and insert 39
  9. Record a macro 4 q{register} 4 (do the things) 4

    q Play a macro 4 @{register} 44
  10. Plugins 4 vundle - plugin manager 4 nerdtree - file

    drawer 4 ctrlp - fuzzy file finder 4 fugitive - git tool 4 syntastic - syntax checker / linter 46
  11. 50

  12. What is tmux? 4 Terminal multiplexer 4 View and control

    multiple consoles 4 Preconfigure environments 53
  13. ~/.tmux.conf - tmux configuration 4 configure tmux # unbind default

    prefix and set it to Ctrl+a unbind C-b set -g prefix C-a bind C-a send-prefix 56
  14. Execute commands from vim in a split :call VimuxRunCommand("grunt test")

    Map the commands to a key nmap <leader>z :call VimuxRunCommand("grunt test")<cr> 62