From 1297a2e0ec774a13c9900b63c2b4afbb6582a5d3 Mon Sep 17 00:00:00 2001 From: Peter Son Struschka Date: Wed, 10 Oct 2018 17:19:29 +0700 Subject: multiple changes mostly to zsh and polybar --- zsh/.zfunc/_kitty | 14 ++++++++++++++ zsh/.zprofile | 4 ++++ zsh/.zshrc | 39 ++++++++++++++++++++++++++++++++------- 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 zsh/.zfunc/_kitty (limited to 'zsh') diff --git a/zsh/.zfunc/_kitty b/zsh/.zfunc/_kitty new file mode 100644 index 0000000..15918b5 --- /dev/null +++ b/zsh/.zfunc/_kitty @@ -0,0 +1,14 @@ +autoload -Uz compinit +compinit + +_kitty() { + local src + # Send all words up to the word the cursor is currently on + src=$(printf "%s +" "${(@)words[1,$CURRENT]}" | kitty +complete zsh) + if [[ $? == 0 ]]; then + eval ${src} + fi +} +compdef _kitty kitty + diff --git a/zsh/.zprofile b/zsh/.zprofile index 8589282..400fa76 100755 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -19,5 +19,9 @@ export PATH="$HOME/.bin:$PATH" export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH" export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" +export PATH="$HOME/.node_modules/bin:$PATH" +export npm_config_prefix=~/.node_modules + + alias open=xdg-open diff --git a/zsh/.zshrc b/zsh/.zshrc index 7c3e4c5..404a8b7 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -3,10 +3,17 @@ source /usr/share/zsh/share/antigen.zsh antigen use oh-my-zsh antigen bundle git +antigen bundle git-extras antigen bundle pip antigen bundle lein antigen bundle command-not-found antigen bundle docker +antigen bundle archlinux +antigen bundle sublime +antigen bundle zsh-navigation-tools +antigen bundle systemd +antigen bundle taskwarrior +antigen bundle virtualenvwrapper fpath+=~/.zfunc antigen bundle zsh-users/zsh-syntax-highlighting @@ -22,10 +29,10 @@ POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" #POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ " POWERLEVEL9K_PROMPT_ADD_NEWLINE=true POWERLEVEL9K_MODE='awesome-fontconfig' -POWERLEVEL9K_SHORTEN_DIR_LENGTH=4 +POWERLEVEL9K_SHORTEN_DIR_LENGTH=3 -POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir dir_writable vcs) -POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time) +POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context virtualenv dir dir_writable vcs) +POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time root_indicator background_jobs history time) # antigen theme https://gist.github.com/pstruschka/c05686e6cf10e12471a3104e42e6366b.git agnoster_custom antigen theme bhilburn/powerlevel9k powerlevel9k @@ -33,16 +40,34 @@ antigen theme bhilburn/powerlevel9k powerlevel9k antigen apply -if ! type "exa" > /dev/null; then - echo exa Missing, using ls -else +if type "kitty" > /dev/null; then + autoload -Uz compinit + compinit + # Completion for kitty + kitty + complete setup zsh | source /dev/stdin + + alias kdiff="kitty +kitten diff" + alias kicat="kitty +kitten icat" + alias kunicode="kitty +kitten unicode_input" + alias kpanel="kitty +kitten panel" + alias khints="kitty +kitten hints" + alias kclip="kitty +kitten clipboard" +fi + + +if type "exa" > /dev/null; then alias ls=exa fi -eval $(thefuck --alias) + +if type "thefuck" > /dev/null; then + eval $(thefuck --alias) +fi # python virtualenvwrapper export WORKON_HOME=~/.virtualenvs source /usr/bin/virtualenvwrapper_lazy.sh +alias ec="emacsclient -c" + eval "$(fasd --init auto)" -- cgit v1.2.3