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

Deleting lines from the text file

2010-06-01 1 min read Linux

Really useful for pretty big <a class="zem_slink freebase/en/computer_file" title="Computer file" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_file">files.

<a class="zem_slink freebase/en/sed" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed –silent &#8217;1,100 d&#8217; <a class="zem_slink freebase/en/filename" title="Filename" rel="wikipedia" href="http://en.wikipedia.org/wiki/Filename">filename

here the command will delete the first 100 lines. You can specify whatever range you want. This will not delete the lines from the file but only display the contents on the console after deleting the 100 lines from begining.

If you want to store it in different file then you can use &#8221;>&#8221; or &#8221;»&#8221;<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.centernetworks.com/guhmshoo-quit-facebook-day-cartoon">Guhmshoo Looks at Quit Facebook Day (cartoon) (centernetworks.com) <li class="zemanta-article-ul-li"><a href="http://blogs.securiteam.com/index.php/archives/1374">Sometimes it&#8217;s just Windows … (blogs.securiteam.com) <li class="zemanta-article-ul-li"><a href="http://www.makeuseof.com/tag/2-ingenious-apps-to-help-organize-files-and-folders-on-your-mac/">2 Ingenious Apps To Help Organize Files and Folders On Your Mac (makeuseof.com) <li class="zemanta-article-ul-li"><a href="http://www.labnol.org/software/windows-problems-and-solutions/13766/">Simple Solutions to Common Windows Problems (labnol.org) <li class="zemanta-article-ul-li"><a href="http://techblissonline.com/bluray-dvd-cd-data-file-recovery-software-free-download/">Blu Ray/DVD/CD Data file recovery software (free) to recover damaged files (techblissonline.com) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/23/get-rid-of-gnome-keyring-password-reminder/">Get rid of GNOME keyring password reminder (ghacks.net) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/a2e0d6ba-15f8-4a53-9f52-a28012b689cb/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b93.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

How To Modify Your Wordpress Theme Via The Browser Using Stiqr

2010-04-27 6 min read Learning Uncategorized

<a href="http://feedads.g.doubleclick.net/%7Ea/O7jc_lFA7WTnPLGHjbYaxjhpRBM/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/%7Ea/O7jc_lFA7WTnPLGHjbYaxjhpRBM/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/%7Ea/O7jc_lFA7WTnPLGHjbYaxjhpRBM/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/%7Ea/O7jc_lFA7WTnPLGHjbYaxjhpRBM/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/00_Stiqr_logo.jpg" alt="00_Stiqr_logo.jpg" width="253" height="114" align="bottom" />Ordinary <a href="http://www.makeuseof.com/tag/how-to-build-a-self-hosted-wordpress-blog-for-free/">self-hosted WordPress users know only too well that even though choosing and using thousands of available themes is a snap, creating one is an almost impossible task. You could use <a href="http://www.makeuseof.com/tag/customize-design-wordpress-theme-easily-constructor/">one of the customizable themes to modify the look to your liking, but that’s as far as you can go. Theme creating is not for the faint-hearted who are afraid to plunge into <a class="zem_slink freebase/en/html" title="HTML" rel="wikipedia" href="http://en.wikipedia.org/wiki/HTML">HTML, <a class="zem_slink freebase/en/php" title="PHP" rel="homepage" href="http://www.php.net/">PHP and <a class="zem_slink freebase/en/cascading_style_sheets" title="Cascading Style Sheets" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS coding.

Continue reading

Liquid rescale and remove objects from the images.

2010-04-12 1 min read Fedora Photo

Ever wanted to remove some unwanted object from an image. Wonder how many thinkgs you have to do, clone and delete and what not:)

There is a simpler way, just paint it in foreground color. Does that sound ridiculous, not any more with Liquid Rescale. First install the plugin for liquid rescale for gimp.

yum install gimp-lqr-plugin

Now, just follow simple instructions below:

  1. in the menu, choose Layer and then Liquid Rescale
  2. click on the New button in the Discard features section on the right: a new layer will be created
  3. put the plugin window on one side of the screen without closing it, and go back to work on the gimp main windows
  4. choose the paint tool and paint over the area you wish to remove
  5. go back to the plugin window
  6. click the Refresh button at the bottom: you should see your discard mask appear in the preview
  7. optionally, in the Mode box on the left choose Lqr + scale back or Lqr + Lqr back
  8. click the Auto size button at the bottom of the Discard features section (optionally choose the scaling direction in the box at the side of the button before clicking it).
  9. click OK

Could it get any simpler.

Continue reading

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