aboutsummaryrefslogtreecommitdiff
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:39:34 +0200
commit799f901c405b1e1d20de0a820b674281db2948ce (patch)
treedce52914889e116bfc7331a6a04e3eac6180690e /.vim/vimrc
parentb9fc5fd75ddf4f1d77ae7cd673b80260887cacf9 (diff)
downloaddotfiles-799f901c405b1e1d20de0a820b674281db2948ce.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 0857bcf..87b6cf8 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