From e0571530ffc3396cd0235ba94e63de2d7aa27f62 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 24 May 2020 00:39:34 +0200 Subject: updated Vimrc: Terminal funcs --- .vim/vimrc | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index e371a82..e733edc 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -60,7 +60,7 @@ nmap :e . nnoremap @=(foldlevel('.')?'za':"\") vnoremap zf -au filetype c* nmap :make +au filetype c* nmap :Make au filetype sh nmap :Runbuffer au filetype python nmap :Runbuffer @@ -81,10 +81,6 @@ nmap :tabnew:e . command -bar InsertHeader call Fileheader() -function Fileheader() - cursor(1,1) -endfunction - command -bar Suw :w !SUDO_ASKPASS="/usr/lib/ssh/ssh-askpass" sudo -A tee % " Command HEXMODE @@ -93,23 +89,17 @@ command -bar Hexmode call ToggleHex() "^] Jump to tag, ^t jump back "command! MakeTags !ctags -R . -command -bar Newterm call Create_term() -command -bar Runbuffer call Run_buffer() +command -bar Newterm call Run_in_terminal("") +command -bar Runbuffer call Run_in_terminal(expand("%:p")) +command -bar Make call Run_in_terminal("make") " =========== " FUNCTIONS " =========== -function Create_term() - tabnew - terminal - startinsert -endfunction - -function Run_buffer() - let filename = expand("%:p") +function Run_in_terminal(prog) tabnew - execute "terminal" . filename + execute "terminal " . a:prog startinsert endfunction -- cgit v1.2.3