Compare commits

..

No commits in common. "e9f9ce619331aeaae0e483d8c978a5b12d69edbc" and "c20d18e62d96157e6a4c55410aeee99fa5ee6f82" have entirely different histories.

3 changed files with 22 additions and 39 deletions

View File

@ -207,23 +207,3 @@ build-debug() {
local target=$1; shift 1 local target=$1; shift 1
eval build $target && debug ~build/bin/$target "$@" eval build $target && debug ~build/bin/$target "$@"
} }
# Interactively view CMake variables
.build-var() {
if [[ ! -n $build_dir ]]; then
build-dir
fi
local var=$(
cat $build_dir/CMakeCache.txt |
grep --color=never -Ex '^\w+:\w+=.*$' |
fzf --layout=reverse --info=hidden --border=rounded \
--cycle --height=50%
)
if [[ -n "$var" ]]; then
BUFFER="cmake -B\$build_dir -D$var"
zle end-of-line
fi
zle reset-prompt
}
zle -N .build-var
bindkey '^B' .build-var

View File

@ -148,22 +148,3 @@ fi
ls-iommu() { ls-iommu() {
$HOME/.config/zsh/ls-iommu.sh | sort -n $HOME/.config/zsh/ls-iommu.sh | sort -n
} }
# Fuzzy history search with fzf
function .fzf-history-search() {
local selected
selected=$(
cat $HISTFILE | # get entire history
sed 's/ *[0-9]* *//' | # remove cruft
awk '!seen[$0]++' | # remove duplicates
fzf --layout=reverse --tac --cycle --info=hidden \
--border=rounded --height=50%
)
if [[ -n "$selected" ]]; then
BUFFER="$selected"
zle end-of-line
fi
zle reset-prompt
}
zle -N .fzf-history-search
bindkey '^R' .fzf-history-search

22
zshrc
View File

@ -126,6 +126,9 @@ bindkey -M vicmd 'j' history-substring-search-down
bindkey -r '^[h' bindkey -r '^[h'
bindkey -M vicmd 'K' run-help bindkey -M vicmd 'K' run-help
# Disable Ex mode with ':'
bindkey -rM vicmd ':'
# Enable '<Shirt><Tab>' reverse order completions # Enable '<Shirt><Tab>' reverse order completions
bindkey '^[[Z' reverse-menu-complete bindkey '^[[Z' reverse-menu-complete
@ -143,6 +146,25 @@ if [[ `uname` = Linux ]]; then
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
fi fi
# Fuzzy history search with fzf
function fzf-history-search() {
local selected
selected=$(
cat $HISTFILE | # get entire history
sed 's/ *[0-9]* *//' | # remove cruft
awk '!seen[$0]++' | # remove duplicates
fzf --layout=reverse --tac --cycle --info=hidden \
--border=rounded --height=50%
)
if [[ -n "$selected" ]]; then
BUFFER="$selected"
zle end-of-line
fi
zle reset-prompt
}
zle -N fzf-history-search
bindkey '^R' fzf-history-search
# Enable changing cursor shape based on vi mode # Enable changing cursor shape based on vi mode
if [ "$ITERM_PROFILE" != "" ] && [ "$TMUX" = "" ]; then if [ "$ITERM_PROFILE" != "" ] && [ "$TMUX" = "" ]; then
# iTerm2 cursor shape escape sequences outside tmux # iTerm2 cursor shape escape sequences outside tmux