Random Stuff

Random notes and thoughts that may or may not be of use to someone.

Thursday, February 26, 2015

Things about vim

Find replace

Show line numbers

:set number

Replace using ranges

Insert # at begin of line from line 1 to 10
:1,10s/^/#

Find each occurrence on each line and replace

:%s/find/replace

e.g:
:%s/^0/27

Find each line starting with 0, and replace the zero with 27

Sort, removing duplicates

:sort u

Posted by Sybrand at Thursday, February 26, 2015 No comments:
Labels: linux
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

About Me

Sybrand
View my complete profile

Blog Archive

  • ►  2018 (1)
    • ►  April (1)
  • ►  2017 (1)
    • ►  March (1)
  • ▼  2015 (3)
    • ▼  February (1)
      • Things about vim
    • ►  January (2)
  • ►  2014 (6)
    • ►  October (1)
    • ►  August (1)
    • ►  July (2)
    • ►  April (1)
    • ►  March (1)
  • ►  2010 (3)
    • ►  June (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2009 (10)
    • ►  December (5)
    • ►  November (1)
    • ►  October (2)
    • ►  August (1)
    • ►  February (1)
  • ►  2008 (3)
    • ►  September (1)
    • ►  August (1)
    • ►  May (1)
  • ►  2007 (11)
    • ►  October (1)
    • ►  September (2)
    • ►  March (1)
    • ►  February (1)
    • ►  January (6)
  • ►  2006 (3)
    • ►  December (3)
  • ►  2005 (6)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  June (1)
    • ►  January (1)
  • ►  2004 (1)
    • ►  August (1)

Friends

  • Carli
  • Johan Jordaan
  • Olivia Pig
  • Timothy Twelves
Simple theme. Powered by Blogger.