Posts

Showing posts from February, 2011

Bash script locate base dir

BASEDIR=$(cd $(dirname $0); cd ../ ;  pwd -P)

Bash script locate self

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)

emacs emulating vi open line below

Quoted from Stackoverflow - Original Link Below ( love this post, these three are my biggest emacs annoyences) Hi there, I am currently playing around with emacs and happy with most of the concepts. But I really adored the convenience of the three vim commands: dd,o,O Hopefully you can tell me how to mirror them in emacs :) dd  - deletes whole line, including newline, no matter where the cursor is. I found something similar to do the trick: C-a C-k C-k While  C-a  moves the cursor to the beginning of the line, the first  C-k  kills the text, the second one kills the newline. The only problem is that this is not working on empty lines where I only need to type C-k  which is quite inconvenient as I have to use different commands for the same task: killing a line. o / O  - creates a new empty line below / above cursor and moves cursor to the new line, indented correctly Well,  C-a C-o  is nearly like  O , just the idention is missing.  C-e C-o  creates an empty line below the current but