hwartig / vim-seeing-is-believing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this?

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

Key Mappings

  • <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.

Configuration

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

Kudos

vim-seeing-is-believing is an adaption of https://github.com/t9md/vim-ruby-xmpfilter for seeing_is_believing.

About

License:MIT License


Languages

Language:Vim Script 100.0%