summaryrefslogtreecommitdiff
path: root/.vim/vimrc
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-05-24 00:39:34 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-05-24 00:40:48 +0200
commite0571530ffc3396cd0235ba94e63de2d7aa27f62 (patch)
tree95aec8ea5f32eb8ebbca66252cb519749d3f6d7a /.vim/vimrc
parentc5265e183f3e7306a3a4b7db01a91d044d3b79e2 (diff)
downloaddotfiles-e0571530ffc3396cd0235ba94e63de2d7aa27f62.tar.gz
updated Vimrc: Terminal funcs
Diffstat (limited to '.vim/vimrc')
-rw-r--r--.vim/vimrc22
1 files 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 <silent> <C-e> :e .<CR>
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
-au filetype c* nmap <silent> <F8> :make<CR>
+au filetype c* nmap <silent> <F8> :Make<CR>
au filetype sh nmap <silent> <F8> :Runbuffer<CR>
au filetype python nmap <silent> <F8> :Runbuffer<CR>
@@ -81,10 +81,6 @@ nmap <silent> <F4> :tabnew<CR>:e .<CR>
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