Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Character-wise regions? #22

mattboehm opened this Issue · 6 comments

2 participants


I'm interested in using NrrwRgn to edit python docstrings that are RestructuredText. An example would be:

def format(...):
    """Return timestamp string with place holders replaced with values.

    Keyword arguments:
    timestamp     -- the format string (default '')
    priority      -- priority number (default '')
    priority_name -- priority name (default '')
    message       -- message to display (default '')

I would not want the triple-quotes to be included in the region as this could mess up the syntax highlighting for the region.

I imagine switching everything to not be linewise might be too complicated an edit for a limited use case, but wanted to get your thoughts. I suppose I might be able to use the hooks to delete the quotes on enter and add them back in on write instead...


That does not seem to work as expected. I've recorded a small screencast that shows what happens when I highlight text and hit <leader>nr with a freshly pulled copy of NrrwRgn. This is followed by a short example of what I expect to do (but please ignore the fact that I accidentally included a closing quote in my selection.)


I was using character-wise selection (v) but block-wise selection (ctrl-v) gives me the same result; perhaps there is a bug? All 3 selection modes only give me the full first line when I hit nr despite multiple lines being selected.

@chrisbra chrisbra closed this in 02ba492

Awesome, works as expected now =). Thanks for the really quick response.

@vim-scripts vim-scripts referenced this issue from a commit in vim-scripts/NrrwRgn
@chrisbra Version 32
- hooks could corrupt the narrowed buffer, if it wasn't closed (reported by  jszakemeister chrisbra/NrrwRgn#19, thanks!)- Don't parse /doc/options.txt for finding out buffer-local options  (reported by AguirreIF chrisbra/NrrwRgn#21,  thanks!), instead include a fix set of option names to set when opening the  narrowed buffer.- Switching buffers in the original narrowed buffer, may confuse NrrwRgn.- Code cleanup (no more separate functions for visual and normal mode)- fix issue 22 (characterwise narrowing was brocken in last commit, reported  by Matthew Boehm in chrisbra/NrrwRgn#22, thanks!)- in characterwise visual selection, trailing \n is not stripped when writing  (reported by Matthew Boehm in,  thanks!)- highlighting was wrong for characterwise visual selections- update original window for multi narrowed regions (, reported by Dane Summers, thanks!),  use the g:nrrw_rgn_update_orig_win variable to enable- error when narrowed window was moved to new tab and trying to quit  (, reported by Mario Ricalde, thanks!)- better default names for the narrowed window  (, reported by Mario Ricalde, thanks!)- when setting g:nrrw_rgn_write_on_sync the original file will be saved,  whenever the narrowed window is written back  (, reported by Mario Ricalde, thanks!)- Some more error handling when using |:WidenRegion|- Make sure highlighting is removed when using |:WidenRegion|(automatically uploaded)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.