I saw this script yesterday and added this to my .bashrc
file:
nvims() {
items=("nvim" "nvim-chad" "nvim-lazy" "nvim-kickstart" "nvim-stan")
config=$(printf "%sn" "${items[@]}" | fzf --prompt=" Neovim Config "
--height=~50% --layout=reverse --border --exit-0 --no-preview --color="bg+:#a7c080,fg+:black,prompt:#7fbbb3")
if [[ -z $config ]]; then
echo "Nothing selected"
return 0
elif [[ $config == "nvim" ]]; then
config=""
fi
NVIM_APPNAME=$config nvim $@
echo $config >|~/.config/nvims
# echo "Has seleccionado $config"
}
# bind -x '"C-a": nvims'
alias nvim-chad="NVIM_APPNAME=nvim-chad nvim"
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"
alias nvim-kickstart="NVIM_APPNAME=nvim-kickstart nvim"
alias nvim-stan="NVIM_APPNAME=nvim-stan nvim"
alias nvim='NVIM_APPNAME=$(cat ~/.config/nvims) nvim'
export NVIM_APPNAME=$(cat ~/.config/nvims)
It works fine, but I cannot make it work with other programs like yazi because it uses EDITOR
as a variable, which makes more sense to me. I want to make EDITOR
to read this too, but I don’t know how. I tried adding at the end export EDITOR=$NVIM_APPNAME
and sourcing bashrc
again, but it doesn’t seem to work.
1