From 0d9a401b82a685dcb295b11188ae467562bb0d92 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 1 Apr 2023 14:19:29 -0400 Subject: try out skim --- .gitmodules | 3 +++ Makefile | 1 + bin/hornet/p | 2 +- config/git/config | 2 +- config/sh/aliases | 2 +- config/sh/env | 4 +++- config/sh/skim | 1 + zshinput | 9 ++++++--- 8 files changed, 17 insertions(+), 7 deletions(-) create mode 160000 config/sh/skim diff --git a/.gitmodules b/.gitmodules index 587197a..886056b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,3 +82,6 @@ [submodule "hammerspoon/src/spaces"] path = hammerspoon/src/spaces url = https://github.com/asmagill/hs._asm.undocumented.spaces +[submodule "config/sh/skim"] + path = config/sh/skim + url = https://github.com/lotabout/skim diff --git a/Makefile b/Makefile index a1f0be7..d54fe44 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ INSTALL := \ .config/sh/env \ .config/sh/functions \ .config/sh/fzf \ + .config/sh/skim \ .config/tex/jesse_essay.sty \ .config/tex/jesse_letter.sty \ .config/tex/jesse_macros.sty \ diff --git a/bin/hornet/p b/bin/hornet/p index cbf15c4..6bf537e 100755 --- a/bin/hornet/p +++ b/bin/hornet/p @@ -2,4 +2,4 @@ set -eu set -o pipefail -rbw ls --fields name,user,folder | perl -plE'/^([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = join("/", grep { length } ($3, $1, $2)) . "\0$_"' | sort | fzf --with-nth=1 -d '\x00' | perl -ple'/^([^\0]*)\0([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = "$2 $3"; $_ .= " --folder=\"$4\"" if length $4' | xargs -r rbw get +rbw ls --fields name,user,folder | perl -plE'/^([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = join("/", grep { length } ($3, $1, $2)) . "\0$_"' | sort | sk --with-nth=1 -d '\x00' | perl -ple'/^([^\0]*)\0([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = "$2 $3"; $_ .= " --folder=\"$4\"" if length $4' | xargs -r rbw get diff --git a/config/git/config b/config/git/config index 13a58a7..6d9d9fa 100644 --- a/config/git/config +++ b/config/git/config @@ -10,7 +10,7 @@ bda = "!f() { git branch --merged $(git default-branch) --format='%(refname:short)' | grep -v \"^$(git default-branch)$\" | xargs -r git branch -d; }; f" blame-stats = !~/.bin/git/git-blame-stats br = for-each-ref --sort=committerdate refs/heads/ --format='%(align:30,left)%(HEAD) %(refname:short)%(end) %(color:magenta)(%(committerdate:relative))' - choose-branch = "!f() { git for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short)' | fzf --height 40% --no-sort --preview='git show {} -q --format=medium'; }; f" + choose-branch = "!f() { git for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short)' | sk --height 40% --no-sort --preview='git show {} -q --format=medium'; }; f" c = "!f() { git choose-branch | head -n1 | xargs --no-run-if-empty git co; }; f" cc = cherry-pick co = checkout diff --git a/config/sh/aliases b/config/sh/aliases index 2944681..fecd12a 100644 --- a/config/sh/aliases +++ b/config/sh/aliases @@ -33,7 +33,7 @@ alias misc='tmux new -As misc' alias vim=helix alias pm="find lib -type f" # alias v="vim --cmd 'let g:startify_disable_at_vimenter = 1' -c 'call feedkeys(\"t\")'" -alias v='helix "$(git ls-files | fzf)"' +alias v='helix "$(git ls-files | sk)"' # alias g="vim --cmd 'let g:startify_disable_at_vimenter = 1' -c 'call feedkeys(\"ff\")'" alias utc="env TZ=UTC date" alias pd="perldoc" diff --git a/config/sh/env b/config/sh/env index e0948da..70dcc7c 100644 --- a/config/sh/env +++ b/config/sh/env @@ -17,7 +17,9 @@ export TEXINPUTS=".:$HOME/.config/tex:" export LESS='-QR' export PERL_CPANM_OPT="-q --mirror http://mirrors.kernel.org/cpan/ --mirror http://cpan.metacpan.org/ --prompt" export FZF_DEFAULT_OPTS="--reverse --inline-info --bind=tab:down,shift-tab:up,change:top" -export FZF_DEFAULT_COMMAND="ag --hidden -l ." +export FZF_DEFAULT_COMMAND="rg --hidden -l ." +export SKIM_DEFAULT_OPTIONS="--reverse --inline-info --bind=tab:down,shift-tab:up,change:top" +export SKIM_DEFAULT_COMMAND="rg --hidden -l ." export FANCY_PROMPT_COLORS="user_doy=bright_blue,host_mz-doy1=bright_white,host_tozt=bright_yellow,host_partofme=magenta,host_mail=green,host_hornet=red" export PASSWORD_STORE_X_SELECTION=primary type brew >/dev/null 2>&1 && export PATH="/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/sbin:$PATH" diff --git a/config/sh/skim b/config/sh/skim new file mode 160000 index 0000000..f9438c3 --- /dev/null +++ b/config/sh/skim @@ -0,0 +1 @@ +Subproject commit f9438c390d5e66592e67a9b22fba4e5642b71ffd diff --git a/zshinput b/zshinput index 3ab9ac4..afa2c40 100644 --- a/zshinput +++ b/zshinput @@ -1,6 +1,7 @@ bindkey -v -source ~/.config/sh/fzf/shell/key-bindings.zsh +#source ~/.config/sh/fzf/shell/key-bindings.zsh +source ~/.config/sh/skim/shell/key-bindings.zsh autoload history-search-end zle -N history-beginning-search-backward-end history-search-end @@ -10,8 +11,10 @@ bindkey "^[[B" history-beginning-search-forward-end bindkey "^[OA" history-beginning-search-backward-end bindkey "^[OB" history-beginning-search-forward-end -bindkey -M viins '^R' fzf-history-widget -bindkey -M vicmd '^R' fzf-history-widget +#bindkey -M viins '^R' fzf-history-widget +#bindkey -M vicmd '^R' fzf-history-widget +bindkey -M viins '^R' skim-history-widget +bindkey -M vicmd '^R' skim-history-widget bindkey -M vicmd '/' history-incremental-search-backward bindkey -M vicmd '?' history-incremental-search-forward bindkey -rM viins '^[/' -- cgit v1.2.3