Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Focus temporal buffer in vim

Tags:

vim

vi

vim-plugin

I would like to have the following functionality in the vim editor.

  1. Select a certain text (e.g. paragraph)
  2. Open a temporal buffer with only the selecting text (on full screen). The purpose here is to remove all the distractions and focus only on the selected chunk.
  3. Edit the text in the temporal buffer
  4. Close the temporal buffer with certain key, so that everything from the temporal buffer will replace the selected text in the initial buffer.

Is there already such a functionality in vim or such a vimscript?

like image 292
xralf Avatar asked Jun 14 '26 18:06

xralf


1 Answers

You are looking for something called emacs calls Narrowing. There are is a Vim plugin that does this for you: Christian Brabandt's NrrwRgn plugin.

like image 154
Peter Rincker Avatar answered Jun 17 '26 19:06

Peter Rincker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!