Advertisement
mosaid

Untitled

Feb 24th, 2020
1,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.61 KB | None | 0 0
  1. " file ~/.vim/ftplugin/sh.vim
  2.  
  3. function! RunBash()
  4.     let s:current_file = expand("%")
  5.     enew|silent execute ".!bash " . shellescape(s:current_file, 1)
  6.     setlocal buftype=nofile bufhidden=wipe noswapfile nowrap
  7. endfunction
  8.  
  9. nnoremap <Leader>c :call RunBash()<CR>
  10.  
  11.  
  12. " =======================================================
  13. " file ~/.vim/ftplugin/python.vim
  14. function! RunPython()
  15.     let s:current_file = expand("%")
  16.     enew|silent execute ".!python " . shellescape(s:current_file, 1)
  17.     setlocal buftype=nofile bufhidden=wipe noswapfile nowrap
  18. endfunction
  19.  
  20. nnoremap <Leader>c :call RunPython()<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement