From 0d1ebf170f251b58fb642c4f8cf46a97bdbe40da Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 24 Oct 2019 15:33:32 +0200 Subject: Runbuffer --- .vim/vimrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to '.vim/vimrc') diff --git a/.vim/vimrc b/.vim/vimrc index 8afb835..b21d04a 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -57,7 +57,9 @@ nmap :e . nnoremap @=(foldlevel('.')?'za':"\") vnoremap zf -nmap :make +au filetype c* nmap :make +au filetype sh nmap :Runbuffer +au filetype python nmap :Runbuffer nmap :NERDTreeToggle nmap :TlistToggle @@ -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 -- cgit v1.2.3