2 title: Vimscript snippets
7 ### Bind function to key and command
9 command! YoFunctionHere call s:YoFunctionHere()
10 nnoremap <silent> x :call <SID>FunctionHere()<CR>
11 function! s:FunctionHere()
14 ### Call a function in insert mode
16 inoremap X <C-R>=script#myfunction()<CR>
17 inoremap <F2> <C-R>=MyVimFunc()?'':''<CR>
21 if globpath(&rtp, "plugin/commentary.vim") != ""
26 if exists("g:hello_loaded") | finish | endif
29 function hello#method()
32 " calling hello#method() will load only if autoload()
39 echom "requires vim >= 7.4"