Monday, July 21, 2014

Re: Treat section of file as entire file

On Mon, Jul 21, 2014 at 10:42 AM, Paul <google1241@rainslide.net> wrote:
> Say you have a file that contains many code functions, and you're only
> concerned with one particular function. I wonder if there's a plugin that
> will let you select a part of a file, in this case our function, and limit
> vim 'things' to only this selected section. For example, doing a / search
> would only search within the target area. :%s// would only look inside the
> area, etc. I know I could copy the area to a new file, edit that, then paste
> it back, but I really want it the same file, because for example I might
> want to do a :make on it, which requires the other 'outside' bits of the
> file to be present.
>
> Anyone know if such a thing exists?

You should look into Christian Brabandt's NarrowRegion plugin.
(https://github.com/chrisbra/NrrwRgn)
I believe it does what you're looking for.

Cheers,

Ethan Alan
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> --- You received this message because you are subscribed to the Google
> Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment