From 0dc9b50d09a43f90cfba9a5140a54ee6d682d341 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 4 Jun 2020 14:02:21 +0200 Subject: Command FileHEader --- .vim/vimrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.vim/vimrc') diff --git a/.vim/vimrc b/.vim/vimrc index c6b1f0d..23daddd 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -78,8 +78,6 @@ nmap gn :tabnew:e . " COMMANDS " =========== -command -bar InsertHeader call Fileheader() - command -bar Suw :w !SUDO_ASKPASS="/usr/lib/ssh/ssh-askpass" sudo -A tee % " Command HEXMODE @@ -91,11 +89,18 @@ command! MakeTags !ctags -R . command -bar Newterm call Run_in_terminal("") command -bar Runbuffer call Run_in_terminal(expand("%:p")) command -bar Make call Run_in_terminal("make") +command -bar Fileheader call Insert_Header(expand("%")) " =========== " FUNCTIONS " =========== +function Insert_Header(name) + let l:year=system("date +%Y") + call append("0", ["/*", " * ".a:name, " * (c) ".strftime("%Y"), " * License: ", "*/"]) + startinsert +endfunction + function Run_in_terminal(prog) tabnew execute "terminal " . a:prog -- cgit v1.2.3