Play with vim colors.

2010-07-16 1 min read Vim Tips

In vim you can customize the colors of your terminal vim or the GUI version. If you wanted to play around with colors then you can simply put the file containing the colorscheme to directory ”~/.vim/colors” and load it in vim with ”colorscheme ”.

That most of you would know. What I will add here is how easy it can be create it if you knew the right place to do it: Head over<a href="http://yukihiro.nakadaira.googlepages.com/vim-color.html" target="_blank"> here. No explanations needed. Anyway if you need help, leave a comment.

Continue reading

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

bash script to change the vim colorscheme from the list of locally available schemes

2010-06-24 0 min read Bash Fedora Learning Linux Vim Tips
\"MacVim
Image via Wikipedia

Today I was just wondering how good it would be to have a script to change the <a class="zem_slink freebase/en/vim" title="Vim (text editor)" rel="homepage" href="http://www.vim.org/">vim colorscheme from the <a class="zem_slink freebase/en/cmd_exe" title="Command Prompt" rel="wikipedia" href="http://en.wikipedia.org/wiki/Command_Prompt">command prompt. The plan for the script was simply to print the list of available schemes and then let the user select the actions from there on. So, here is the result:

Continue reading

vi tips with examples for programmers — very useful

2010-06-05 1 min read Vim Tips

First off, sorry for not posting regularly. Will be so for probably another couple of days.

In the meantime found a very nice artcle on vim:

<a href="http://en.wikibooks.org/wiki/Learning_the_vi_editor/Vim/Useful_things_for_programmers_to_know" target="_blank">http://en.wikibooks.org/wiki/Learning_the_vi_editor/Vim/Useful_things_for_programmers_to_know

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

vim - get mappings from the help tex files available with the scripts.

2010-05-27 2 min read Fedora Learning Linux Vim Tips

Here is a simple script that will show all the vim mappings from the tex file (help file that comes with the vim scripts).

This will prove to be very useful in usin gthe mappings 🙂

#!/bin/bash –
#===============================================================================

#          FILE:  get_mappings_from_tex_for_vim.sh

#         USAGE:  ./get_mappings_from_tex_for_vim.sh

#   DESCRIPTION:  Get the mappings from tex file

#       OPTIONS:  —
#  REQUIREMENTS:  —
#          BUGS:  —
#         NOTES:  —
#        AUTHOR:  <a class="zem_slink" title="Amit Agarwal" rel="self" href="http://blog.amit-agarwal.co.in">Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  09/06/2009 09:19:19 PM IST
#      REVISION:  —
#===============================================================================
file=$1
IFS=$(echo -e &#8217;\n&#8217;)
for i in $(cat $file |<a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep &#8221;^..line&#8221;)
do
#echo $i |<a class="zem_slink freebase/en/awk" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk -F&#8221;&#8217;&#8221; '{print $2&#8221; &#8221; $3&#8221; &#8221;$4}&#8217;|awk -F&#8221;&&#8221; '{print $1&#8221; &#8221;$2}&#8217;
echo $i |awk -F&#8221;&#8217;&#8221; '{
if ( NF >= 4 )
{
print ($2&#8221;\t ->&#8221;$4&#8221;\t==»&#8221;$NF);
}
else
{
print($2&#8221;\t–>&#8221;$3);
}
fi
}&#8217;  |<a class="zem_slink freebase/en/sed" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed &#8217;s/\h.*(/(/&#8217; |sed &#8217;s/>.*&/>/&#8217; |sed &#8217;s/\t*-.>$//&#8217; |sed &#8217;s/\//&#8217;

Continue reading
Older posts Newer posts