pasting:
vim --version
Check whether xterm_clipboard has a + or - preceding it. If -, add it by running
a version with it enabled. gvim has it enabled. I installed vim-python, to install
gvim, which then affected my normal vim.
Once enabled,
ESCAPE " + p
pastes from the xterm clipboard.
From http://vim.wikia.com/wiki/Accessing_the_system_clipboard
* "+2yy – copy two lines to X11 clipboard
* "+dd – cut line to X11 clipboard
* "+p – paste X11 clipboard
-----------------
Code folding.
select block
ZF
marks the code for folding
-------------------
multiple tabs:
vi -p *.tex
or
:tabnew filename
tab navigate with CTRL pg-up and pg-down
Gavin: tabdo command
executes command on all tabs.
-----------------------
Bookmarking:
-------------------
Mapping keys in Vim:
To map to control-V, the paste function whilst in insert mode:
:imappi
or something like that
-----------------
Search / replace (from http://www.linux.com/learn/tutorials/8255-vim-tips-the-basics-of-search-and-replace):
:/string search
:?string backwards search
n next
N previous
:8,10 s/search/replace/g from line 8 to 10, g(lobal = repeats on lines)
Or, use visual select and execute the search. v is visual, V is line visual, CRTL-v is block visual.
:%s/search/replace/g over entire file
----------------------
Vim white spaces on pasting from GUI
Pre paste, do
:set paste
Post paste, do
:set nopaste
to prevent automatic indentation. From http://aymanh.com/a-collection-of-vim-tips
-------------------------
Copy, paste multiple buffers.
" a y to place into register `a'.
" a p to place into register `a'.
So, the `+' is the global buffer....
--------------------------
To pull the results of a command into the editor:
:r ! command
for example
:r ! ls gabvo*
;)
----------------------------
Speech marks when using vim-latex:
Insert mode, CTRL-V, "
CTRL-V indicates literal mode, I think.
http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-not-loaded-vim7
-------------
You've missed an < Esc > you code snaffling simpleton!
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteJuvenile comments will not be tolerated, Gavbo.
ReplyDeletebastard!
ReplyDeleteYour details have been passed to my lawyers!
ReplyDelete