krisajenkins / vim-pipe

Send a vim buffer through a command and instantly see the output.
MIT License
186 stars 15 forks source link

vim-pipe submits the whole buffer only #10

Open randomizedthinking opened 8 years ago

randomizedthinking commented 8 years ago

Then a user has to either open a new file or comment out other lines when working on different piece of codes. It becomes so inconvenient especially when working with a large file. I wonder it possible to add a keymap which will submit selected lines? Thanks!

jpassaro commented 6 years ago

The VimPipe() command that r maps to does take a range, which means this is trivial to implement. This is in my vimrc:

vnoremap <silent> <LocalLeader>r : call VimPipe()<CR>

I have certain SQL files with common commands that I want to run individually, not all at once, without having to comment out the rest. For those, I also override the range for the usual VimPipe() command:

nnoremap <silent> <LocalLeader>r :. call VimPipe()<CR>

(uses "." as the range, i.e. the current line, rather than "%" which is the whole buffer.)

@krisajenkins would you be interested in PRs for the following?