| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Thu Oct 09, 2008 2:43 am Post subject: Navigating search matches past folds |
|
|
I am using vim 7.x, console version, running over Linux.
I am making good use of folds to ignore unimportant data. If I search
for /pattern/ in a file with folds, the search itself leaves the folds
closed. But as I navigate the matches with "n", a fold will open
automatically if the next match is inside. In my present task, I
really want to ignore the data inside folds completely. Is there some
way to do either of the following?
1) tell / to match only in unfolded lines.
or
2) tell "n" to skip over folds?
Thanks for your help.
Lou |
|
| |
|
Back to top |
John Beckett Guest
|
Posted: Mon Oct 13, 2008 3:08 pm Post subject: Re: Navigating search matches past folds |
|
|
lbova99@yahoo.com wrote:
| Quote: | I am using vim 7.x, console version, running over Linux.
1) tell / to match only in unfolded lines.
|
Good question. All I know is that there is a tip on this:
http://vim.wikia.com/wiki/Search_only_in_unfolded_text
If you get it working, please reply with the good news for my
interest.
John |
|
| |
|
Back to top |
Ben C Guest
|
Posted: Mon Oct 13, 2008 6:49 pm Post subject: Re: Navigating search matches past folds |
|
|
On 2008-10-13, John Beckett <nomail@thanks.junk> wrote:
| Quote: | lbova99@yahoo.com wrote:
I am using vim 7.x, console version, running over Linux.
1) tell / to match only in unfolded lines.
Good question. All I know is that there is a tip on this:
http://vim.wikia.com/wiki/Search_only_in_unfolded_text
If you get it working, please reply with the good news for my
interest.
|
I just have
set foldopen-=search
in my .vimrc. |
|
| |
|
Back to top |
John Beckett Guest
|
Posted: Tue Oct 14, 2008 2:31 am Post subject: Re: Navigating search matches past folds |
|
|
Ben C wrote:
| Quote: | set foldopen-=search
|
Live and learn ... thanks. I guess I'll have to update the tip.
With the above, search stops once per fold (if the search target
occurs one or more times in the fold). The fold is not opened. That
works rather well.
John |
|
| |
|
Back to top |
Guest
|
Posted: Thu Oct 16, 2008 1:45 am Post subject: Re: Navigating search matches past folds // Thank you both! |
|
|
On Oct 13, 5:31 pm, John Beckett <nom...@thanks.junk> wrote:
| Quote: | Ben C wrote:
set foldopen-=search
Live and learn ... thanks. I guess I'll have to update the tip.
With the above, search stops once per fold (if the search target
occurs one or more times in the fold). The fold is not opened. That
works rather well.
John
|
A great time saver and headache avoider. |
|
| |
|
Back to top |
|