Oliver Davies
7860c3506a
Copied from tjdevries' config_manager repository, add a global `save_and_exec` function that will write and source vim or lua files, and use this within my existing `<leader>so` key mapping.
13 lines
253 B
VimL
13 lines
253 B
VimL
if !exists('*opdavies#save_and_exec')
|
|
function! opdavies#save_and_exec() abort
|
|
if &filetype == 'vim'
|
|
:silent! write
|
|
:source %
|
|
elseif &filetype == 'lua'
|
|
:silent! write
|
|
:luafile %
|
|
endif
|
|
return
|
|
endfunction
|
|
endif
|