dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit a4499d9c7fba80b472a384e0e8408adc0ebe3a6b
parent 464e612363624471c198d4244c5e7842e39e329a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 14 Jan 2019 15:35:55 +0100

Clean-up commands and add 'v' and 'o' bindings

Diffstat:
Mlinks/.commands.sh | 45+++++----------------------------------------
1 file changed, 5 insertions(+), 40 deletions(-)

diff --git a/links/.commands.sh b/links/.commands.sh @@ -5,10 +5,9 @@ alias b='bash' alias z='zsh' -alias yd='youtube-dl' +alias v='vim' ## cd - alias cg='c "$(git rev-parse --show-toplevel)"' # cd under git repo alias ch='cd "$(dirs -lp | sort -u | fzf --preview-window=right:hidden )"' # cd from history @@ -33,60 +32,35 @@ alias la='ls -A' ## Open files +o() { + xdg-open "$(fzf)" +} + if [ "$(uname)" != 'Darwin' ]; then open() { xdg-open "$@" &> /dev/null &disown; } fi ## editor - -e() { - if [ $# -eq 0 ]; then - # open file under PWD - local file - file=$(find . -type f | grep -v '/\.' | fzf) - [ -n "$file" ] && $EDITOR "$file" - else - $EDITOR "$@" - fi -} - -# edit file anywhere in git repository -eg() { - # open file under PWD - local file - file=$(find "$(git rev-parse --show-toplevel)" -type f | grep -v '/\.' | fzf) - [ -n "$file" ] && $EDITOR "$file" -} - -# see :h --noplugin -#alias vi='vim -u NONE' alias vi='vim -u ~/.vim/vimrc.noplugs' ## dotfiles - alias zshreload="source ~/.zshrc" alias dotfiles-update="cd ~/code/dotfiles && git pull ; zshreload ; cd -" alias dotfiles-commit="cd ~/code/dotfiles && git commit -a -S -v ; git push ; cd -" ## python - alias ipython-prof='ipython -m cProfile -s time' alias python-prof='python -m cProfile -s time' - - ## make - alias m="make" alias mc="make clean" alias me="make edit" - ## date - alias date-denmark='TZ=Europe/Copenhagen date' alias date-eastern='TZ=US/Eastern date' alias date-pacific='TZ=US/Pacific date' @@ -95,9 +69,7 @@ alias date-central='TZ=US/Central date' alias date-uk='TZ=Europe/London date' alias date-israel='TZ=Israel date' - ## git - alias gs='git status | less' alias gl='git log --graph --oneline --decorate --all' alias ga='git add' @@ -118,14 +90,10 @@ alias gl="git log --graph --oneline --decorate --all --color=always | --bind='enter:execute:git show --color=always {2} | less -R' \ --bind='ctrl-x:execute:git checkout {2} .'" - ## grep - alias grep='grep --color=auto' - ## speech synthesis - if [ "$(uname)" != 'Darwin' ]; then say() { echo "$@" | festival --tts; } sayfile() { festival --tts "$@"; } @@ -133,9 +101,7 @@ else sayfile() { say -f "$@"; } fi - ## w3m - alias w3m="w3m -B" w3mtor() { local url @@ -165,7 +131,6 @@ news() { ## web services - alias youtube-dl='youtube-dl --format mp4' weather() { curl "wttr.in/?m"; } define() { curl --silent dict://dict.org/d:"$1"; }