--- title: Vimscript snippets --- ### Bind function to key and command command! YoFunctionHere call s:YoFunctionHere() nnoremap x :call FunctionHere() function! s:FunctionHere() endfunction ### Stuff expand('') " word under cursor filereadable(fname) fnamemodify(fname, ':e') " current file extension - see expand() expand("%") " current file