More modular loading of zsh.
This commit is contained in:
parent
65fa688ccf
commit
37bcd75df3
22
zsh/.zshrc
22
zsh/.zshrc
@ -14,23 +14,11 @@ autoload -U compinit && compinit -d $XDG_DATA_HOME/zsh/zcompdump
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' list-colors ''
|
||||
|
||||
# fzf
|
||||
if [ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ]; then
|
||||
source $XDG_CONFIG_HOME/fzf/fzf.zsh
|
||||
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
||||
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
|
||||
_fzf_compgen_path() {
|
||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1"
|
||||
}
|
||||
_fzf_compgen_dir() {
|
||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1"
|
||||
}
|
||||
source $ZDOTDIR/fzf-git.zsh
|
||||
fi
|
||||
# aliases
|
||||
source $ZDOTDIR/aliases.zsh
|
||||
|
||||
# plugins
|
||||
# plugins & addons
|
||||
[ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ] && source $ZDOTDIR/fzf.zsh
|
||||
source $ZDOTDIR/modules/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
export WD_CONFIG=$XDG_CONFIG_HOME/wd_list
|
||||
wd () {
|
||||
@ -44,5 +32,5 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# local addons
|
||||
# local settings
|
||||
[ -e $XDG_CONFIG_HOME/local/zsh ] && source $XDG_CONFIG_HOME/local/zsh
|
||||
|
25
zsh/aliases.zsh
Normal file
25
zsh/aliases.zsh
Normal file
@ -0,0 +1,25 @@
|
||||
alias grep='grep --color'
|
||||
alias less='less -r'
|
||||
if [ $(command -v bat) ]; then
|
||||
alias cat='/usr/local/bin/bat --color=always --tabs=2 --style plain --theme=Monokai\ Extended\ Bright'
|
||||
fi
|
||||
if [ $(command -v exa) ]; then
|
||||
alias ls='exa --group-directories-first'
|
||||
alias ll='ls -l --git'
|
||||
else
|
||||
case $(uname -s) in;
|
||||
Darwin) alias ls='ls -G';;
|
||||
Linux) alias ls='ls --color';;
|
||||
esac
|
||||
alias ll='ls -l'
|
||||
fi
|
||||
if [ $(command -v fd) ]; then
|
||||
alias fd='/usr/local/bin/fd -H -L --ignore-file ~/.config/local/fd'
|
||||
fi
|
||||
if [ $(command -v nvim) ]; then
|
||||
export EDITOR='nvim'
|
||||
alias vim='nvim'
|
||||
alias vimdiff='nvim -d'
|
||||
else
|
||||
export EDITOR='vim'
|
||||
fi
|
@ -1,5 +1,16 @@
|
||||
# heavily inspired (and sometimes stolen from): https://github.com/wfxr/forgit.git
|
||||
source $XDG_CONFIG_HOME/fzf/fzf.zsh
|
||||
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
||||
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
|
||||
_fzf_compgen_path() {
|
||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1"
|
||||
}
|
||||
_fzf_compgen_dir() {
|
||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1"
|
||||
}
|
||||
|
||||
# heavily inspired (and sometimes stolen from): https://github.com/wfxr/forgit.git
|
||||
_am_i_git_repo() { git rev-parse --is-inside-work-tree >/dev/null; }
|
||||
|
||||
gl() {
|
Loading…
Reference in New Issue
Block a user