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