<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-8775107278649697857</id><updated>2010-03-08T01:58:51.175-08:00</updated><title type='text'>Vim Tips Blog : Programmer Productivity Tips</title><subtitle type='html'>Vim Text Editor Tips and Tricks. Regular Expressions, Searching, Substituting, Scripts, Recording, Registers, Completion, Syntax Highlighting, Abbreviations, Maps for Programmers and others.</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/index.php'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.zzapper.co.uk/vim-tips-blog/atom.xml'/><author><name>zzapper</name><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-7651673288660536334</id><published>2010-03-06T05:02:00.000-08:00</published><updated>2010-03-08T01:58:51.187-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='debugger'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><title type='text'>Useful VIM Abbreviations for debugging Perl</title><content type='html'>&lt;div class=box&gt;iab perlb  print "&amp;lt;p&gt;debug ::: $_ :: $' :: $`  line ".__LINE__."\n";exit;&lt;br /&gt;iab perlbb print "&amp;lt;p&gt;debug ::: &amp;lt;C-R&gt;a  line ".__LINE__."\n";exit;&lt;br /&gt;iab perlbd do{print "&amp;lt;p&gt;debug :: &amp;lt;C-R&gt;a  line ".__LINE__."\n";exit} if $_ =~ /\w\w/i;&lt;br /&gt;iab perld use Data::Dumper;$Data::Dumper::Pad="&amp;lt;br&gt;";print Dumper @product_array;exit;&lt;br /&gt;&lt;br /&gt;the &amp;lt;C-R&gt;a automatically inserts whatever variable you had previously stored in register a&lt;br /&gt;&lt;b&gt;Dumper&lt;/b&gt; allows you to display arrays and hashes, you really should be using it.&lt;br /&gt;&lt;br /&gt;Perl can be debugged using the Perl debugger eg &gt; perl -d test.pl&lt;br /&gt;&lt;br /&gt;or with the tk gui&lt;br /&gt;&lt;br /&gt;perl -d:ptkdb test.pl&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-7651673288660536334?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/7651673288660536334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/03/useful-vim-abbreviations-for-debugging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7651673288660536334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7651673288660536334'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/03/useful-vim-abbreviations-for-debugging.html' title='Useful VIM Abbreviations for debugging Perl'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-1853333017418525626</id><published>2010-02-24T15:40:00.000-08:00</published><updated>2010-03-04T14:34:58.218-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='matchit.vim'/><category scheme='http://www.blogger.com/atom/ns#' term='folding'/><title type='text'>VIM Folding Away Unwanted Text/code</title><content type='html'>I've only just started using folding but how did I live without it before and it's so EASY! You make sections of the code you are uninterested in "disappear" with a fold or several folds. Of course many editors have folding but VIM combines folding with the power of its motion commands, you can even use regex!&lt;br /&gt;&lt;div class="box"&gt;" folding : hide sections to allow easier comparisons&lt;br /&gt;zf}                               : fold paragraph using motion&lt;br /&gt;v}zf                              : fold paragraph using visual&lt;br /&gt;zf'a                              : fold to mark&lt;br /&gt;zo                                : open fold&lt;br /&gt;zc                                : re-close fold&lt;br /&gt;:help folding&lt;br /&gt;&lt;br /&gt;the folds I used&lt;br /&gt;a) move to beginning of code I wish to work on and everything before&lt;br /&gt;zf1G                              : fold all lines from current line to beginning of the file&lt;br /&gt;&lt;br /&gt;a) move to end of code I wish to work on and everything after&lt;br /&gt;zfG&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-1853333017418525626?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/1853333017418525626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/02/vim-folding-away-unwanted-textcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1853333017418525626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1853333017418525626'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/02/vim-folding-away-unwanted-textcode.html' title='VIM Folding Away Unwanted Text/code'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-1483835050553889857</id><published>2010-02-22T14:24:00.000-08:00</published><updated>2010-02-22T14:24:05.793-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='matchit.vim'/><title type='text'>Matching html/xml/script tags with matchit.vim</title><content type='html'>&lt;div class="box"&gt;&lt;br /&gt;It is incredibly useful to be able to match tags in tangled PHP,Javascript and HTML files this is possible with the plugin matchit.vim. You will already know that Vim matches or jumps to a matching parenthesis ({{ , with matchit.vim you can jump to a matching tag.&lt;br /&gt;&lt;br /&gt;Recently I need to configure it so that it would match tags in html files with the arbitrary extension index.raa&lt;br /&gt;&lt;br /&gt;I achieved this by adding *.raa to the following line&lt;br /&gt;au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm,*.raa  call s:FThtml()in filetype.vim&lt;br /&gt;&lt;br /&gt;but that's not upgrade safe so instead create&lt;br /&gt;a subdirectory ftdetect in your vim folder &lt;br /&gt;and create a file (in my case)&lt;br /&gt;raa.vim containing just one line&lt;br /&gt;au! BufRead,BufNewFile *.raa set filetype=raa&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-1483835050553889857?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/1483835050553889857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/02/matching-htmlxmlscript-tags-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1483835050553889857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1483835050553889857'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/02/matching-htmlxmlscript-tags-with.html' title='Matching html/xml/script tags with matchit.vim'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-7060771547567691827</id><published>2010-01-28T15:25:00.000-08:00</published><updated>2010-01-28T15:25:53.956-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim syntax'/><title type='text'>Automatically Enable VIM Syntax Highlighting for a non-standard file extension</title><content type='html'>&lt;div class="box"&gt;:syntax on&lt;br /&gt;&lt;br /&gt;"enable perl syntax highlighting for a file with a non-standard extension &lt;br /&gt;:autocmd BufReadPost *.plx set syntax=perl&lt;br /&gt;&lt;br /&gt;" some odd useful abbreviations&lt;br /&gt;:cab synh set syntax=html&lt;br /&gt;:cab synp set syntax=php&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-7060771547567691827?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/7060771547567691827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/01/automatically-enable-vim-syntax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7060771547567691827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7060771547567691827'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/01/automatically-enable-vim-syntax.html' title='Automatically Enable VIM Syntax Highlighting for a non-standard file extension'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-3382746196087381731</id><published>2010-01-18T15:16:00.000-08:00</published><updated>2010-01-18T16:24:40.566-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='word'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><title type='text'>Reading MS Word Documents with VIM</title><content type='html'>&lt;div class="box"&gt;Put this in your .vimrc&lt;br /&gt;autocmd BufReadPost *.doc %!antiword "%"&lt;br /&gt;&lt;br /&gt;install antiword on your PC, comes with Cygwin and as a win32 executable.&lt;br /&gt;&lt;br /&gt;then vou can do&lt;br /&gt;&lt;br /&gt;gvim cv.doc&lt;br /&gt;&lt;br /&gt;Remember this is READY ONLY you cannot Modify a Word Document but nevertheless very useful for fishing out the text you need from a Microsoft Word document or alternatively reading a Word document with all the advantages of Vims powerful search options&lt;br /&gt;&lt;br /&gt;" set up vim to read MS Word documents read only &lt;br /&gt;autocmd BufReadPre *.doc set ro&lt;br /&gt;autocmd BufReadPre *.doc set hlsearch!&lt;br /&gt;autocmd BufReadPost *.doc %!antiword "%"&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-3382746196087381731?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/3382746196087381731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/01/reading-ms-word-documents-with-vim.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3382746196087381731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3382746196087381731'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2010/01/reading-ms-word-documents-with-vim.html' title='Reading MS Word Documents with VIM'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-2635151309210937911</id><published>2009-12-22T09:09:00.000-08:00</published><updated>2009-12-22T09:09:21.984-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='numbering lines'/><title type='text'>Number Each Line of Current File</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;to merely display numbers&lt;br /&gt;:set number              &lt;br /&gt;&lt;br /&gt;following will actually insert numbers but relies on external Linux utility nl&lt;br /&gt;:new | r!nl #   (where hash is alternate file name)&lt;br /&gt;&lt;br /&gt;Vim Way&lt;br /&gt;:%s/^/\=line('.'). ' '&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-2635151309210937911?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/2635151309210937911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/number-each-line-of-current-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/2635151309210937911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/2635151309210937911'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/number-each-line-of-current-file.html' title='Number Each Line of Current File'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-5413000613970947502</id><published>2009-12-21T10:37:00.000-08:00</published><updated>2009-12-21T10:37:37.407-08:00</updated><title type='text'>Replace a line with the contents of a file</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;Replace a marker line (contaning just the word mark) with the contents of an&lt;br /&gt;external file doc.txt&lt;br /&gt;&lt;br /&gt;" replace string with contents of a file, -d deletes the "mark"&lt;br /&gt;:g/^MARK$/r doc.txt | -d &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-5413000613970947502?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/5413000613970947502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/replace-line-with-contents-of-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5413000613970947502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5413000613970947502'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/replace-line-with-contents-of-file.html' title='Replace a line with the contents of a file'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-952446593733764064</id><published>2009-12-10T01:48:00.000-08:00</published><updated>2009-12-10T01:48:38.073-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><title type='text'>Integrating Vim and Cygwin</title><content type='html'>&lt;div class=box&gt;I use and love &lt;a href="http://www.cygwin.com/"&gt;Cygwin&lt;/a&gt; but mostly use the standard Windows gVim (Gui Vim) rather than that supplied by Cygwin. &lt;br /&gt;&lt;br /&gt;in my .vimrc I have&lt;br /&gt;&lt;br /&gt;if has('win32')&lt;br /&gt;source $VIMRUNTIME/mswin.vim&lt;br /&gt;behave mswin&lt;br /&gt;set shell=c:\\cygwin\\bin\\zsh.exe shellcmdflag=-c shellxquote=\"&lt;br /&gt;else&lt;br /&gt;set ff=unix&lt;br /&gt;endif&lt;br /&gt;&lt;br /&gt;You will probably prefer bash.exe rather than zsh.exe&lt;br /&gt;&lt;br /&gt;I can then run zsh/bash scripts from the command line e.g.&lt;br /&gt;:!grep blah blah&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-952446593733764064?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/952446593733764064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/integrating-vim-and-cygwin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/952446593733764064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/952446593733764064'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/integrating-vim-and-cygwin.html' title='Integrating Vim and Cygwin'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-1982999982482099203</id><published>2009-12-09T11:59:00.000-08:00</published><updated>2009-12-09T11:59:21.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='cream'/><title type='text'>How to Get the Latest Patched Version of VIM</title><content type='html'>&lt;div class=box&gt;The Cream project maintains the &lt;a href="http://cream.sourceforge.net/download.html"&gt;latest version of VIM&lt;/a&gt; you can download it &lt;a href="http://cream.sourceforge.net/download.html"&gt;here&lt;/a&gt; . On the download page you can get latest version of VIM with or without Cream.&lt;br /&gt;&lt;br /&gt;Cream is a free, easy-to-use configuration of the famous Vim text editor for Microsoft Windows, GNU/Linux, and FreeBSD. It uses common menus, standard keyboard shortcuts, and has extensive editing functions for the beginner and expert alike.&lt;br /&gt;&lt;br /&gt;The current version for win32 is gvim-7-2-303.exe they call this a one-click install&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-1982999982482099203?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/1982999982482099203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/how-to-get-latest-patched-version-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1982999982482099203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1982999982482099203'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/how-to-get-latest-patched-version-of.html' title='How to Get the Latest Patched Version of VIM'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-5557529404606087209</id><published>2009-12-07T12:05:00.000-08:00</published><updated>2009-12-07T12:06:37.681-08:00</updated><title type='text'>The Power of  Control R</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;The Control-R mechanism is very useful:-&lt;br /&gt;:h i_CTRL-R&lt;br /&gt;&lt;br /&gt;Usually used for inserting the contents of a register 0-9a-z&lt;br /&gt;but can also insert the following special registers etc&lt;br /&gt;&lt;br /&gt; '"'       the unnamed register, containing the text of the last delete or&lt;br /&gt;yank&lt;br /&gt;'%'     the current file name&lt;br /&gt;'#'     the alternate file name&lt;br /&gt;'*'     the clipboard contents (X11: primary selection)&lt;br /&gt;'+'     the clipboard contents&lt;br /&gt;'/'     the last search pattern&lt;br /&gt;':'     the last command-line&lt;br /&gt;'.'     the last inserted text&lt;br /&gt;'-'     the last small (less than a line) delete&lt;br /&gt;=5*5   insert 25 into text (mini-calculator) &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-5557529404606087209?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/5557529404606087209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/power-of-control-r.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5557529404606087209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5557529404606087209'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/12/power-of-control-r.html' title='The Power of  Control R'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-7939353369224690450</id><published>2009-11-16T04:16:00.000-08:00</published><updated>2009-11-16T04:31:17.487-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regexp memory'/><title type='text'>Deleting all but first two fields in each line of a CSV File</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;In a csv file full of lines such&lt;br /&gt;16 Prop_Description Property description, String 1000&lt;br /&gt;(note that this is actually a space separated csv)&lt;br /&gt;&lt;br /&gt;:%s#\(\d\+ \w\+\).*#\1#g&lt;br /&gt;&lt;br /&gt;filters out all but the field number and name eg&lt;br /&gt;&lt;br /&gt;16 Prop_Description &lt;br /&gt;&lt;br /&gt;a regexp for normal comma separated csv would be&lt;br /&gt;&lt;br /&gt;fred,joe,sid&lt;br /&gt;"fred joe","sue","good boy&lt;br /&gt;&lt;br /&gt;:%s/\([^,]\+\),\([^,]\+\).*/\1,\2/&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-7939353369224690450?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/7939353369224690450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/deleting-all-but-first-two-words-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7939353369224690450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7939353369224690450'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/deleting-all-but-first-two-words-in.html' title='Deleting all but first two fields in each line of a CSV File'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-6844572399993605277</id><published>2009-11-15T14:50:00.000-08:00</published><updated>2009-11-15T14:54:13.844-08:00</updated><title type='text'>VIM working with Paste Commands</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;The paste buffer is usually the easiest way to transfer text between VIM and another application.&lt;br /&gt;&lt;br /&gt;" Redirection &amp; Paste register *&lt;br /&gt;:redir @*                    : redirect commands to paste buffer&lt;br /&gt;:redir END                   : end redirect&lt;br /&gt;:redir &gt;&gt; out.txt            : redirect to a file&lt;br /&gt;" Working with Paste buffer&lt;br /&gt;"*yy                         : yank current line to paste&lt;br /&gt;"+y}                         : yank to end of paragraph&lt;br /&gt;"+yi{                        : yank current paragraph&lt;br /&gt;"*p                          : insert from paste buffer&lt;br /&gt;" yank to paste buffer (ex mode)&lt;br /&gt;:'a,'by*                     : Yank range into paste&lt;br /&gt;:%y*                         : Yank whole buffer into paste&lt;br /&gt;:.y*                         : Yank Current line to paster&lt;br /&gt;" filter non-printable characters from the paste buffer&lt;br /&gt;" useful when pasting from some gui application&lt;br /&gt;:nmap &lt;leader&gt;p :let @* = substitute(@*,'[^[:print:]]','','g')&lt;cr&gt;"*pr&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-6844572399993605277?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/6844572399993605277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/vim-working-with-paste-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6844572399993605277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6844572399993605277'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/vim-working-with-paste-commands.html' title='VIM working with Paste Commands'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-7012561765638392567</id><published>2009-11-08T12:18:00.000-08:00</published><updated>2009-11-14T05:07:39.567-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><title type='text'>Command Line Window q:  or q/</title><content type='html'>&lt;div class="box"&gt;&lt;br /&gt;One of original great improvements of VIM over Classic Vi was the ability to reuse/edit/correct commands laboriously typed in, you had only simple line edit commands available to do this, normally perfectly sufficient of course. However you can also open a command line window to gain full vim command line editing commands:-&lt;br /&gt;&lt;br /&gt;Note these are &lt;span style="font-weight:bold;"&gt;normal-mode commands&lt;/span&gt;!&lt;br /&gt;q:&lt;br /&gt;Creates a small window of your most recent commands&lt;br /&gt;&lt;br /&gt;q/&lt;br /&gt;Creates a small window of your most recent searches&lt;br /&gt;&lt;br /&gt;hitting "&lt;span style="font-weight:bold;"&gt;return&lt;/span&gt;" will execute whatever line you are editing&lt;br /&gt;&lt;br /&gt;to close/leave the command window without executing the current line use &lt;span style="font-weight:bold;"&gt;:quit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-7012561765638392567?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/7012561765638392567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/command-line-window-q-or-q.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7012561765638392567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7012561765638392567'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/command-line-window-q-or-q.html' title='Command Line Window q:  or q/'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-6108831110121310513</id><published>2009-11-04T13:18:00.000-08:00</published><updated>2009-11-04T13:34:09.062-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='cvs'/><category scheme='http://www.blogger.com/atom/ns#' term='backups'/><title type='text'>Using CVS with VIM</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;I'm now using the CVS that comes with Cygwin and the CVS plugin for VIM&lt;br /&gt;&lt;br /&gt;and the plugin &lt;br /&gt;http://www.vim.org/scripts/script.php?script_id=58&lt;br /&gt;&lt;br /&gt;I used to save backups to a directory with a timestamp appended to the filename.&lt;br /&gt;&lt;br /&gt;Now I'll have a proper system with version control, difference between version etc&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-6108831110121310513?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/6108831110121310513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/using-cvs-with-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6108831110121310513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6108831110121310513'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/11/using-cvs-with-vim.html' title='Using CVS with VIM'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-9108229677777456745</id><published>2009-10-29T10:00:00.000-07:00</published><updated>2009-10-29T10:04:42.302-07:00</updated><title type='text'>Editing the File name you Save or Write to (2)</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;Remember you can recall the file name with Control-R %&lt;br /&gt;You can then edit the file name freely&lt;br /&gt;&lt;br /&gt;Vim supports wild cards as long as only ONE file matches eg&lt;br /&gt;&lt;br /&gt;:r ../*/ref.c&lt;br /&gt;&lt;br /&gt;:e long*file*name.h&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-9108229677777456745?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/9108229677777456745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/editing-file-name-you-save-or-write-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/9108229677777456745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/9108229677777456745'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/editing-file-name-you-save-or-write-to.html' title='Editing the File name you Save or Write to (2)'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-3092372910048506180</id><published>2009-10-10T10:40:00.000-07:00</published><updated>2009-10-10T10:42:49.244-07:00</updated><title type='text'>Write/Save a File to a Changed Name</title><content type='html'>&lt;div class=box&gt;&lt;br /&gt;:sav main.php    : Save current file as main.php and "move" to main.php&lt;br /&gt;:sav! %&lt;.bak     : Save Current file to alternative extension (old way)&lt;br /&gt;:sav! %:r.cfm    : Save Current file to alternative extension&lt;br /&gt;:w %:r.cfm    : write Current file to alternative extension&lt;br /&gt;:sav %:s/fred/joe/           : do a substitute on file name&lt;br /&gt;:sav %:s/fred/joe/:r.bak2    : do a substitute on file name &amp; ext.&lt;br /&gt;:!mv % %:r.bak   : rename current file (DOS use Rename or DEL)&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-3092372910048506180?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/3092372910048506180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/writesave-file-to-changed-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3092372910048506180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3092372910048506180'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/writesave-file-to-changed-name.html' title='Write/Save a File to a Changed Name'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-4744362758241696778</id><published>2009-10-05T12:50:00.000-07:00</published><updated>2009-10-05T16:02:11.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='join lines'/><title type='text'>Join Pairs of Lines</title><content type='html'>&lt;div class=box&gt;Compress every other line&lt;br /&gt;&lt;br /&gt;Bob&lt;br /&gt;Jones&lt;br /&gt;Mary&lt;br /&gt;Quite-contrary&lt;br /&gt;&lt;br /&gt;:g//,//j&lt;br /&gt;&lt;br /&gt;Bob Jones&lt;br /&gt;Mary Quite-contrary&lt;br /&gt;&lt;br /&gt;Now if there are empty lines eg&lt;br /&gt;Bob&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Jones&lt;br /&gt;Mary&lt;br /&gt;Quite-contrary&lt;br /&gt;&lt;br /&gt;use&lt;br /&gt;:g/./,/./j&lt;br /&gt;or slightly tighter&lt;br /&gt;:g/\w/,/\w/j&lt;br /&gt;&lt;br /&gt;and to limit it to a range of lines (between markers a and b)&lt;br /&gt;:'a,'bg/\w/,/\w/j&lt;br /&gt;&lt;br /&gt;Tip from James Church&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-4744362758241696778?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/4744362758241696778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/join-every-second-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/4744362758241696778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/4744362758241696778'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/10/join-every-second-line.html' title='Join Pairs of Lines'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-3453652282550456129</id><published>2009-09-12T10:14:00.000-07:00</published><updated>2009-09-12T10:30:17.994-07:00</updated><title type='text'>Generating lines of Repetitive Code Rapidly</title><content type='html'>&lt;div class=box&gt;A very common editing problem when writing repetitive lines of code.&lt;br /&gt;&lt;br /&gt;list($jan,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;list($feb,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;list($mar,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;.... etc etc&lt;br /&gt;list($nov,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;list($dec,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;&lt;br /&gt;The first line (jan) has been hand written and then the other 11 generated with yy11p&lt;br /&gt;&lt;br /&gt;Then the first mention of the month has been hand-edited, now you want to make the &lt;br /&gt;month the same throughout the line&lt;br /&gt;&lt;br /&gt;list($jan,$jan_color)=fn_display_month($record['jan']);&lt;br /&gt;list($feb,$feb_color)=fn_display_month($record['feb']);&lt;br /&gt;list($mar,$mar_color)=fn_display_month($record['mar']);&lt;br /&gt;....&lt;br /&gt;list($nov,$nov_color)=fn_display_month($record['nov']);&lt;br /&gt;list($dec,$dec_color)=fn_display_month($record['dec']);&lt;br /&gt;&lt;br /&gt;Do this with a recording:- with contents&lt;br /&gt;0f$l"ayiw:s/jan/\=@a/gj&lt;br /&gt;&lt;br /&gt;explanation &lt;br /&gt;Start recording @q&lt;br /&gt;0f$ find first dollar&lt;br /&gt;store month into register a&lt;br /&gt;substitute jan with contents of register a&lt;br /&gt;descend a line&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-3453652282550456129?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/3453652282550456129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/09/generating-lines-of-repetitive-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3453652282550456129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/3453652282550456129'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/09/generating-lines-of-repetitive-code.html' title='Generating lines of Repetitive Code Rapidly'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-41258489900089008</id><published>2009-09-02T11:13:00.000-07:00</published><updated>2009-09-05T07:50:54.177-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='visual mode'/><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><category scheme='http://www.blogger.com/atom/ns#' term='substitute'/><title type='text'>Substitute Text in Last Visual Area</title><content type='html'>Got this from VIM Wiki&lt;br /&gt;&lt;br /&gt;&lt;div class="box"&gt;&lt;br /&gt;:%s/\%Vold/new/g      #  Substitute Text in Last Visual Area&lt;br /&gt;                      # Now imagine you'd selected a visual block with (Control V, or Control Q (Windows)) you could do a column based substitute!&lt;br /&gt;&lt;br /&gt;gv                    # revisualise last visual area&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-41258489900089008?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/41258489900089008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/09/substitute-text-in-last-visual-area.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/41258489900089008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/41258489900089008'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/09/substitute-text-in-last-visual-area.html' title='Substitute Text in Last Visual Area'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-6804497626004630834</id><published>2009-08-19T03:18:00.000-07:00</published><updated>2009-08-21T05:38:10.020-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zsh'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><title type='text'>Useful ZSH Commands for Vim</title><content type='html'>(When I used bash, I wrote small scripts to achieve the following)&lt;br /&gt;&lt;br /&gt;We frequently re-edit the most recent files, I have aliases/scripts for many of following as they are a bit clunky to type.&lt;br /&gt;&lt;div class="box"&gt;&lt;br /&gt;vi *(.om[1])      # vi newest file&lt;br /&gt;vi -p *(.om[1,3]) # open 3 newest files in tabs (gvim)&lt;br /&gt;vi *(m0)          # re-edit all files changed today!&lt;br /&gt;ls *(^m0)         # files NOT modified today&lt;br /&gt;ls -l *(m4)       # list files modified exactly 4 days ago&lt;br /&gt;vi **/main.php    # where ever it is in hierarchy&lt;br /&gt;ls (x*~x[3-5])    # list files x* except x3 to x5&lt;br /&gt;vi !$             # vi last parameter&lt;br /&gt;vi !-2:2          # second parameter of second but last command&lt;br /&gt;vi !$:r.php       # vi last parameter but change extension to .php&lt;br /&gt;^mian^main        # modify previous command (good for correcting typos)&lt;br /&gt;^php^cfm          # modify previous command replace php by cfm&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;more &lt;a href="http://www.successtheory.com/tips/zshtips.html"&gt;zsh tips and tricks here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-6804497626004630834?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/6804497626004630834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/08/useful-zsh-commands-for-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6804497626004630834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/6804497626004630834'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/08/useful-zsh-commands-for-vim.html' title='Useful ZSH Commands for Vim'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-1433036439639022477</id><published>2009-08-02T06:05:00.000-07:00</published><updated>2009-08-21T06:24:28.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='text files'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><title type='text'>Clean up a Mucky Text File with a VIM function</title><content type='html'>We are often required to clean up a text file usually from kind of export to text from a database , Word file etc. These text files can be full of superfluous white space, non-asciis, control-M etc&lt;br /&gt;&lt;br /&gt;Insert the following function into your .vimrc or load directly into the file you editing. Adapt it as necessary .&lt;br /&gt;Execute with&lt;br /&gt;&lt;div class=box&gt;&lt;br /&gt;: call Clean()&lt;br /&gt;&lt;br /&gt;function! Clean()&lt;br /&gt;" Clean up a text file&lt;br /&gt;" delete pesky (MSDOS) control-M 's&lt;br /&gt; exe ':%s/\r//ge'&lt;br /&gt;" delete pesky non-asciis&lt;br /&gt; exe ':%s/[\x00-\x1f\x80-\xff]/ /eg '&lt;br /&gt;" compress multiple spaces &lt;br /&gt; exe ':%s/\s\s\+/ /eg'&lt;br /&gt;" delete end of line spaces &lt;br /&gt; exe ':%s/\s\+$//e'&lt;br /&gt;" compress multiple blank lines &lt;br /&gt; exe ':silent! v/./,/./-j'&lt;br /&gt;endfunction&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-1433036439639022477?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/1433036439639022477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/08/clean-up-text-file-with-vim-function.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1433036439639022477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1433036439639022477'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/08/clean-up-text-file-with-vim-function.html' title='Clean up a Mucky Text File with a VIM function'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-1592782339529849334</id><published>2009-07-21T13:09:00.000-07:00</published><updated>2009-10-06T12:55:33.278-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim registers'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='zzapper'/><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><title type='text'>VIM : Register Tricks</title><content type='html'>&lt;div class=box&gt;When you use the useful ct" (change till " character) (:help t  - motion command) it can be annoying that you cannot . repeat it if the limiting character is not a "&lt;br /&gt;&lt;br /&gt;Well not to worry the last text you inserted is still in the . register and can thus be retrieved with a &amp;lt;C-R&gt;.&lt;br /&gt;&lt;br /&gt;ie ct'&amp;lt;C-R&gt;.&lt;br /&gt;&lt;br /&gt;Don't forget it's brother the small delete register -&lt;br /&gt;&lt;br /&gt;Or the other special registers which you can display with the following command&lt;br /&gt;&lt;br /&gt;:reg "/-.:%*&lt;br /&gt;&lt;br /&gt;Nor forget how to dump your numeric registers&lt;br /&gt;&lt;br /&gt;"1p.......   (normal mode)&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-1592782339529849334?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/1592782339529849334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/07/vim-register-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1592782339529849334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/1592782339529849334'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/07/vim-register-tricks.html' title='VIM : Register Tricks'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-7523760412177388916</id><published>2009-07-01T02:27:00.000-07:00</published><updated>2009-10-06T12:52:09.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='register'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='recording'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><title type='text'>VIM: Creating Your Own Commands with a Map or a Recording</title><content type='html'>&lt;div class=box&gt;Customizing your own commands using a map or recording.&lt;br /&gt;&lt;br /&gt;A &lt;span style="font-weight:bold;"&gt;Map &lt;/span&gt;is generally used for stored commands.&lt;br /&gt;&lt;br /&gt;A &lt;span style="font-weight:bold;"&gt;Recording &lt;/span&gt;is used for one off jobs.&lt;br /&gt;&lt;br /&gt;Recordings are more intuitive ie you simply record a sequence of commands.&lt;br /&gt;&lt;br /&gt;Maps require a little more knowledge of map special characters &amp;lt;CR&gt;&amp;lt;ESC&gt; etc&lt;br /&gt;&lt;br /&gt;While it is possible to "save" a recording for future use it's a little tricky&lt;br /&gt;&lt;br /&gt;:let @w="&amp;lt;C-R&gt;q"   ie read recording q (same as register q) and store in register w, which  if put in your .vimrc will be preserved for future use&lt;br /&gt;&lt;br /&gt;With experience you should find yourself preferring to create disposable recordings and relying less and less on maps; one well known Vimmer (Peppe) has a practically empty .vimrc.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-7523760412177388916?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/7523760412177388916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/07/vim-creating-your-own-commands-with-map.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7523760412177388916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/7523760412177388916'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/07/vim-creating-your-own-commands-with-map.html' title='VIM: Creating Your Own Commands with a Map or a Recording'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-5915190589365162043</id><published>2009-06-24T07:08:00.000-07:00</published><updated>2009-10-06T12:54:06.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='substitute'/><title type='text'>Vim: Including a register's contents in a substitute</title><content type='html'>&lt;div class=box&gt;"sub "fred" with contents of register "a" (Control R)&lt;br /&gt;:s/fred/&amp;lt;c-r&gt;a/g        &lt;br /&gt;&lt;br /&gt;or from the paste buffer&lt;br /&gt;&lt;br /&gt;s/fred/&amp;lt;c-r&gt;*/g&lt;br /&gt;&lt;br /&gt;Here you actually do a Control-R.&lt;br /&gt;&lt;br /&gt;It is often preferable to do use the following&lt;br /&gt;&lt;br /&gt;:s/fred/\=@a/g              : better alternative as register not displayed&lt;br /&gt;&lt;br /&gt;unfortunately the \=@a  must be at the beginning of replacement string&lt;br /&gt;&lt;br /&gt;zzapper&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-5915190589365162043?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/5915190589365162043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/06/vim-including-registers-contents-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5915190589365162043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/5915190589365162043'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/06/vim-including-registers-contents-in.html' title='Vim: Including a register&apos;s contents in a substitute'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8775107278649697857.post-4213947662959651129</id><published>2009-06-20T13:01:00.000-07:00</published><updated>2009-09-02T11:42:58.225-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='text objects'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>vim dat cat with yat or dat</title><content type='html'>I've been using the following HEAVILY recently as I've been working on some spaghetti html pages with mysql,php,Javascript and HTML sprinkled sometimes on the same line. The following help me to precisely "grab" the code I need to alter. I've been favoring VISUAL MODE as this confirms or otherwise that I've selected just what I intend.&lt;br /&gt;&lt;br /&gt;Note how the "a" and "i" inner variants differ the 'i' grabs less than&lt;br /&gt;the outer 'a'&lt;br /&gt;&lt;div class=box&gt;&lt;br /&gt;vat,dat,yat,cat  (visualize,delete,yank,change) a tag&lt;br /&gt;&lt;br /&gt;ie dat will delete a whole table if cursor anywhere over &lt; table&gt;&lt;br /&gt;&lt;br /&gt;ie yat will yank a whole table row if cursor over &lt; tr&gt;&lt;br /&gt;&lt;br /&gt;vit,dit,yit,cit will empty a tag pair&lt;br /&gt;&lt;br /&gt;da&lt;   just deletes a single tag&lt;br /&gt;&lt;br /&gt;di&lt;  empties a tag&lt;br /&gt;&lt;br /&gt;:help text-objects&lt;br /&gt;&lt;br /&gt;seems to work with XML as well&lt;br /&gt;&lt;br /&gt;Also quote based text objects (single line only though for some odd reason)&lt;br /&gt;&lt;br /&gt;va"&lt;br /&gt;da"&lt;br /&gt;va'&lt;br /&gt;da'&lt;br /&gt;vi"&lt;br /&gt;di"&lt;br /&gt;vi'&lt;br /&gt;di'&lt;br /&gt;di&lt;&lt;br /&gt;and don't forget&lt;br /&gt;di(&lt;br /&gt;da{&lt;br /&gt;etc&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;zzapper&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8775107278649697857-4213947662959651129?l=www.zzapper.co.uk%2Fvim-tips-blog%2Findex.php' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/4213947662959651129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/06/vim-tips-blog-first-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/4213947662959651129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8775107278649697857/posts/default/4213947662959651129'/><link rel='alternate' type='text/html' href='http://www.zzapper.co.uk/vim-tips-blog/2009/06/vim-tips-blog-first-post.html' title='vim dat cat with yat or dat'/><author><name>zzapper</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16255832060110662275'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>