From f6299e11e44cc8c1c729dbe04e4e8330947d1f32 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Tue, 14 Feb 2023 00:13:10 +0100 Subject: [PATCH] fix fzf --- README.md | 1 - roles/bash/files/bashrc | 8 ++------ roles/bash/files/fzf.bash | 21 ++++----------------- roles/bash/tasks/main.yml | 6 +----- 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 09c8b15..5420466 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ My current setup is [Regolith OS](https://regolith-desktop.com/) which is basica - thunderbird config - some kind of tag setup with: bootstrap, update, etc. - i3 app shortcuts -- install fzf from repositories instead of git Would like Ansible Vault to check in keypair for syncthing. However, then I would need a password to unlock the vault. diff --git a/roles/bash/files/bashrc b/roles/bash/files/bashrc index 9fb6650..04dcfbd 100644 --- a/roles/bash/files/bashrc +++ b/roles/bash/files/bashrc @@ -45,12 +45,8 @@ if [[ $iatest > 0 ]]; then bind "set completion-ignore-case on"; fi if [[ $iatest > 0 ]]; then bind "set show-all-if-ambiguous On"; fi # Set the default editor -export EDITOR=nano -export VISUAL=nano -alias pico='edit' -alias spico='sedit' -alias nano='edit' -alias snano='sedit' +export EDITOR=vi +export VISUAL=vi # To have colors for ls and all grep commands such as grep, egrep and zgrep export CLICOLOR=1 diff --git a/roles/bash/files/fzf.bash b/roles/bash/files/fzf.bash index 70ccce7..39d3587 100644 --- a/roles/bash/files/fzf.bash +++ b/roles/bash/files/fzf.bash @@ -1,6 +1,4 @@ -export FZF_DEFAULT_COMMAND=ag - -export FZF_COMPLETION_TRIGGER='**' +export FZF_DEFAULT_COMMAND=fd # Options to fzf command export FZF_COMPLETION_OPTS='--border --info=inline' @@ -10,7 +8,7 @@ export FZF_COMPLETION_OPTS='--border --info=inline' # - The first argument to the function ($1) is the base path to start traversal # - See the source code (completion.{bash,zsh}) for the details. _fzf_compgen_path() { - fdfind --hidden --follow --exclude ".git" . "$1" + fdfind --type file --hidden --follow --exclude ".git" . "$1" } # Use fd to generate the list for directory completion @@ -33,16 +31,5 @@ _fzf_comprun() { esac } -# Setup fzf -# --------- -if [[ ! "$PATH" == *~/repos/fzf/bin* ]]; then - PATH="${PATH:+${PATH}:}~/repos/fzf/bin" -fi - -# Auto-completion -# --------------- -[[ $- == *i* ]] && source "~/repos/fzf/shell/completion.bash" 2> /dev/null - -# Key bindings -# ------------ -source "~/repos/fzf/shell/key-bindings.bash" +source /usr/share/doc/fzf/examples/key-bindings.bash +source /usr/share/bash-completion/completions/fzf diff --git a/roles/bash/tasks/main.yml b/roles/bash/tasks/main.yml index f74c642..10cc1fe 100644 --- a/roles/bash/tasks/main.yml +++ b/roles/bash/tasks/main.yml @@ -4,15 +4,11 @@ pkg: - fd-find - bat + - fzf - name: Install .bashrc copy: src: "{{ role_path }}/files/bashrc" dest: ~/.bashrc -- name: Install fzf - git: - repo: https://github.com/junegunn/fzf.git - dest: ~/repos/fzf - depth: 1 - name: Install .fzf.bash copy: src: "{{ role_path }}/files/fzf.bash"