Skip to content

Instantly share code, notes, and snippets.

@gfixler
gfixler / showsh.vim
Created July 27, 2012 18:18
Vim: Show-And-Shell - simple, shell session playback
" SHOW-AND-SHELL
" An *extremely* simplistic shell 'simulator'.
" Allows for copying a shell session into vim,
" marking up 'typed' sections, then stepping
" through a simulation of using the shell with
" a single key. Useful for didactic demos.
"
" Usage:
" Load or create a ShowShell file.
" Run :ShowShell_setup()
@gfixler
gfixler / vim_mapkey.vim
Created July 25, 2012 18:19
Vim Mapkey() function: an inverse for maparg()
function! Mapkey (keys, mode)
" Inverse of maparg()
" Pass in a key sequence and the first letter of a Vim mode.
" Returns key mapping mapped to it in that mode, else '' if none.
" <Keys> - e.g. "<Space>" and "<CR>" - are matched case-insensitively,
" as are things before dashes, e.g. the "C-S-" part of "<C-S-A>".
" Chorded "<keys>" are not handled properly yet (i.e. "<C-Space>")
" Example:
" :nnoremap <Tab> :bn<CR>
" :call Mapkey(':bn<CR>', 'n')
@gfixler
gfixler / EasyJumpPreciseMotionAce.vim
Created July 24, 2012 01:14
A Vim take on Emacs' AceJump mode, itself based on Vim's PreciseJump and EasyMotion plugins
" ACEJUMP
" Based on emacs' AceJump feature (http://www.emacswiki.org/emacs/AceJump).
" AceJump based on these Vim plugins:
" EasyMotion (http://www.vim.org/scripts/script.php?script_id=3526)
" PreciseJump (http://www.vim.org/scripts/script.php?script_id=3437)
" Type AJ mapping, followed by a lower or uppercase letter.
" All words on the screen starting with that letter will have
" their first letters replaced with a sequential character.
" Type this character to jump to that word.