diff --git a/files/dotfiles/shellconfig/common.sh b/files/dotfiles/shellconfig/common.sh index a96c975..1e254e1 100644 --- a/files/dotfiles/shellconfig/common.sh +++ b/files/dotfiles/shellconfig/common.sh @@ -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}" diff --git a/files/dotfiles/vimrc b/files/dotfiles/vimrc index d2a8ac2..9336d1b 100644 --- a/files/dotfiles/vimrc +++ b/files/dotfiles/vimrc @@ -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 f Plug 'scrooloose/nerdtree' " NerdTree - File tree (ctr-n)