vi reference links

2010-07-16 1 min read Linux Vim Tips

<a href="http://www.lagmonster.org/docs/vi2.html">http://www.lagmonster.org/docs/vi2.html
<a href="http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/">http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/
<a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html">http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
<a href="http://www.eng.hawaii.edu/Tutor/vi.html#commands">http://www.eng.hawaii.edu/Tutor/vi.html#commands

jumps and marks in vim

2010-07-11 3 min read Linux Vim Tips

First we will talk about jumps in vim. Very useful for <a class="zem_slink freebase/en/navigation" title="Navigation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Navigation">navigation and jumping around the vim. The jumps are commands that lets you jump from one location to another location, like {{ or [[ and so on … From the help file of vim

A &#8221;jump&#8221; is one of the following commands: &#8221;&#8217;&#8221;, &#8221;`&#8221;, &#8221;G&#8221;, &#8221;/&#8221;, &#8221;?&#8221;, &#8221;n&#8221;,
&#8221;N&#8221;, &#8221;%&#8221;, &#8221;(&#8221;, &#8221;)&#8221;, &#8221;[[&#8221;, &#8221;]]&#8221;, &#8221;{&#8221;, &#8221;}&#8221;, &#8221;:s&#8221;, &#8221;:tag&#8221;, &#8221;L&#8221;, &#8221;M&#8221;, &#8221;H&#8221; and
the commands that start editing a new file.  If you make the <a class="zem_slink freebase/en/cursor" title="Cursor (computers)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cursor_%28computers%29">cursor &#8221;jump&#8221;
with one of these commands, the position of the cursor before the jump is
remembered.  You can return to that position with the &#8221;&#8217;&#8217;&#8221; and &#8221;“&#8221; command,
unless the line containing that position was changed or deleted.

Continue reading

vim – get the list of all the scripts available.

2010-05-27 1 min read Learning Linux Vim Tips

To get a list of all the scripts in the vim.sf.net project, you can run the following command. This will list all the scripts with the script id.

wget -O – &#8217;http://www.vim.org/scripts/script_search_results.php?&show_me=4000&result_ptr=0&#8217; -o /dev/null | <a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep width| grep script_id= |<a class="zem_slink freebase/en/sed" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed &#8217;s/.*script_id=//&#8217;|tr -d &#8221;&#8221;&#8221;|tr &#8221;>&#8221; &#8221; &#8221;|sed &#8217;s/< .*//&#8217; | tr -d &#8217;\001&#8217;-&#8217;\011&#8217;&#8217;\013&#8217;&#8217;\014&#8217;&#8217;\016&#8217;-&#8217;\037&#8217;&#8217;\200&#8217;-&#8217;\377&#8217; |sort -n<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/09/17/use-curl-to-monitor-your-vonage-phone-bill/">Use curl to Monitor Your Vonage Phone Bill (slumpedoverkeyboarddead.com) <li class="zemanta-article-ul-li"><a href="http://securewebs.com/yum-updates/">Yum Updates (securewebs.com) <li class="zemanta-article-ul-li"><a href="http://www.gubatron.com/blog/2009/10/10/ubuntudebian-quick-reference-how-to-change-your-servers-utc-timezone-on-the-command-line/">Ubuntu/Debian Quick Reference: How To Change Your Server&#8217;s UTC Timezone on the command line (gubatron.com) <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2009/11/22/short-information-about-loaded-kernel-modules/">Short Information about loaded kernel modules (amit-agarwal.co.in) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/b22b2e85-8107-4f9b-9130-85a8e8ae370b/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b52.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

vi – the powerful Linux/Unix text editor

2010-05-12 1 min read Linux Vim Tips

We will talk about some vi stuff today:

Some fun first–>
1) <a href="http://www.vim.org/tips/tip.php?tip_id=664">http://www.vim.org/tips/tip.php?tip_id=664
2) help 42

Ok, coming to serious things-
References:
3) Linux cheat sheet:
<a href="http://www.lagmonster.org/docs/vi2.html">http://www.lagmonster.org/docs/vi2.html
4) <a href="http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/">http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/
5) <a href="http://www.eng.hawaii.edu/Tutor/vi.html#commands">http://www.eng.hawaii.edu/Tutor/vi.html#commands

Commands and tips:
6) Something that is difficult to find on the net is : how to create a numbered list in vi/vim? Simple, we will use macro's
To do this:
a> type number and terminatory ex: 1)
b> start recording using qa  . This will record the macro in a.
c> yank the line with yy
d> goto next line
e> press a to increment the number
f> End the macro recording with q
g> Play the macro with numner of times to repeat the actions. Example press 11@a
7) For repeating the last command you can use
8) You can put your vim settings in ~/vimrc and this can containg things like "set nu" and any other configuration.
9) Adding date in vi : :r! date
10) There is a variant of vi known as elvis which is quite nice
11) Similarly for viewing binary file there is a variant called bvi

Continue reading

vim scripts and tips

2010-03-29 1 min read Linux Vim Tips

Here are few of the links for vim that you can use. It consists of the link to vimrc, colorscheme, syntaxcomplete and zzsplash.
<a href="http://vim.wikia.com/wiki/User:Tonymec/vimrc">http://vim.wikia.com/wiki/User:Tonymec/vimrc
<a href="http://vim.wikia.com/wiki/User:Tonymec/almost-default.vim">http://vim.wikia.com/wiki/User:Tonymec/almost-default.vim
<a href="http://vim.wikia.com/wiki/User:Tonymec/syntaxcomplete.vim">http://vim.wikia.com/wiki/User:Tonymec/syntaxcomplete.vim
<a href="http://vim.wikia.com/wiki/User:Tonymec/zzsplash.vim">http://vim.wikia.com/wiki/User:Tonymec/zzsplash.vim<table cellspacing="0" cellpadding="0" width="100%"> <h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/02/02/bash-script-to-change-the-vim-colorscheme-from-the-list-of-locally-available-schemes/">bash script to change the vim colorscheme from the list of locally available schemes (amit-agarwal.co.in) <li class="zemanta-article-ul-li"><a href="http://www.prweb.com/releases/2010/03/prweb3740684.htm">Wikia Introduces New Tools For People to Create Wiki Answer Sites on Any Topic (prweb.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/a04b9f08-df03-476c-b6d3-a1d32078cb64/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b68.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

using cscope with vim

2010-01-08 0 min read Linux Vim Tips
\"Google
Image by schoschie via Flickr

Here&#8217;s the best of the two links that I found with <a class="zem_slink freebase/en/google" title="Google" rel="homepage" href="http://google.com">Google and <a class="zem_slink" title="Bing" rel="homepage" href="http://bing.com/">Bing combined out of lots of links that I think can help you understand how to use cscope with vim, if you dont know already.

<a href="http://cscope.sourceforge.net/cscope_vim_tutorial.html">http://cscope.sourceforge.net/cscope_vim_tutorial.html
<a href="http://www.faqs.org/docs/ldev/0130091154_242.htm">http://www.faqs.org/docs/ldev/0130091154_242.htm

Continue reading

Add current date and time in vim

2009-11-20 1 min read Linux Vim Tips

Last few days I was quite busy. So this time very quick tip 🙂

Add the following to the ~/.vimrc file

imap dt :r! dateA

And now whenever you type dt in the insert mode in vi, date will be inserted.