Skip to content

Instantly share code, notes, and snippets.

Avatar

D. Oosterveld dusdanig

  • Sqills
View GitHub Profile
@dusdanig
dusdanig / gist:b79c15a83368958feb96
Created Jun 11, 2014
Transpose lines for emacs that makes sense to me
View gist:b79c15a83368958feb96
;; 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
View Open tab in macosx in same dir.sh
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
}
View Bash git branch in prompt
## 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\]"
You can’t perform that action at this time.