Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fzf #49

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chezmoiexternal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
exact: true
stripComponents: 1
refreshPeriod: "168h"
# fzf
".fzf":
type: "archive"
url: "https://github.com/junegunn/fzf/archive/master.tar.gz"
exact: true
stripComponents: 1
refreshPeriod: "168h"
# vim plugin manager
".vim/autoload/plug.vim":
type: "file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ brew tap homebrew/cask-fonts
"brew-cask-completion"
"cheat"
"chezmoi"
"colordiff"
"ctags"
"dockutil"
"eza"
"fzf"
"fd"
"gh"
"git"
"git-delta"
Expand Down Expand Up @@ -46,4 +47,8 @@ brew "{{ . }}"
cask "{{ . }}"
{{- end }}
EOF

# Complete fzf installation
$(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc

{{ end }}
8 changes: 4 additions & 4 deletions .chezmoiscripts/linux/run_onchange_before_10_installs.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ packages=(
"colordiff"
"direnv"
"expect" # needed to set shell on Parrot
"fzf"
"fd-find"
"gh"
"git"
"gpg"
Expand All @@ -38,12 +38,12 @@ packages=(
"xclip"
)

# security only packages
# security only packages - kali only
# this separate list helps with Github CI to pass
{{ if or (eq .osid "linux-kali") (eq .osid "linux-parrot") }}
# not doing this on parrot because all it does is complain
{{ if eq .osid "linux-kali" }}

sec_packages=(
"burpsuite"
"gobuster"
"seclists"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cat <<EOF >> "$DOTFILES/system/linux.zsh"
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias bat='batcat'
alias fd='fdfind'
EOF

{{- end -}}
15 changes: 15 additions & 0 deletions .chezmoiscripts/run_after_fzf_install.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and (eq .chezmoi.os "darwin" "linux") -}}
#!/usr/bin/env bash
set -eufo pipefail

if [ -d "$HOME/.fzf" ]; then
"$HOME"/.fzf/install --key-bindings --completion --no-update-rc
EXIT_STATUS="$?"
else
echo "WARNING: fzf not installed!!!"
EXIT_STATUS=1
fi

exit "$EXIT_STATUS"

{{- end -}}
2 changes: 1 addition & 1 deletion .chezmoiversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.40.2
2.42.1
9 changes: 7 additions & 2 deletions fzf/exports.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export FZF_DEFAULT_COMMAND="git ls-files --cached --others --exclude-standard |
export FZF_CTRL_T_COMMAND="fd $FD_OPTIONS"
export FZF_ALT_C_COMMAND="fd --type d $FD_OPTIONS"

export BAT_PAGER="less -R"

# On Linux, we need fdfind instead of fd and batcat instead of bat.
if [[ "$(uname)" == "Linux" ]]; then
export FZF_DEFAULT_OPTS="--no-mouse --height 90% -1 --reverse --multi --inline-info --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (batcat --style=numbers --color=always {} || cat {}) 2> /dev/null | head -300'"
export FZF_DEFAULT_COMMAND="git ls-files --cached --others --exclude-standard | fdfind --type f --type l $FD_OPTIONS"
export FZF_CTRL_T_COMMAND="fdfind $FD_OPTIONS"
export FZF_ALT_C_COMMAND="fdfind --type d $FD_OPTIONS"
fi
1 change: 1 addition & 0 deletions system/exports.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export BAT_PAGER="less -R"
65 changes: 0 additions & 65 deletions zsh/zshrc

This file was deleted.