Switch back to FZF from skim
This commit is contained in:
parent
98178a74f2
commit
6d92b744e1
3 changed files with 27 additions and 32 deletions
|
@ -31,14 +31,19 @@ export PATH="/home/$USER/.bin:$PATH"
|
||||||
# go path
|
# go path
|
||||||
export GOPATH=~/.go
|
export GOPATH=~/.go
|
||||||
|
|
||||||
# skim settings
|
# fzf settings
|
||||||
export SKIM_DEFAULT_COMMAND='fd -Ht f'
|
export FZF_DEFAULT_COMMAND='fd -Ht f'
|
||||||
export SKIM_ALT_C_COMMAND='fd -Ht d'
|
export FZF_ALT_C_COMMAND='fd -Ht d'
|
||||||
export SKIM_DEFAULT_OPTS='-m --ansi --bind ctrl-a:toggle-all,ctrl-d:deselect-all,ctrl-t:toggle-all'
|
export FZF_DEFAULT_OPTS='-m --ansi --bind ctrl-a:toggle-all,ctrl-d:deselect-all,ctrl-t:toggle-all'
|
||||||
export SKIM_DEFAULT_OPTIONS="$SKIM_DEFAULT_OPTS" # TODO make an issue/PR about this difference
|
export FZF_COMPLETION_TRIGGER='**'
|
||||||
export SKIM_COMPLETION_TRIGGER='**'
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||||
export SKIM_CTRL_T_COMMAND="$SKIM_DEFAULT_COMMAND"
|
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
|
||||||
export SKIM_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
|
_fzf_compgen_dir() {
|
||||||
|
fd -Ht d
|
||||||
|
}
|
||||||
|
_fzf_compgen_path() {
|
||||||
|
fd -Ht f
|
||||||
|
}
|
||||||
|
|
||||||
# dotfile repository location
|
# dotfile repository location
|
||||||
export DOTREPO="$HOME/git/dotfiles"
|
export DOTREPO="$HOME/git/dotfiles"
|
||||||
|
|
|
@ -10,7 +10,7 @@ source ~/.zinit/bin/zinit.zsh
|
||||||
zinit ice load multisrc'{async,pure}.zsh'
|
zinit ice load multisrc'{async,pure}.zsh'
|
||||||
zinit light sindresorhus/pure
|
zinit light sindresorhus/pure
|
||||||
|
|
||||||
# skim as tab completion
|
# fzf as tab completion
|
||||||
zinit ice lucid
|
zinit ice lucid
|
||||||
zinit light Aloxaf/fzf-tab
|
zinit light Aloxaf/fzf-tab
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ zinit light Aloxaf/fzf-tab
|
||||||
zinit ice lucid
|
zinit ice lucid
|
||||||
zinit light zsh-users/zsh-history-substring-search
|
zinit light zsh-users/zsh-history-substring-search
|
||||||
|
|
||||||
# skim git awesomeness
|
# fzf git awesomeness
|
||||||
zinit ice wait'1' lucid atload'source $HOME/.config/zsh/03-aliases.zsh'
|
zinit ice wait'1' lucid atload'source $HOME/.config/zsh/03-aliases.zsh'
|
||||||
zinit light wfxr/forgit
|
zinit light wfxr/forgit
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@ zinit snippet '$DOTREPO/dotdrop/completion/_dotdrop-completion.zsh'
|
||||||
zinit ice lucid atinit'zpcompinit'
|
zinit ice lucid atinit'zpcompinit'
|
||||||
zinit light zdharma-continuum/fast-syntax-highlighting
|
zinit light zdharma-continuum/fast-syntax-highlighting
|
||||||
|
|
||||||
# use skim with zsh
|
# use fzf with zsh
|
||||||
{%@@ if profile == "mko-laptop" @@%}
|
{%@@ if profile == "mko-laptop" @@%}
|
||||||
# Source from home directory since mko-laptop is ubuntu and it doesn't
|
# Source from home directory since mko-laptop is ubuntu and it has an
|
||||||
# have skim in it's repositories
|
# old version of FZF in it's repositories
|
||||||
source ~/Software/skim/shell/key-bindings.zsh
|
source ~/Software/fzf/shell/key-bindings.zsh
|
||||||
source ~/Software/skim/shell/completion.zsh
|
source ~/Software/fzf/shell/completion.zsh
|
||||||
{%@@ else @@%}
|
{%@@ else @@%}
|
||||||
source /usr/share/skim/key-bindings.zsh
|
source /usr/share/fzf/key-bindings.zsh
|
||||||
source /usr/share/skim/completion.zsh
|
source /usr/share/fzf/completion.zsh
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
|
|
|
@ -5,14 +5,6 @@ alias gs='git status'
|
||||||
alias gpull='git pull'
|
alias gpull='git pull'
|
||||||
alias gpush='git push'
|
alias gpush='git push'
|
||||||
|
|
||||||
# make skim zsh plugin use fd
|
|
||||||
_skim_compgen_dir() {
|
|
||||||
fd -Ht d
|
|
||||||
}
|
|
||||||
_skim_compgen_path() {
|
|
||||||
fd -Ht f
|
|
||||||
}
|
|
||||||
|
|
||||||
# Modern replacements for cat and ls
|
# Modern replacements for cat and ls
|
||||||
alias cat='bat --paging=never'
|
alias cat='bat --paging=never'
|
||||||
alias ls='exa'
|
alias ls='exa'
|
||||||
|
@ -47,19 +39,17 @@ function command_not_found_handler {
|
||||||
}
|
}
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
|
|
||||||
# search and install packages with skim
|
# search and install/remove packages with fzf
|
||||||
pi() {
|
pi() {
|
||||||
SELECTED_PKGS="$(paru -Slq | sk --header='Install packages' -m --preview 'paru -Si {1}')"
|
SELECTED_PKGS="$(paru -Slq | fzf --header='Install packages' -m --preview 'paru -Si {1}')"
|
||||||
if [ -n "$SELECTED_PKGS" ]; then
|
if [ -n "$SELECTED_PKGS" ]; then
|
||||||
# Append the expanded command to history
|
# Append the expanded command to history
|
||||||
print -s "paru -S $(echo $SELECTED_PKGS)"
|
print -s "paru -S $(echo $SELECTED_PKGS)"
|
||||||
paru -S $(echo $SELECTED_PKGS)
|
paru -S $(echo $SELECTED_PKGS)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# search and remove packages with skim
|
|
||||||
pr() {
|
pr() {
|
||||||
SELECTED_PKGS="$(paru -Qsq | sk --header='Remove packages' -m --preview 'paru -Si {1}')"
|
SELECTED_PKGS="$(paru -Qsq | fzf --header='Remove packages' -m --preview 'paru -Si {1}')"
|
||||||
if [ -n "$SELECTED_PKGS" ]; then
|
if [ -n "$SELECTED_PKGS" ]; then
|
||||||
# Append the expanded command to history
|
# Append the expanded command to history
|
||||||
print -s "paru -Rns $(echo $SELECTED_PKGS)"
|
print -s "paru -Rns $(echo $SELECTED_PKGS)"
|
||||||
|
@ -67,9 +57,9 @@ pr() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# find and open man pages with skim
|
# find and open man pages with fzf
|
||||||
fman() {
|
fman() {
|
||||||
man -k . | sk --prompt='Man> ' | awk '{print $1}' | xargs -r man
|
man -k . | fzf --prompt='Man> ' | awk '{print $1}' | xargs -r man
|
||||||
}
|
}
|
||||||
|
|
||||||
# I'm retarded so I need this
|
# I'm retarded so I need this
|
||||||
|
|
Loading…
Reference in a new issue