Vim – Using undo branches

April 16, 2015 Leave a comment

This is a pretty neat feature that I did not know existed. I have only used u, U and CTRL-R, but a situation arose where multiple undo’s and redo’s was necessary.

:h undolist has clear documentation on how it works.
g+ Go to newer text state. With a count repeat that many times. {not in Vi} See :help g+ for more.
g- Go to older text state. With a count repeat that many times. {not in Vi} See :help g- for more.

For more, see below:
http://vim.wikia.com/wiki/Using_undo_branches

Less – Adding line numbers

April 2, 2015 Leave a comment

Problem:

My initial problem was how to view line numbers when using less. As I looked into this I discovered more and more ways of using less that I did not know.

Solution:

1. less -N file.txt

If you have already viewed the file then typing

-N will enable line numbers while
-n will disable line numbers.

2. To go a specifice line
g N to move upwards to a particular line. The default is 1 (ie g1) and it gets you to the first line of the file.
G N to move forward to a particular line. G alone is the default that gets you to the end of the file.

Categories: bash

Duolingo – Free language learning platform

April 2, 2015 Leave a comment

Have a look at http://www.duolingo.com if you are interested in learning a new language.

duolingo

Duolingo /ˈdjuːɵˌlɪŋɡoʊ/ is a free language-learning and crowdsourced text translation platform. The service is designed so that, as users progress through the lessons, they simultaneously help to translate websites and other documents.[1][2] As of 23 March 2015, Duolingo provides Latin American Spanish, French, German, Brazilian Portuguese, Italian, Dutch, Irish, Danish, Swedish and Turkish courses for English speakers, as well as American English for Spanish, French, German, Portuguese, Italian, Greek, Dutch, Russian, Polish, Turkish, Hungarian, Romanian, Japanese, Hindi, Indonesian, Korean, Vietnamese, and Czech speakers.

Source: https://en.wikipedia.org/wiki/Duolingo

100 Vim commands

March 25, 2015 Leave a comment

http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know

This caught my eye

Window spliting
ctrl-w up arrow Puts cursor in top window
ctrl-w ctrl-w Puts cursor in next window
ctrl-w_ Maximise current window
ctrl-w= Gives the same size to all windows
10 ctrl-w+ Add 10 lines to current window
:vsplit file Split window vertically
:sview file Same as :split in readonly mode
:hide Close current window
:­nly Close all windows, excepted current
:b 2 Open #2 in this window

And lead me to reading “:help split” in vim

Categories: vim Tags:

Readonly Content cannot be changed

March 2, 2015 Leave a comment

Problem:
Apparently, unbeknownst to me, my libreoffice document has Microsoft Forms. All attempts to delete it gave a warning about “Readonly content can not be changed…”

Solution:
Found the solution gone here http://mednis.info/wp/?p=168

Python: Tips, Tricks and Idioms – Part 2

February 20, 2015 Leave a comment
Categories: Interesting, python

Turning off beep/ bell on vi

February 12, 2015 Leave a comment

Problem:
I was using vi and it kept on beeping at all my mistakes :-p

Solution:
Added the following line to my .vimrc

set visualbell

Source:
http://linuxconfig.org/turn-off-beep-bell-on-linux-terminal

Categories: vim Tags:
Follow

Get every new post delivered to your Inbox.

Join 41 other followers