(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)
This commit is contained in:
58
Shell/.zshrc
58
Shell/.zshrc
@@ -14,21 +14,34 @@ alias paste="xclip -o"
|
|||||||
alias md="mkdir"
|
alias md="mkdir"
|
||||||
alias ls="ls --color"
|
alias ls="ls --color"
|
||||||
alias l="ls -la"
|
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 suctl="systemctl --user"
|
||||||
alias sedit="emacsclient -s MAIN -a emacs -c"
|
alias sedit="emacsclient -s MAIN -a emacs -c"
|
||||||
alias cedit="emacsclient -s MAIN -a emacs -nw"
|
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
|
## ZSH
|
||||||
setopt autocd
|
|
||||||
export ZSH_THEME="af-magic"
|
|
||||||
PS1="%B%F{blue}[%(4~|...|)%3~]
|
|
||||||
%F{white}λ %b%f%k"
|
|
||||||
setopt histignorealldups sharehistory
|
|
||||||
|
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
|
|
||||||
|
setopt autocd
|
||||||
|
export ZSH_THEME="af-magic"
|
||||||
|
PS1="%B%F{128}(%n@%m)%B%F{64}[%(4~|...|)%3~]
|
||||||
|
%F{white}>> %b%f%k"
|
||||||
|
setopt histignorealldups sharehistory
|
||||||
|
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
zstyle ':completion:*' menu select
|
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:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,'
|
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
|
## Vim binds
|
||||||
bindkey -v
|
bindkey -v
|
||||||
autoload -z edit-command-line
|
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 'j' vi-up-line-or-history
|
||||||
bindkey -M menuselect 'k' vi-down-line-or-history
|
bindkey -M menuselect 'k' vi-down-line-or-history
|
||||||
bindkey -M menuselect 'l' vi-forward-char
|
bindkey -M menuselect 'l' vi-forward-char
|
||||||
|
bindkey '^[[A' history-substring-search-up
|
||||||
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
|
||||||
# Cursor
|
# Cursor
|
||||||
function zle-keymap-select {
|
function zle-keymap-select {
|
||||||
@@ -84,32 +105,11 @@ zle -N zle-line-init
|
|||||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
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.
|
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
|
## NVM config
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads 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
|
[ -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!!!
|
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
||||||
export SDKMAN_DIR="/home/dx/.sdkman"
|
export SDKMAN_DIR="/home/dx/.sdkman"
|
||||||
|
|||||||
Reference in New Issue
Block a user