Skip to content

Instantly share code, notes, and snippets.

@mattboehm
Created March 15, 2013 01:35
Show Gist options
  • Save mattboehm/5166861 to your computer and use it in GitHub Desktop.
Save mattboehm/5166861 to your computer and use it in GitHub Desktop.
Notes from my February NoVA Vim presentation on marks, jumps and registers. Mostly just a list of suggested :help sections to read.
"These lines map a hotkey that allow you to easily execute the current line or
"selection by hitting F9. It's a cheesy hack that made demoing while reading
"through this more simple.
"
"This is also why commands start with colons. Normally colons would be
"unnecessary if trying to execute these in your vimrc.
:nnoremap <F9> "ayy@a
:vnoremap <F9> "ay@a
"Marks {{{
:help mark
"use ' to jump to right char as it's easier to type
:nnoremap ` '
:nnoremap ' `
"Special marks:
"last changed text
:help `[
"visual SELECTION
:help `<
"last jump
:help ``
"last change
:help `.
"next lowercase mark
:help ]`
"swap highlighted text with last deleted text
"This one isn't working right sometimes; have to debug
:vnoremap <C-x> <Esc>`.``gvP``P
"gp selects code that was just pasted in the visual mode last used
:nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
"}}}
"Jumps {{{
:help jump-motions
"CTRL-O
"CTRL-I
:help changelist
"g; g,
:help [(
"}}}
"Registers{{{
:help registers
"numbered registers
:help quote_number
"would like a plugin that cycles through these
:help quote.
:help quote:
:help quote=
:help quote/
:help i_CTRL-R
"go to expression and try ciW<c-r>=<c-r>"
"there are 86400 seconds in a day
:help c_CTRL-R_CTRL-W
"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment