From bdc3c5377f969c3e8229f7587f67092573199539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fernando=20Carri=C3=B3n?= Date: Thu, 25 Nov 2021 12:26:00 +0100 Subject: [PATCH] update --- any/bash/.bashrc | 15 ++++++--------- any/vim/.vim/vimrc | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/any/bash/.bashrc b/any/bash/.bashrc index 4ce19d8..a13f24b 100644 --- a/any/bash/.bashrc +++ b/any/bash/.bashrc @@ -17,6 +17,7 @@ esac #### Shell Options #### ######################## +shopt -s extglob # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options @@ -37,19 +38,10 @@ if [ -d "$HOME/.pyenv" ]; then export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if command -v pyenv 1>/dev/null 2>&1; then - if ! shopt -q extglob - then - resetextglob=true - shopt -s extglob - fi if [[ "${OSTYPE%%+([[:digit:].])}" == "darwin" ]] then eval "$(pyenv init --path)" fi - if $resetextglob - then - shopt -u extglob - fi eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" fi @@ -66,6 +58,11 @@ then eval "`fnm completions --shell bash`" fi +if [[ -d "$HOME/.rbenv" ]] +then + eval "$(rbenv init - bash)" +fi + if [[ "$OSTYPE" == "linux-gnu"* && -f /etc/debian_version ]] then # if [ -d $HOME/.pyenv ] diff --git a/any/vim/.vim/vimrc b/any/vim/.vim/vimrc index 49f779c..c467dbc 100644 --- a/any/vim/.vim/vimrc +++ b/any/vim/.vim/vimrc @@ -16,7 +16,8 @@ Plug 'lepture/vim-jinja' Plug 'b4b4r07/vim-hcl' Plug 'hashivim/vim-packer' Plug 'hashivim/vim-terraform' -Plug 'scrooloose/nerdtree' +" Plug 'scrooloose/nerdtree' +Plug 'preservim/nerdtree' Plug 'PotatoesMaster/i3-vim-syntax' "Plug 'tpope/vim-surround' "Plugin 'jiangmiao/auto-pairs' @@ -227,6 +228,25 @@ let g:go_def_mapping_enabled = 0 " call neomake#configure#automake('nrwi', 500) +""" NERDtree +" nnoremap n :NERDTreeFocus +" nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :NERDTreeFind + +" Start NERDTree when Vim starts with a directory argument. +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | + \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif +" Exit Vim if NERDTree is the only window remaining in the only tab. +autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif +" Close the tab if NERDTree is the only window remaining in it. +autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif +" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. +autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | + \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif + + """ airline let g:airline_theme='powerlineish' " is a valid theme name let g:airline_powerline_fonts = 1