Adds ability to load templates in vim
Will add to it at some point so I can view the template in fzf's preview
This commit is contained in:
parent
e325e49959
commit
dcfc8e7fe4
1 changed files with 11 additions and 0 deletions
|
@ -9,3 +9,14 @@ nnoremap <leader>b = :FzfBuffers<cr>
|
||||||
nnoremap <leader>h = :FzfHelptags<cr>
|
nnoremap <leader>h = :FzfHelptags<cr>
|
||||||
" The space is important at the end of this mapping
|
" The space is important at the end of this mapping
|
||||||
nnoremap <leader>/ = :FzfRg
|
nnoremap <leader>/ = :FzfRg
|
||||||
|
|
||||||
|
function! s:read_template_into_buffer(template)
|
||||||
|
" has to be a function to avoid the extra space fzf#run insers otherwise
|
||||||
|
execute '0r ~/Templates/'.a:template
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
command! -bang -nargs=* LoadTemplate call fzf#run({
|
||||||
|
\ 'source': 'ls -1 ~/Templates',
|
||||||
|
\ 'down': 20,
|
||||||
|
\ 'sink': function('<sid>read_template_into_buffer')
|
||||||
|
\ })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue