vim-seeing-is-believing provides utility functions which make the following easy
- insert/delete annotation mark
# =>
. - virtual keymap for marking and executing seeing-is-believing against current buffer.
seeing_is_believing is a gem and can be installed with
$ gem install seeing_is_believing
<Plug>(seeing-is-believing-mark)
- add mark (# =>
) to the line.<Plug>(seeing-is-believing-run)
- run all marked lines.<Plug>(seeing-is-believing-mark-and-run)
- add mark to the line and run it. If line is already marked, then previous mark will be replaced.
vim-seeing-is-believing doesn't provide any default keymap.
Set following line in your .vimrc
" Enable seeing-is-believing mappings only for Ruby
augroup seeingIsBelievingSettings
autocmd!
autocmd FileType ruby nmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)
autocmd FileType ruby xmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)
autocmd FileType ruby nmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby xmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby imap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby nmap <buffer> <F5> <Plug>(seeing-is-believing-run)
autocmd FileType ruby imap <buffer> <F5> <Plug>(seeing-is-believing-run)
augroup END
vim-seeing-is-believing is an adaption of https://github.com/t9md/vim-ruby-xmpfilter for seeing_is_believing.