Skim?
This commit is contained in:
parent
64150bbcc7
commit
6b2a8c1cc2
8 changed files with 41 additions and 37 deletions
|
@ -17,6 +17,7 @@
|
||||||
- tmux
|
- tmux
|
||||||
- gnupg
|
- gnupg
|
||||||
- neovim
|
- neovim
|
||||||
|
- skim
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Install Development Tools
|
- name: Install Development Tools
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
- gpg
|
- gpg
|
||||||
- neovim
|
- neovim
|
||||||
- hstr
|
- hstr
|
||||||
- fzf
|
- skim
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Install @development-tools
|
- name: Install @development-tools
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
- name: Homebrew - install most packages
|
- name: Homebrew - install most packages
|
||||||
homebrew:
|
homebrew:
|
||||||
update_homebrew: yes
|
update_homebrew: yes
|
||||||
name: neovim,git,gnu-tar,zstd
|
name: neovim,git,gnu-tar,zstd,skim
|
||||||
|
|
||||||
- name: Homebrew - Install zsh
|
- name: Homebrew - Install zsh
|
||||||
homebrew:
|
homebrew:
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
- tmux
|
- tmux
|
||||||
- gpg
|
- gpg
|
||||||
- neovim
|
- neovim
|
||||||
- fzf
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Install devel_*
|
- name: Install devel_*
|
||||||
|
@ -42,3 +41,18 @@
|
||||||
- clang
|
- clang
|
||||||
- libopenssl-devel
|
- libopenssl-devel
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: Add rust_apps repo
|
||||||
|
command: zypper ar https://download.opensuse.org/repositories/home:/luke_nukem:/rust_apps/openSUSE_Tumbleweed/home:luke_nukem:rust_apps.repo
|
||||||
|
args:
|
||||||
|
creates: /etc/zypp/repos.d/home_luke_nukem_rust_apps.repo
|
||||||
|
|
||||||
|
- name: Install skim
|
||||||
|
command: zypper --no-gpg-check in -y skim
|
||||||
|
|
||||||
|
- name: Put sk-tmux in ~/bin directory¬
|
||||||
|
get_url:
|
||||||
|
url: https://raw.githubusercontent.com/lotabout/skim/v0.6.8/bin/sk-tmux
|
||||||
|
dest: ~/bin/sk-tmux
|
||||||
|
checksum: 3f9b531a6fbd49fc501ff430d4d2f92122ccfe73d95fa121a234de4f7be1d5e2
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# from the fzf examples wiki
|
|
||||||
bind '"\C-r": "\C-x1\e^\er"'
|
|
||||||
bind -x '"\C-x1": __fzf_history';
|
|
||||||
|
|
||||||
__fzf_history ()
|
|
||||||
{
|
|
||||||
__ehc $(history | fzf --tac --tiebreak=index | perl -ne 'm/^\s*([0-9]+)/ and print "!$1"')
|
|
||||||
}
|
|
||||||
|
|
||||||
__ehc()
|
|
||||||
{
|
|
||||||
if
|
|
||||||
[[ -n $1 ]]
|
|
||||||
then
|
|
||||||
bind '"\er": redraw-current-line'
|
|
||||||
bind '"\e^": magic-space'
|
|
||||||
READLINE_LINE=${READLINE_LINE:+${READLINE_LINE:0:READLINE_POINT}}${1}${READLINE_LINE:+${READLINE_LINE:READLINE_POINT}}
|
|
||||||
READLINE_POINT=$(( READLINE_POINT + ${#1} ))
|
|
||||||
else
|
|
||||||
bind '"\er":'
|
|
||||||
bind '"\e^":'
|
|
||||||
fi
|
|
||||||
}
|
|
19
zsh/funcs/skim.funcs
Normal file
19
zsh/funcs/skim.funcs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# This entire thing almost entirely, shamelessly stolen from fzf/shell/key-bindings.zsh, replacing fzf with skim
|
||||||
|
export SKIM_DEFAULT_COMMAND="rg --files"
|
||||||
|
skim-history-widget() {
|
||||||
|
local selected num
|
||||||
|
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
|
||||||
|
selected=( $(fc -rl 1 |
|
||||||
|
SKIM_DEFAULT_OPTS="--height ${SKIM_TMUX_HEIGHT:-40%} $SKIM_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $SKIM_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" sk-tmux -d${SKIM_TMUX_HEIGHT} ))
|
||||||
|
local ret=$?
|
||||||
|
if [ -n "$selected" ]; then
|
||||||
|
num=$selected[1]
|
||||||
|
if [ -n "$num" ]; then
|
||||||
|
zle vi-fetch-history -n $num
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
zle reset-prompt
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
zle -N skim-history-widget
|
||||||
|
bindkey '^R' skim-history-widget
|
|
@ -1,6 +1,5 @@
|
||||||
robbyrussell/oh-my-zsh path:plugins/git
|
robbyrussell/oh-my-zsh path:plugins/git
|
||||||
robbyrussell/oh-my-zsh path:plugins/vi-mode
|
robbyrussell/oh-my-zsh path:plugins/vi-mode
|
||||||
robbyrussell/oh-my-zsh path:plugins/fzf
|
|
||||||
robbyrussell/oh-my-zsh path:plugins/gitignore
|
robbyrussell/oh-my-zsh path:plugins/gitignore
|
||||||
robbyrussell/oh-my-zsh path:plugins/pass
|
robbyrussell/oh-my-zsh path:plugins/pass
|
||||||
robbyrussell/oh-my-zsh path:plugins/ripgrep
|
robbyrussell/oh-my-zsh path:plugins/ripgrep
|
||||||
|
|
14
zsh/zshrc
14
zsh/zshrc
|
@ -1,5 +1,3 @@
|
||||||
# Lines configured by zsh-newuser-install
|
|
||||||
|
|
||||||
HISTFILE=~/.histfile
|
HISTFILE=~/.histfile
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
|
@ -9,8 +7,6 @@ bindkey -v
|
||||||
export RPROMPT=' ' # Fixes a side-effect of the vi-mode oh-my-zsh plugin
|
export RPROMPT=' ' # Fixes a side-effect of the vi-mode oh-my-zsh plugin
|
||||||
export KEYTIMEOUT=1
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
#keybindings
|
|
||||||
|
|
||||||
fpath=(~/bin ~/.zshcompletions $fpath)
|
fpath=(~/bin ~/.zshcompletions $fpath)
|
||||||
zstyle :compinstall filename '/home/anthonys/.zshrc'
|
zstyle :compinstall filename '/home/anthonys/.zshrc'
|
||||||
zstyle ":completion:*" complete _complete _ignored _approximate _expand
|
zstyle ":completion:*" complete _complete _ignored _approximate _expand
|
||||||
|
@ -27,6 +23,7 @@ zle -N down-line-or-beginning-search
|
||||||
|
|
||||||
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
|
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
|
||||||
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
|
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
|
||||||
|
bindkey "^R" __history_search
|
||||||
|
|
||||||
autoload -Uz compinit promptinit
|
autoload -Uz compinit promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
@ -36,8 +33,6 @@ export COMPLETION_WAITING_DOTS="true"
|
||||||
export VISUAL='nvim'
|
export VISUAL='nvim'
|
||||||
export EDITOR='nvim'
|
export EDITOR='nvim'
|
||||||
export PATH=$HOME/bin:$PATH
|
export PATH=$HOME/bin:$PATH
|
||||||
export MAGIC_ENTER_OTHER_COMMAND='exa -l --git'
|
|
||||||
|
|
||||||
|
|
||||||
source <(antibody init)
|
source <(antibody init)
|
||||||
|
|
||||||
|
@ -85,9 +80,6 @@ function nv() {
|
||||||
nvr -s $@
|
nvr -s $@
|
||||||
}
|
}
|
||||||
|
|
||||||
# the following lines sourced from the fzf distribution files
|
|
||||||
export FZF_TMUX=1
|
|
||||||
|
|
||||||
export PATH="$PATH:$HOME/.anyenv/bin"
|
export PATH="$PATH:$HOME/.anyenv/bin"
|
||||||
eval "$(anyenv init -)"
|
eval "$(anyenv init -)"
|
||||||
export PATH="$(yarn global bin):$PATH"
|
export PATH="$(yarn global bin):$PATH"
|
||||||
|
@ -103,4 +95,6 @@ else
|
||||||
touch $HOME/.zshsrc
|
touch $HOME/.zshsrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export MAGIC_ENTER_OTHER_COMMAND='exa -l --git'
|
for funcfile in $(ls $HOME/.zsh.d); do
|
||||||
|
source ${HOME}.zsh.d/${funcfile}
|
||||||
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue