vim maps – simple commands to do stuff.

2013-08-28 1 min read Vim Tips
Some time back, I was working on some script for logging and I wanted to change the class to function like this: $logger->Debug("Test string"); loggerFunc("Debug", "Test String"); As you can see, this change could be quite frustrating if you have quite a few references. And thus vim comes to rescue. Simple map like :: :map ,mm :s/(.*)$logger->(.*)((.*)).*/1loggerFunc("2",3);/ and then I can do “/$logger->” and then “n” to go to next match. Continue reading

debug call function() to debug a function in vim

2011-09-04 1 min read Vim Tips
Image via Wikipedia Have you ever wished that you could either see what is going on initially at the vim startup like you could do with C program in the gdm mode, but really did not want to go through gdb. Or rather you sometime felt that some function defined by some plugin is causing some issue and you wanted to debug just that function. Well you need not wish anymore, the functionality is already there. Continue reading

vim autocomplete – automagically without tab.

2011-04-16 1 min read Learning Linux Vim Tips
Lets first do the setup in one line. Get my vim script downloader. Use the script to add the script with script ID : :1879 (vim-autocomplpop) to your list of plugins for vim and you are done. If you are using snipmate, then make sure that you read the description of the plugin to add the required lines to the vimrc file to get the full functionality. You would love to type henceforth in your favourite editor. Continue reading

All in one solution for all the scripts of vim from vim.org

2011-03-09 9 min read bash Fedora Learning Linux Vim Tips
For quite sometime now, I was looking for some console based program which would help me get the scripts from vim.org. A simple solution would have been to do a wget for the scripts. But since there are so many scripts coming up daily and with a need to search based on script ID and name of the script, I thought better to write a script that can do all of those things. Continue reading

Built-in lists in vim

2010-02-03 1 min read Learning Linux Vim Tips
<a class="zem_slink freebase/en/vimscript" title="Vimscript" rel="wikipedia" href="http://en.wikipedia.org/wiki/Vimscript">Vimscript provides excellent support for operating on collections of <a class="zem_slink freebase/en/data" title="Data" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data">data, a cornerstone of programming. In this third article in the series, learn how to use Vimscript&#8217;s built-in lists to ease everyday operations such as reformatting lists, filtering sequences of filenames, and sorting sets of line numbers. You&#8217;ll also walk through examples that demonstrate the power of lists to extend and enhance two common uses of <a class="zem_slink freebase/en/vim" title="Vim (text editor)" rel="homepage" href="http://www. Continue reading