title | separator | verticalSeparator | revealOptions | transition |
---|---|---|---|---|
Modal editing with Vim |
<!--s--> |
<!--v--> |
fade |
presented by notarock
- What's vim anyway? What about this talk?
- Modes
- Thinking in vim
- Ex/Sed commands
- Additionnal ressources
- Help you with the initial "Learning curve"!
- Implementations like neovim, evil-mode, IDE plugins, etc.
- Vimscript, vimrc and plugins
- Modal text editor (More about this later!)
- Present on most *nix systems (If not vim, vi is)
- Can be tailored to your needs
- Fast!
- VIM stands for Vi Improved (1991)
- Vi stands for Visual Editor (1976)
- ex stands for Extended (1970s)
- Load file, Make edits, Write to file.
- Load multiple files
- Does not care about file size at all!
Normal mode | Insert mode | Visual mode | Command mode |
---|---|---|---|
Navigation | Write characters | Select characters | Execute commands |
- Spend more than 80% of your time here
- Press
esc
to enter normal mode - Almost every keys are mapped to a motion or an action.
- Access other modes from here
- Type text into the buffer
- Press
i
to enter insert mode
- v : character-wise visual mode
- V : line-wise visual mode
- Ctrl-v : block-wise visual mode
:
to start typing a command from normal modeCtrl-o :
to type commands from insert mode- Syntax is similar to
sed
ex -s +%s/127/128/g +%p +q! /etc/hosts
sed s/127/128/g /etc/hosts
- You don't "remember" shortcuts.
- You apply commands in order to achieve editing goals.
- Keybindings are mnemonic. (
a
is for append, etc.)
- Motion
- Command
- Operators
- Extras (e.g. Leader key)
<number><command><text object or motion>
- Can be saved in macros!
- Can be applied to multiple lines with the
:norm
command!
Some basics
Write | Quit | Edit | Read |
---|---|---|---|
:w |
:q |
:e |
:r |
:s/Find-Word/Replace-Word/gc
- Interracting with buffers
- Interracting with tabs/windows
- Interracting with registers (Clipboard)
- Get help