Permalink
Browse files

Merge branch 'master' of https://github.com/neeasade/dotfiles

  • Loading branch information...
neeasade committed Oct 21, 2018
2 parents f6354e9 + fa50cad commit 513b65f9b202bf044945b6a970217ad664c822dc
Showing with 232 additions and 70 deletions.
  1. +20 −4 bin/bin/elisp
  2. +0 −23 bin/bin/fzf
  3. +1 −1 readme.org
  4. +39 −41 shell/.sh.d/environment
  5. +35 −0 shell/.sh.d/environment_emacs
  6. +137 −0 shell/.sh.d/git
  7. +0 −1 shell/.zshrc
@@ -1,10 +1,26 @@
#!/bin/sh
# todo: grep for '*ERROR*: Quit' for exit status as well?
result="$(emacsclient --eval "(progn $@)")"
trim=false
[ "$1" = "-r" ] && trim=true && shift
eclient="emacsclient"
# windows
if [ ! -z "$(uname | awk '$1 ~ /MINGW|MSYS/ {print $1}')" ]; then
eclient="${eclient}w --server-file $HOME/.emacs.d/server/${EMACS_SERVER_FILE:-emacs-server-file}"
fi
result="$($eclient --eval "(progn $@)")"
if [ "$result" = "nil" ] || [ -z "$result" ]; then
exit 1
else
echo "$result"
exit 0
fi
if $trim; then
# trim a list, or quotes (surrounding characters).
echo "$result" | sed -e 's/^.//' -e 's/.$//'
else
echo "$result"
fi
exit 0
fi

This file was deleted.

