summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-10-24 15:33:32 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-10-24 15:33:32 +0200
commit0d1ebf170f251b58fb642c4f8cf46a97bdbe40da (patch)
tree2a92d54c7127331f9301272fff5e4fe916547999
parentd2a0a8458a1d761c7e6f8fb6d97ab1c317c5211b (diff)
downloaddotfiles-0d1ebf170f251b58fb642c4f8cf46a97bdbe40da.tar.gz
Runbuffer
-rw-r--r--.vim/vimrc12
1 files changed, 11 insertions, 1 deletions
diff --git a/.vim/vimrc b/.vim/vimrc
index 8afb835..b21d04a 100644
--- a/.vim/vimrc
+++ b/.vim/vimrc
@@ -57,7 +57,9 @@ nmap <silent> <C-e> :e .<CR>
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
-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>
nmap <silent> <F5> :NERDTreeToggle<CR>
nmap <silent> <F6> :TlistToggle<CR>
@@ -87,6 +89,7 @@ command -bar Hexmode call ToggleHex()
command! MakeTags !ctags -R .
command -bar Newterm call Create_term()
+command -bar Runbuffer call Run_buffer()
" ===========
" FUNCTIONS
@@ -98,6 +101,13 @@ function Create_term()
startinsert
endfunction
+function Run_buffer()
+ let filename = expand("%:p")
+ tabnew
+ execute "terminal" . filename
+ startinsert
+endfunction
+
" helper function to toggle hex mode
function ToggleHex()
" hex mode should be considered a read-only operation