vim – get names of the scripts and the details from the command line

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

For the below commands either you can set the two variables in bold and then run the scripts or change the following in the commands and run the scripts.

If you have html2text installed then you can use this:

wget -o /dev/null -O $script_id_file ’http://www.vim.org/scripts/script.php?script_id=’$script_id |html2text

If you dont have html2text installed then you can use:

wget -o /dev/null -O $script_id_file &#8217;http://www.vim.org/scripts/script.php?script_id=&#8217;$script_id<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.inquisitr.com/55496/twilight-eclipse-script-allegedly-leaked/">Twilight Eclipse Script Allegedly Leaked (inquisitr.com) <li class="zemanta-article-ul-li"><a href="http://huddledmasses.org/powershell-script-club-in-rochester-on-wednesday/">PowerShell Script Club in Rochester on Wednesday (huddledmasses.org) <li class="zemanta-article-ul-li"><a href="http://blogs.adobe.com/acrolaw/2010/02/add_a_flatten_document_menu_item.html">Add a Flatten Document Menu Item to Acrobat (blogs.adobe.com) <li class="zemanta-article-ul-li"><a href="http://codebetter.com/blogs/james.kovacs/archive/2010/02/25/the-exec-problem.aspx">The Exec Problem (codebetter.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/d25e9b6c-aca3-4008-9a3c-3403140d32e0/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e38.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

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

change the window in split screen.

2010-04-11 1 min read Firefox Linux Vim Tips

I use the split screen in vim very in-frequently, so I did not really know how to move from one screen to the other. There is also very little or no documentation that I found on this on the first page of google, so here it is :
press &#8221;ctrl+w and ctrl + w&#8221; to change to other window.

If you are not sure how to get the split screen, then you can type help split in vim to get the help on split screen.

Continue reading

bash script to change vim colorscheme based on the available themes

2010-04-11 0 min read Fedora Vim Tips
\"MacVim
Image via Wikipedia

Here&#8217;s one script that you may find useful. A little variation or wrapper for this script can make your life colorful 🙂

You can write a wrapper to this to take one of the inputs randomly and then use it in alias to start <a class="zem_slink freebase/en/vim" title="Vim (text editor)" rel="homepage" href="http://www.vim.org/">vim.

Continue reading

using paragraph seperator in vi – the easy way

2010-04-07 1 min read Vim Tips

imap aa 80i-io

Just put this in the vimrc or in a vi session with a : in normal mode.

Explanation:

This will map the key &#8221;aa&#8221; to the sequence which will add &#8221;-&#8221; 80 times in the current line and then go to new line in insert mode. This is quite simple so any changes required should be simple enough to make.

vim understanding the various modes and using the yanking more efficiently.

2010-04-06 0 min read Linux Vim Tips
\"MacVim
Image via Wikipedia

We will look at the vim modes today. Sometime back , I was looking at copying a function body. So I was basically looking to copy the lines till matching &#8221;}&#8221;. I found a plugin called <a href="http://www.vim.org/scripts/script.php?script_id=1234" target="_blank">yankring which would allow me to yank the text in various combinations. So I can copy a function by going to the begining of the function and then &#8221;y}&#8221;. That is very simple to understand right? Wrong!!!

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
Older posts Newer posts