diff options
author | katherine <shmibs@shmibbles.me> | 2017-10-17 01:33:34 -0700 |
---|---|---|
committer | katherine <shmibs@shmibbles.me> | 2017-10-17 01:33:34 -0700 |
commit | 58d628a8e88547eb5282e75c44a39613bedc474e (patch) | |
tree | 0b93a9dbe0c33f01bd72e9e074ffb48a4d7af9d3 | |
parent | 74404b9e30a4b0f0554a6107bc955aa04afafaa0 (diff) | |
download | dotfiles-58d628a8e88547eb5282e75c44a39613bedc474e.tar.gz |
clean and comment skeleton loading
-rw-r--r-- | .vimrc | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -254,21 +254,17 @@ autocmd FileType zsh call Settings_shell() "command for reading filetype skeletons function! Settings_skel_read() + "is the buffer not empty? if line('$') != 1 || col('$') != 1 - " echoh ErrorMsg - " echo "err: cannot load skeleton: buffer is not empty" - " echoh None return 1 end + "is there no template? if filereadable(split(&rtp, ',')[0] . "/skel/" . &ft) == 0 - " echoh ErrorMsg - " echo "err: cannot load skeleton: no skeleton found for filetype '" . &ft . "'" - " echoh None return 1 end - let l:fname = split(&rtp, ',')[0] . "/skel/" . &ft - execute 'r ' . l:fname - execute "normal ggJ/%START%\<CR>cc" + execute 'r ' . split(&rtp, ',')[0] . "/skel/" . &ft + "move cursor to START + execute "normal ggJ/%START%\<CR>:%s/%START%//g\<CR>" redraw! endfunction autocmd FileType * call Settings_skel_read() |