-
-
Save ur4ltz/cf4a58a49dd1692fc4cc59bfece763ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" put this into your .vimrc | |
func! Run_current_line() | |
" get current line and run it as a system command | |
let content = system(getline('.')) | |
" open new window | |
silent pedit `=tempname()` | |
" change focus to the window | |
wincmd P | |
" append content | |
call append(0, split(content, '\n')) | |
endf | |
" mapping | |
nmap <leader>r :call Run_current_line()<CR> | |
" so if you uncomment below line and press <leader>r over it ( which is \r or ,r or " smth eslse depending on your config) | |
" ls | |
" you'll get window with content of the PWD | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment