Make initial coarse split

master
Jacopo De Simoi 5 years ago
parent d8cfcb0eed
commit 5f8ffb946e
  1. 135
      zshrc.org

@ -21,7 +21,9 @@ This is my ~.zshrc~; it will be used in many environments:
- mips box
Each environment has slightly different setups, which will be tangled to different files
#+BEGIN_SRC sh :tangle ".zshrc"
*** KDE helpers
#+BEGIN_SRC sh :tangle ".zshrc"
kde-current-activity () {
qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity
}
@ -30,9 +32,6 @@ Each environment has slightly different setups, which will be tangled to differe
qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName `kde-current-activity`
}
# try without
#DBUS_SESSION_BUS_ADDRESS=$(cat ~/.dbus.kde.address)
kde-cd-build () {
cd $(pwd | sed -e 's+scratch/src/kde+scratch/src/kde/build+')
}
@ -40,17 +39,14 @@ Each environment has slightly different setups, which will be tangled to differe
kde-cd-src () {
cd $(pwd | sed -e 's+scratch/src/kde/build+scratch/src/kde+')
}
#+end_src
*** Android helpers
#+begin_src sh :tangle ".zshrc"
run-task () {
adb shell am broadcast --user 0 -a net.dinglish.tasker.run_task -e task "$1"
}
ifttt () {
curl -X POST https://maker.ifttt.com/trigger/$1/with/key/JLJw_lpzFTzDQetjix9Hr
}
ANDROID_A3=A3201809076708
ANDROID_BLU=6LFUQ86DYLOFCANR
ANDROID_IP=192.168.0.22
@ -89,6 +85,11 @@ Each environment has slightly different setups, which will be tangled to differe
adb -s $ANDROID_BLU forward --remove tcp:8097
}
#+end_src
*** Misc helpers
#+begin_src sh :tangle ".zshrc"
wttr()
{
local location=Toronto
@ -96,6 +97,14 @@ Each environment has slightly different setups, which will be tangled to differe
curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-$location}?T$narrow"
}
#ifttt
ifttt () {
curl -X POST https://maker.ifttt.com/trigger/$1/with/key/JLJw_lpzFTzDQetjix9Hr
}
#+end_src
*** emacs helpers
#+begin_src sh :tangle ".zshrc"
SOLARIZED="true"
# Emacs stuff
@ -109,6 +118,25 @@ Each environment has slightly different setups, which will be tangled to differe
/home/jacopods/.emacs.d/emacsclient-activities $EMACS_ARGUMENTS $@
}
magit() {
# TODO: add parameter just in case
eca -e "(magit-status \"$(pwd)\")"
}
bindkey -s '^X^G' 'magit\n'
agenda() {
# TODO: add parameter just in case
eca -e "(org-agenda-list)"
}
kill-emacs() {
eca -e "(kill-emacs)"
}
#+end_src
*** oh-my-zsh setup
#+begin_src sh :tangle ".zshrc"
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
@ -193,6 +221,27 @@ Each environment has slightly different setups, which will be tangled to differe
export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin"
# rationalise-dot; useful for cd ......./whatever
rationalise-dot() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
else
LBUFFER+=.
fi
}
zle -N rationalise-dot
bindkey . rationalise-dot
bindkey -s '^[(' '()^B'
bindkey -s '^[{' '{}^B'
# Make ctrl-Backspace work
bindkey "\e[9;5~" backward-delete-word
autoload zmv
#+end_src
*** editor env variables
#+begin_src sh :tangle ".zshrc"
# editor stuff
#export ALTERNATE_EDITOR="/usr/bin/emacs"
@ -201,6 +250,9 @@ Each environment has slightly different setups, which will be tangled to differe
export VISUAL=$EMACS
export GIT_EDITOR="/home/jacopods/.emacs.d/emacsclient-activities"
export SUDO_EDITOR=$EMACS
#+end_src
*** git helpers
#+begin_src sh :tangle ".zshrc"
git-create-thinkspoon-remote () {
REPO_NAME=$(basename "`pwd`")
@ -211,6 +263,10 @@ Each environment has slightly different setups, which will be tangled to differe
git-current-branch () {
git status -b | head -n 1 | awk {'print $3'}
}
#+end_src
*** Aliases
#+begin_src sh :tangle ".zshrc"
##############################################################################
## Aliases
##############################################################################
@ -224,9 +280,10 @@ Each environment has slightly different setups, which will be tangled to differe
alias mk="~/scripts/latex-mk $@"
alias neofetch="~/clones/neofetch/neofetch --source ~/clones/neofetch/ascii/gentoo-one --separator ' ⎯⎯' --bold off --colors 4 12 5 3 12 6 | sed -e 's/bree/Bree/' | sed -e 's/2560x/2560×/'"
alias dock="~/scripts/dock-a3.sh"
######
## Time management
#####
#+end_src
*** Pomodoro helpers
#+begin_src sh :tangle ".zshrc"
alias pomo="/home/jacopods/.local/bin/termdown 25m -aW -f 3x5 -c 180 -b -q 10 -s $@"
alias heirloom="/home/jacopods/.local/bin/termdown -s 37m -aW -f 3x5 -c 300 -b -q 10 $@"
alias pomodorino="/home/jacopods/.local/bin/termdown 14m -aW -f 3x5 -c 120 -b -q 10 -s $@"
@ -239,9 +296,7 @@ Each environment has slightly different setups, which will be tangled to differe
alias kbd-android=""
alias K=/home/jacopods/tmp/keymaps/remap-keyboard
alias quercus="falkon q.utoronto.ca"
alias gmail="chromium www.gmail.com"
#alias portal="chromium portal.utoronto.ca"
alias ls=' exa'
@ -251,7 +306,6 @@ Each environment has slightly different setups, which will be tangled to differe
alias o="okular"
alias plasmashell-master="QT_PLUGIN_PATH=/usr/lib/kf5/lib64/plugins /usr/lib/kf5/bin/plasmashell >/dev/null 2>/dev/null"
alias skype="skypeforlinux"
alias ta="tmux attach"
alias acroread="env WINEPREFIX=$HOME/.wine32 WINEARCH='win32' wine ~/.wine32/drive_c/Program\ Files/Adobe/Reader\ 11.0/Reader/AcroRd32.exe >/dev/null 2>/dev/null"
@ -265,27 +319,11 @@ Each environment has slightly different setups, which will be tangled to differe
alias -s pdf='run-silent okular'
alias -s djvu='run-silent okular'
alias -s tex=emacs
alias betty=~/tmp/betty/main.rb
alias d.u='ssh dropbox.utoronto "~/dropbox.py"'
alias -g C='| xclip'
# rationalise-dot; useful for cd ......./whatever
rationalise-dot() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
else
LBUFFER+=.
fi
}
zle -N rationalise-dot
bindkey . rationalise-dot
bindkey -s '^X^G' 'magit\n'
bindkey -s '^[(' '()^B'
bindkey -s '^[{' '{}^B'
# this function is a poor-man eselect for configuration files
# it mv's filename to filename_ or viceversa
uv() {
@ -301,43 +339,10 @@ Each environment has slightly different setups, which will be tangled to differe
fi
}
magit() {
# TODO: add parameter just in case
e -e "(magit-status \"$(pwd)\")"
}
agenda() {
# TODO: add parameter just in case
e -e "(org-agenda-list)"
}
kill-emacs() {
e -e "(kill-emacs)"
}
# Make ctrl-Backspace work
bindkey "\e[9;5~" backward-delete-word
hash -d Papers="/home/jacopods/work/Papers"
hash -d Books="/home/jacopods/work/Books"
hash -d kde="/scratch/kde/src"
hash -d kde5="/scratch/kde/src5"
autoload zmv
# export MANPATH="/usr/local/man:$MANPATH"
# # Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
#+END_SRC

Loading…
Cancel
Save