[olug] Unix Tip: STOP ASKING QUESTIONS

ktb xyf at nixnotes.org
Tue Mar 25 22:21:21 UTC 2003


On Tue, Mar 25, 2003 at 09:46:56AM -0600, andrew wrote:
> Well, since this tip didn't really provide any examples of how to 
> actually use any of these 'indispensible' commands, I figured that 
> someone might find this useful.  Maybe someone else will post their most 
> useful vim/sed/awk tricks.
> 
> My (current) favorite vim-ism:
> 
> ctrl-w v
> splits window vertically
> ctrl-w [l | h]
> switches to the left or right pane
> 
> This is nice as it lets you open two files right next to each other so 
> you can compare them or yank parts of one into the other.  It works in 
> gvim as well, though I don't know if it works in standard vi (my guess 
> is probably no). 

That is a nice trick.  I think it was added to version 6.0 but might be
wrong on that.  Seems as though I tried vertical split on a prior
version and it didn't work.  No it doesn't work with the original vi.

I'm usually editing a file and then decide I want to slurp another in so
I do -

:vsp file_name

I'll usually use 'ctrl-w w' to iterate between the two windows and
'ctrl-w |' to make the current window full screen, 'ctrl-w =' to make
them equal sized again.  
kent

-- 
To know the truth is to distort the Universe.
                      Alfred N. Whitehead (adaptation)


More information about the OLUG mailing list