Skip to content

Commit

Permalink
gather fzf config, remove not working border, fzf npm run
Browse files Browse the repository at this point in the history
  • Loading branch information
torgeir committed Feb 10, 2024
1 parent 959c64b commit 46683fb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
24 changes: 24 additions & 0 deletions fzfrc
@@ -0,0 +1,24 @@
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --bind 'ctrl-k:kill-line' --bind='ctrl-j:accept'"
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --color=bg+:008,fg+:007,fg:007,hl+:009,hl:004,pointer:009,info:002"


# complete npm run
_fzf_complete_npm() {
if [[ "$@" == "npm run"* ]]; then
_fzf_complete -m --header-lines=1 --preview 'cat package.json | jq -er ".scripts | .$(echo {})"' -- "$@" < <(
cat package.json | jq -er '.scripts | keys? | sort | .[]'
)
fi
}


# complete env
_fzf_complete_env() {
if [[ "$@" == "env"* ]]; then
_fzf_complete -m \
--header-lines=1 \
--bind 'enter:become(echo \${1})' \
--delimiter '=' \
-- "$@" < <(env)
fi
}
4 changes: 1 addition & 3 deletions skhdrc
Expand Up @@ -25,6 +25,7 @@ alt - e [
]
alt - t [
"alacritty" ~ # transpose words
"intellij idea" ~ # conflicts with show type on extract variable
* : open -a Alacritty
]
alt - i : open -a Firefox
Expand Down Expand Up @@ -93,9 +94,6 @@ alt + shift - s : yabai -m window --toggle split
alt + shift - g : yabai -m window --insert east
alt + shift - v : yabai -m window --insert south

# turn of border when returning to default
:: default : yabai -m window --toggle border

# support throwing floated windows with limited size to the sides
fn - h : yabai -m window --grid 11:11:0:0:5:11
fn - l : yabai -m window --grid 11:11:6:0:5:11
Expand Down
3 changes: 2 additions & 1 deletion zsh/autoloads/rge
Expand Up @@ -3,6 +3,7 @@ fzf --bind "start:reload:rg --column --line-number --no-heading --color=always -
--bind "change:reload:rg --column --line-number --no-heading --color=always --smart-case {q} || true" \
--delimiter : \
--bind 'enter:become(emacsclient +{2}:{3} {1})' \
--ansi --disabled \
--ansi \
--disabled \
--layout=reverse \
--preview 'bat --color=always {1} --highlight-line {2}:{3}'
3 changes: 2 additions & 1 deletion zsh/autoloads/rgv
Expand Up @@ -3,6 +3,7 @@ fzf --bind "start:reload:rg --column --line-number --no-heading --color=always -
--bind "change:reload:rg --column --line-number --no-heading --color=always --smart-case {q} || true" \
--delimiter : \
--bind 'enter:become(vim "+call cursor({2},{3})" {1})' \
--ansi --disabled \
--ansi \
--disabled \
--layout=reverse \
--preview 'bat --color=always {1} --highlight-line {2}:{3}'
11 changes: 4 additions & 7 deletions zshrc
Expand Up @@ -304,10 +304,7 @@ fi

eval "$(direnv hook zsh)"

_fzf_complete_npm() {
if [[ "$@" == "npm run"* ]]; then
_fzf_complete -m --header-lines=1 --preview 'cat package.json | jq -er ".scripts | .$(echo {})"' -- "$@" < <(
cat package.json | jq -er '.scripts | keys? | sort | .[]'
)
fi
}
source $HOME/.fzfrc

PROMPT_COMMAND='echo -ne "\033]2;$(whoami)@$(hostname)\033\\"'
precmd() { eval "$PROMPT_COMMAND" }

0 comments on commit 46683fb

Please sign in to comment.