Change ZSH configuration
- Enable keychain - Fix ls alias - Added sway startup script
This commit is contained in:
37
zsh/.zshrc
37
zsh/.zshrc
@@ -78,6 +78,7 @@ plugins=(
|
||||
command-not-found
|
||||
fzf
|
||||
gitignore
|
||||
keychain
|
||||
mise
|
||||
zoxide
|
||||
zsh-autosuggestions
|
||||
@@ -122,35 +123,7 @@ fpath=(~/.zsh $fpath)
|
||||
autoload run-help
|
||||
autoload -Uz compinit && compinit -u
|
||||
|
||||
# Key bindings using bindkey and fzf-tmux where possible
|
||||
# Ctrl+R: Enhanced reverse history search
|
||||
bindkey '^R' fzf-history-widget
|
||||
|
||||
# Ctrl+T: Fuzzy find file
|
||||
bindkey '^T' fzf-file-widget
|
||||
|
||||
# Alt+C: Fuzzy change directory
|
||||
bindkey '^[c' fzf-cd-widget
|
||||
|
||||
# Additional useful bindings
|
||||
# Alt+H: Search and insert from history
|
||||
fzf-history-widget() {
|
||||
BUFFER=$(fc -l 1 | fzf --tac +s --no-sort --preview 'echo {}' | sed 's/^[ 0-9]*//')
|
||||
CURSOR=$#BUFFER
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N fzf-history-widget
|
||||
|
||||
fzf-file-widget() {
|
||||
local file
|
||||
file=$(fzf --preview 'bat --style=numbers --color=always --line-range :500 {}' 2> /dev/null) && LBUFFER+="$file"
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N fzf-file-widget
|
||||
|
||||
fzf-cd-widget() {
|
||||
local dir
|
||||
dir=$(fd --type d | fzf --preview 'tree -a -C {} | head -100') && cd "$dir"
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N fzf-cd-widget
|
||||
export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf
|
||||
source <(fzf --zsh)
|
||||
source "$FZF_HOME/shell/key-bindings.zsh"
|
||||
source "$FZF_HOME/shell/completion.zsh"
|
||||
|
||||
Reference in New Issue
Block a user