diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-10 17:13:55 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-10 17:13:55 +0100 |
commit | 0b6c885d7caa81555ceb0bf0c1e7c6c77f8e6272 (patch) | |
tree | f33f8fe2151532a0b1cc623c6c6551550648266e /Shell | |
parent | 616cfa7c073b6fb4b01e0f5c098ec7c27a0402ad (diff) | |
download | dotfiles-0b6c885d7caa81555ceb0bf0c1e7c6c77f8e6272.tar.gz dotfiles-0b6c885d7caa81555ceb0bf0c1e7c6c77f8e6272.tar.bz2 dotfiles-0b6c885d7caa81555ceb0bf0c1e7c6c77f8e6272.zip |
(Shell)~zshrc to be a bit more featureful~ps1
The PS1 variable has been changed to look a bit nicer, added some nice
functions for quick edits in the terminal (though I still expect to
use Emacs for anything above a quick edit)
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/.zshrc | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/Shell/.zshrc b/Shell/.zshrc index fa382ed..0c0836f 100644 --- a/Shell/.zshrc +++ b/Shell/.zshrc @@ -14,21 +14,34 @@ alias paste="xclip -o" alias md="mkdir" alias ls="ls --color" alias l="ls -la" -alias fzf="fzf --layout=reverse --height=20" +alias fzf="fd --hidden | fzf --layout=reverse --height=20" alias suctl="systemctl --user" alias sedit="emacsclient -s MAIN -a emacs -c" alias cedit="emacsclient -s MAIN -a emacs -nw" -export CLASSPATH="$CLASSPATH:$HOME/.local/src/eclipse.jdt.ls" + +vf () { + vim $(fzf) +} + +ef () { + sedit $(fzf) +} + +### Git aliases +alias gs="git status" +alias gc="git commit" +alias gg="emacsclient -s MAIN -a emacs -c --eval '(magit)'" ## ZSH +autoload -U colors && colors +autoload -U compinit + setopt autocd export ZSH_THEME="af-magic" -PS1="%B%F{blue}[%(4~|...|)%3~] -%F{white}λ %b%f%k" +PS1="%B%F{128}(%n@%m)%B%F{64}[%(4~|...|)%3~] +%F{white}>> %b%f%k" setopt histignorealldups sharehistory -autoload -U colors && colors -autoload -U compinit HISTSIZE=10000 SAVEHIST=10000 zstyle ':completion:*' menu select @@ -51,6 +64,12 @@ zstyle ':completion:*' verbose true zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,' +## Imports +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh +# ## Vim binds bindkey -v autoload -z edit-command-line @@ -61,6 +80,8 @@ bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'j' vi-up-line-or-history bindkey -M menuselect 'k' vi-down-line-or-history bindkey -M menuselect 'l' vi-forward-char +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down # Cursor function zle-keymap-select { @@ -84,32 +105,11 @@ zle -N zle-line-init echo -ne '\e[5 q' # Use beam shape cursor on startup. preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. -## Programming -editor() { - nohup emacs $@ > /dev/null & -} - -gentemplate() { - for var in ${@:2}; do - case $1 in - 'c') git clone https://github.com/Oreodave/CTemplate $var;; - 'cpp') git clone https://github.com/Oreodave/CPPTemplate $var;; - *) return;; - esac - rm -rf $var/.git; - done -} - -devour() { - $@ & disown; exit -} - ## NVM config export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! export SDKMAN_DIR="/home/dx/.sdkman" |