-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc.marcelo
74 lines (60 loc) · 2.08 KB
/
.bashrc.marcelo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# ft=sh
# If you come from bash you might have to change your $PATH.
export PATH=/usr/local/bin:$HOME/bin:/usr/local/bin:$HOME/.local/bin:$PATH
export PATH=$HOME/Tools/fzf/bin:$PATH
export PATH=$HOME/Tools/neovim/bin:$PATH
export PATH=$HOME/go/bin:$PATH
export PATH=$HOME/scripts/:$PATH
export EDITOR=nvim
[ -f ~/.fzf.zsh ] && source ~/.fzf.bash
source $HOME/.dotfiles/.plugins/fzf-tab-completion/bash/fzf-bash-completion.sh
# Set up fzf key bindings and fuzzy completion
if command -v fzf >/dev/null 2>&1; then
eval "$(fzf --bash)"
fi
# # eval "$(fzf --bash)"
#
# -- Use fd instead of fzf --
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'"
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
# Use fd (https://github.com/sharkdp/fd) for listing path candidates.
# - 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() {
fd --hidden --exclude .git . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
#
if command -v starship >/dev/null 2>&1; then
eval "$(starship init bash)"
fi
if [[ "$(which cargo)" != "cargo not found" ]]; then
. "$HOME/.cargo/env"
fi
if command -v direnv >/dev/null 2>&1; then
eval "$(direnv hook bash)"
fi
if command -v zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash)"
fi
if command -v uv >/dev/null 2>&1; then
eval "$(uv generate-shell-completion bash)"
fi
if command -v yazi >/dev/null 2>&1; then
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
fi
[ -f ~/.aliases ] && source ~/.aliases
bind -x "\"\t\": fzf_bash_completion"