Skip to content

Instantly share code, notes, and snippets.

@buncis
Last active August 6, 2021 11:33
Show Gist options
  • Save buncis/584e7014f08e8e129f0593f3b3ba5010 to your computer and use it in GitHub Desktop.
Save buncis/584e7014f08e8e129f0593f3b3ba5010 to your computer and use it in GitHub Desktop.
terminal config
if-shell "test -f ~/.tmux-status.conf" "source ~/.tmux-status.conf"
set -g default-terminal "xterm-256color"
set -g mouse on
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
" plugin
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'edkolev/tmuxline.vim'
Plug 'glepnir/oceanic-material'
Plug 'mhartington/oceanic-next'
Plug 'morhetz/gruvbox'
call plug#end()
" hotkey
map <C-b> :NERDTreeToggle<CR>
" meta config
set tabstop=2 shiftwidth=2 expandtab "tab use spaces
if (has("termguicolors")) "set full colors
set termguicolors
endif
set path+=**
set wildignore+=**/node_modules/** "ignore in fuzzy search
syntax on
set number
set clipboard=unnamed
set background=dark
colorscheme oceanic_material
let g:airline_theme='oceanicnext'
if has("gui_running")
autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE "transparent vim and
autocmd vimenter * hi EndOfBuffer guibg=NONE ctermbg=NONE "end of buffer
endif
" airline
let g:airline#extensions#tmuxline#enabled = 1
let airline#extensions#tmuxline#snapshot_file = "~/.tmux-status.conf"
" ctrlp
" ctrlp with steroid | faster
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
if executable('ag')
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
" nerdtree
" auto open if no files specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment