Musings on Software

This web log is my online notebook for software tips and hacks to make my life and hopefully that of someone else just a little bit easy. Should you find any mistakes or have any useful suggestions, please do not hesitate to write to me. Peace! Pavan Ghatty

Tuesday, March 1, 2011

Useful "vi" tips

1. If you want to merge rows ( for exp. row 1 to 20 ) do:
:1,20 j
2. To replace string with a new line
:%s/ TI/^MTI
To get ^M use following
Hold down the Ctrl, and press v m
DO NOT USE Shift+6 and Shift+M
3. To move a string to a new line w/o hitting Enter, do this;
:s/string/\r&/g
Posted by Pavan K. Ghatty at 10:05 AM No comments:
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2018 (2)
    • ►  April (2)
  • ►  2016 (2)
    • ►  December (1)
    • ►  April (1)
  • ►  2015 (1)
    • ►  August (1)
  • ►  2014 (12)
    • ►  September (1)
    • ►  June (1)
    • ►  March (2)
    • ►  February (2)
    • ►  January (6)
  • ►  2013 (28)
    • ►  December (2)
    • ►  November (3)
    • ►  October (7)
    • ►  August (5)
    • ►  April (3)
    • ►  March (1)
    • ►  February (1)
    • ►  January (6)
  • ►  2012 (50)
    • ►  December (3)
    • ►  November (2)
    • ►  October (6)
    • ►  September (2)
    • ►  August (4)
    • ►  July (6)
    • ►  June (3)
    • ►  May (2)
    • ►  April (5)
    • ►  March (5)
    • ►  February (6)
    • ►  January (6)
  • ▼  2011 (20)
    • ►  December (2)
    • ►  November (5)
    • ►  September (4)
    • ►  August (2)
    • ►  May (3)
    • ►  April (1)
    • ▼  March (1)
      • Useful "vi" tips
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (6)
    • ►  August (1)
    • ►  March (2)
    • ►  February (3)
Simple theme. Powered by Blogger.