VIM: Split open same file and edit only 1 window
VIM: Please advise whether it is possible to split open a file and edit only one of the open windows.
|
Hi,
Could you please describe in more detail what you want to do? Markus |
VIM same file split open
Hi Marcus,
The requirement is that a particular file needs to be split open (i.e. 2 windows for the same file) and if any modification is made to the first window (say delete 1 line), no change should be seen on the second window (that line should still be visible in the second window). Another use case is while handling a log file. If :v/pattern/d is used on one window (deletes all line which do not contain pattern), the full file should still be visible on the second window. Thanks in advance. |
mh, I think you'll have to make a backupfile and edit both, the original which may be edited in one window and the second one which may not be edited in another window.
You can for example start vim with this command Code:
cp file.txt file.txt.bkp && vim -o file.txt file.txt.bkp Markus |
Thanks Marcus. It would solve the requirement. I was searching for a vim only solution. This particular feature is possible within emacs (though I understand the underlying difference between the two). I was considering something on the lines of creating a temporary buffer (some duplicate buffer kinds command).
Thanks again for the reply. Would appreciate further discussion. |
Well, I didn't say that there isn't a "vim-only" solution. Vim works with buffers (probably any editor does, but they use the term "buffer" extensively in the documentation). So you may search for an explanation of buffers in the vim-documentation (or with Google). Since vim has a powerful macrolanguage it will surely be possible to achieve your requirements (if it isn't yet implemented).
Markus |
Quote:
|
Quote:
Markus |
Quote:
Code:
#!/bin/bash |
All times are GMT -5. The time now is 05:22 AM. |