aboutsummaryrefslogtreecommitdiff
path: root/.vim/vimrc
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-04 14:02:21 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-04 14:02:21 +0200
commit0dc9b50d09a43f90cfba9a5140a54ee6d682d341 (patch)
treecaa46cecef1f5ef8c655aae9d948f43e5a380324 /.vim/vimrc
parentd1b874d8f5d83a6ddfbde86d55ff70ad29c4584e (diff)
downloaddotfiles-0dc9b50d09a43f90cfba9a5140a54ee6d682d341.tar.gz
Command FileHEader
Diffstat (limited to '.vim/vimrc')
-rw-r--r--.vim/vimrc9
1 files changed, 7 insertions, 2 deletions
diff --git a/.vim/vimrc b/.vim/vimrc
index c6b1f0d..23daddd 100644
--- a/.vim/vimrc
+++ b/.vim/vimrc
@@ -78,8 +78,6 @@ nmap <silent> gn :tabnew<CR>:e .<CR>
" 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