Oops, something went wrong.
@@ -4,7 +4,7 @@
| OS | Nixos |
| WM | BSPWM |
| Panel | lemonbar |
| Terminal | [[https://github.com/neeasade/xst][xst]] |
| Terminal | Emacs shell, fallback [[https://github.com/neeasade/xst][xst]] |
| Editor | Emacs |
| GTK | [[https://github.com/actionless/oomox][oomox]] with [[http://pobtott.deviantart.com/art/Any-Color-You-Like-175624910][ACYL]] icons. |
@@ -6,17 +6,32 @@ silent() {
}
has() {
silent type "$@"
silent type "$@"
}
if ! has iif; then
iif() {
eval $1 >/dev/null && echo -n "${2-true}" || echo -n "${3-false}"
}
fi
set_editor() {
export EDITOR="$@"
export GIT_EDITOR="$@"
export SVN_EDITOR="$@"
}
set_editor vim
WINDOWS=$(iif "uname | awk '\$1 ~ /MINGW|MSYS/ {print \$1}'")
# less status line
LESS='-R -f -X -i -P ?f%f:(stdin). ?lb%lb?L/%L.. [?eEOF:?pb%pb\%..]'
LESSCHARSET='utf-8'
BROWSER=qutebrowser
TERMINAL=st
FILEBROWSER=thunar
VIEW_PDF=zathura
TERMINAL=$(iif $WINDOWS git-bash st)
# default
GTK_THEME=${GTK_THEME:-adwaita}
@@ -25,27 +40,18 @@ MPDCRON_DIR="$HOME/.config/mpd"
_JAVA_AWT_WM_NONREPARENTING=1
LANG="en_US.UTF-8"
TERMCMD="$TERMINAL"
# enforce emacs --server preference
if has emacs && silent emacsclient --eval "(progn desktop-save-mode)"; then
EDITOR='emacsclient'
else
EDITOR='vim'
fi
GIT_EDITOR="$EDITOR"
SVN_EDITOR="$EDITOR"
if has npm; then
if has cache_output; then
week="$(expr 60 \* 60 \* 24 \* 7)"
NODE_PATH="$(cache_output $week npm root -g)"
PATH="$PATH:$(cache_output $week npm bin -g)"
else
NODE_PATH="$(npm root -g)"
PATH="$PATH:$(npm bin -g)"
fi
fi
PAGER="less"
# if has npm; then
# if has cache_output; then
# day="$(expr 60 \* 60 \* 24)"
# NODE_PATH="$(cache_output $day npm root -g)"
# PATH="$PATH:$(cache_output $day npm bin -g)"
# else
# NODE_PATH="$(npm root -g)"
# PATH="$PATH:$(npm bin -g)"
# fi
# fi
NODE_PATH="$HOME/.npm-packages/lib/node_modules"
PATH="$PATH:$HOME/.npm-packages/bin"
@@ -58,26 +64,18 @@ if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then
. $HOME/.nix-profile/etc/profile.d/nix.sh;
fi
path_add() {
PATH="$PATH:$HOME/$@"
succ() {
PATH="$HOME/$@:$PATH"
}
path_add bin
path_add .gem/bin
path_add .go/bin
path_add .cargo/bin
path_add .wm/scripts/interact
path_add .wm/scripts/visual
path_add .config/guix/current/bin
path_add .guix-profile/bin
if [ -n "$INSIDE_EMACS" ]; then
ESHELL=true
else
ESHELL=false
fi
$ESHELL && PAGER="epager" || PAGER="less"
succ bin
succ .gem/bin
succ .go/bin
succ .cargo/bin
succ .wm/scripts/interact
succ .wm/scripts/visual
succ .config/guix/current/bin
succ .guix-profile/bin
GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
CPATH="/home/neeasade/.guix-profile/include${CPATH:+:}$CPATH"
@@ -0,0 +1,35 @@
# -*- mode: sh -*-
export ESHELL=$(iif '[ -n "$INSIDE_EMACS" ]')
if $ESHELL; then
succ .emacs.d/scripts
PAGER="epager"
fi
# enforce emacs --server preference
if has emacs && silent emacsclient --eval "(progn t)"; then
eclient="emacsclient"
if $WINDOWS; then
eclient="${eclient}w --server-file $HOME/.emacs.d/server/${EMACS_SERVER_FILE:-emacs-server-file}"
fi
set_editor "$eclient"
fi
# rn this is recursive, todo: revaluate
# redir() {
# eval "$(cat <<EOF
# $1() {
# $TERMINAL -c $1
# }
# )"
# }
# if $ESHELL; then
# redir ranger
# redir htop
# redir ncurses
# redir nethack
# fi
@@ -0,0 +1,137 @@
# -*- mode: sh -*-
git_current_branch() {
git rev-parse --abbrev-ref HEAD
}
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gcs='git commit -S'
alias gd='git diff'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gds='git diff --staged'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
alias gf='git fetch'
alias gfa='git fetch --all --prune'
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
alias ggpur='ggu'
alias ggpull='git pull origin $(git_current_branch)'
alias ggpush='git push origin $(git_current_branch)'
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
alias gpsup='git push --set-upstream origin $(git_current_branch)'
alias ghh='git help'
alias gignore='git update-index --assume-unchanged'
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
alias gk='\gitk --all --branches'
alias gke='\gitk --all $(git log -g --pretty=%h)'
alias gl='git pull'
alias glg='git log --stat'
alias glgp='git log --stat -p'
alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
alias gm='git merge'
alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpoat='git push origin --all && git push origin --tags'
alias gpu='git push upstream'
alias gpv='git push -v'
alias gr='git remote'
alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbd='git rebase develop'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset'
alias grhh='git reset --hard'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gsu='git submodule update'
alias gts='git tag -s'
alias gtv='git tag | sort -V'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
@@ -4,7 +4,6 @@
. ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh # git aliases
! $ESHELL && zplug "zsh-users/zsh-autosuggestions", use:"zsh-autosuggestions.zsh" # fish-like suggestions
zplug "djui/alias-tips" # alias reminder

0 comments on commit 513b65f

Please sign in to comment.