From de162b86736ed6dedf4eabdd4a1dbdcbb27915bc Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 27 May 2021 22:22:45 +0200 Subject: Refactor zsh config --- .config/zsh/.zshrc | 30 +++++++++++++++++++++++++++--- .config/zsh/aliases.zsh | 11 ----------- .config/zsh/exports.zsh | 43 ------------------------------------------- .config/zsh/keybindings.zsh | 6 ------ .config/zsh/plugins.zsh | 2 +- 5 files changed, 28 insertions(+), 64 deletions(-) delete mode 100644 .config/zsh/aliases.zsh delete mode 100644 .config/zsh/exports.zsh delete mode 100644 .config/zsh/keybindings.zsh diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index af98c0e..dc398be 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,7 +1,31 @@ # ZSH config # Load plugins first [ -f $HOME/.config/zsh/plugins.zsh ] && source $HOME/.config/zsh/plugins.zsh -[ -f $HOME/.config/zsh/exports.zsh ] && source $HOME/.config/zsh/exports.zsh [ -f $HOME/.config/zsh/functions.zsh ] && source $HOME/.config/zsh/functions.zsh -[ -f $HOME/.config/zsh/keybindings.zsh ] && source $HOME/.config/zsh/keybindings.zsh -[ -f $HOME/.config/zsh/aliases.zsh ] && source $HOME/.config/zsh/aliases.zsh + +# Uncomment the following line to use case-sensitive completion. +CASE_SENSITIVE="true" + +zle_highlight=('paste:none') + +autoload -U colors && colors + +# For autocomplete to work +autoload -U +X compinit && compinit +autoload -U +X bashcompinit && bashcompinit + +# History in cache directory: +HISTSIZE=100000 +SAVEHIST=100000 +HISTFILE=~/.cache/zsh/history + +export CLICOLOR=1 + +# FZF search files +bindkey "ç" fzf-cd-widget + +# Search history +bindkey "^[[A" history-beginning-search-backward +bindkey "^[[B" history-beginning-search-forward + +eval "$(pyenv init -)" diff --git a/.config/zsh/aliases.zsh b/.config/zsh/aliases.zsh deleted file mode 100644 index 23db311..0000000 --- a/.config/zsh/aliases.zsh +++ /dev/null @@ -1,11 +0,0 @@ -alias lg='lazygit' -alias gpu-watch="watch -n -1 nvidia-smi" -alias zshconfig="nvim ~/.zshrc" -alias gp='git add . && git commit -m "auto push" && git push' -alias zrc='nvim ~/.zshrc' -alias zsource='source ~/.zshrc' -alias v='nvim' -alias vi='nvim' -alias vim='nvim' -alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' -alias tmux='tmux -f $HOME/.config/tmux/.tmux.conf' diff --git a/.config/zsh/exports.zsh b/.config/zsh/exports.zsh deleted file mode 100644 index dc4c146..0000000 --- a/.config/zsh/exports.zsh +++ /dev/null @@ -1,43 +0,0 @@ -# Adds `~/.local/bin` to $PATH -export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}" - -# Uncomment the following line to use case-sensitive completion. -CASE_SENSITIVE="true" - -zle_highlight=('paste:none') - -autoload -U colors && colors - -# For autocomplete to work -autoload -U +X compinit && compinit -autoload -U +X bashcompinit && bashcompinit - -# History in cache directory: -HISTSIZE=10000 -SAVEHIST=10000 -HISTFILE=~/.cache/zsh/history - -# Preferred editor for local and remote sessions - if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='nvim' - else - export EDITOR='nvim' - fi - -export CLICOLOR=1 - -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" -PATH=$(pyenv root)/shims:$PATH -eval "$(pyenv init -)" - -# Rust -export PATH="$HOME/.cargo/bin:$PATH" - -export GEM_HOME="$HOME/.gem" - -# Created by `pipx` on 2021-03-01 21:32:03 -export PATH="$PATH:/home/aktersnurra/.local/bin" - -export BROWSER=brave -export TERMINAL=alacritty diff --git a/.config/zsh/keybindings.zsh b/.config/zsh/keybindings.zsh deleted file mode 100644 index 6565381..0000000 --- a/.config/zsh/keybindings.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# FZF search files -bindkey "ç" fzf-cd-widget - -# Search history -bindkey "^[[A" history-beginning-search-backward -bindkey "^[[B" history-beginning-search-forward diff --git a/.config/zsh/plugins.zsh b/.config/zsh/plugins.zsh index 7d832fd..7da3a07 100644 --- a/.config/zsh/plugins.zsh +++ b/.config/zsh/plugins.zsh @@ -5,7 +5,7 @@ compinit fpath+=~/.zfunc # kubectl autocompletion -[[ $commands[kubectl] ]] && source <(kubectl completion zsh) +# [[ $commands[kubectl] ]] && source <(kubectl completion zsh) # FZF source /usr/share/fzf/key-bindings.zsh -- cgit v1.2.3-70-g09d2