Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

CtrlPLine version that only searches the current buffer #396

rgrinberg opened this Issue Apr 14, 2013 · 6 comments


None yet
4 participants

rgrinberg commented Apr 14, 2013

This is the slightly more useful use case for me. Although the current behaviour is also useful sometimes.


kien commented Apr 15, 2013

Vim's /pattern has always done the job just fine for me. I'm not sure if a slight improvement will be worth adding this.


rgrinberg commented Apr 15, 2013

Yes I completely understand your position since it's only a tiny improvement. For me the change is worth is however because it's superior over /pattern because it does not jump from where you're navigating. Sometimes I would only like to reference the lines and immediately jump back. This saves me the interruption of context switching. And it's also superior to quickfix because of the incremental nature. In any case this is a trivial change to make so I will gladly keep it in my own fork.

Are you against the feature on principle or is just you don't think it's worth your time?


kien commented Apr 15, 2013

Neither. I simply want to avoid it being redundant. I'll look into this regardless.

@rgrinberg Have you tried setting the 'incsearch' option? Try /pattern with this option. The buffer will scroll to the appropriate match, and when you're done committing the line to your brain-memory, just hit ESC and you'll be back to where you started from. This trick even works with i_Ctrl-O =)

@kien kien closed this in 27e2375 Jul 5, 2013

dusans commented Aug 4, 2013

This works if i do for instance
:CtrlPLine _vimrc
but i cant get it working with
:CtrlPLine expand("%")
What am i doing wrong?


kien commented Aug 4, 2013

@dusans expand("%") is a function call. So the correct syntax is :execute "CtrlPLine ".expand("%"). But in this case, you can just use :CtrlPLine %.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment