Skip to content

Instantly share code, notes, and snippets.

@dusdanig
dusdanig / gist:b79c15a83368958feb96
Created June 11, 2014 18:40
Transpose lines for emacs that makes sense to me
;; Dusdanig transpose lines
;;
;; The transpose lines (C-x C-t) really anoyed me. I kept squinting my
;; eyes to see what lines would be transposed. Also the point was
;; never near the line which should have been transposed. It made no
;; sense to me.
;;
;; The solution this listing implements will swap the previous and
;; current line when the point is aproximatly at the start of the line
;; and will swap the current and next line if the point is aproximatly
## throw this at the top of your .bash_profile
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/* \1/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
alias tab=new_terminal_working_directory
function new_terminal_working_directory() {
osascript <<END
tell application "Terminal"
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
do script "cd $(pwd)" in first window
end tell
END
}