Fix for vim fzf after the move to manually intalling fzf

Also added a `gitB` function for selecting branches from a list
This commit is contained in:
Sagi Dayan 2022-01-19 18:07:08 +02:00
parent 443f4b1c5e
commit 47b2c0f476
Signed by: sagi
GPG key ID: FAB96BFC63B46458
2 changed files with 15 additions and 0 deletions

View file

@ -38,6 +38,20 @@ export EDITOR=vim;
# Shell functions
############################################
function gitB() {
if [ -d ./.git ]; then
BRANCH=$(git branch -l | fzf --reverse --header="Select Branch to checkout")
if [ -z ${BRANCH} ]; then
echo Canceled
else
git ck ${BRANCH}
fi
else
echo "[ERROR]: Not in a git repository"
fi;
}
function huh() {
CURRENT_DIR=$(echo "${PWD##*/}")
TITLE="${1:=$CURRENT_DIR}"

View file

@ -21,6 +21,7 @@
Plug 'tpope/vim-fugitive' " git wrapper
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } " golang plugin for vim
Plug 'Yggdroot/indentLine' " Indentation LInes
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Install fzf
Plug 'junegunn/fzf.vim' " Fuzzy search
Plug 'francoiscabrol/ranger.vim' " Ranger <leader>f
Plug 'scrooloose/nerdtree' " NerdTree - File tree (ctr-n)