Skip to content

Instantly share code, notes, and snippets.

@haskellcamargo
Created October 21, 2019 01:03
Show Gist options
  • Save haskellcamargo/6e658c8f5d4584bb0763da7b30ec9eb6 to your computer and use it in GitHub Desktop.
Save haskellcamargo/6e658c8f5d4584bb0763da7b30ec9eb6 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Nerdtree
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
" Start screen
Plugin 'mhinz/vim-startify'
" Airline
Plugin 'vim-airline/vim-airline'
" Git
Plugin 'tpope/vim-fugitive'
" Syntax checker
" Statistics
Plugin 'wakatime/vim-wakatime'
" Colorschemes
Plugin 'joshdick/onedark.vim'
Plugin 'morhetz/gruvbox'
" Language pack
Plugin 'sheerun/vim-polyglot'
" Navigate in the files
Plugin 'ctrlpvim/ctrlp.vim'
" Icons
Plugin 'ryanoasis/vim-devicons'
" Trailing whitespace
Plugin 'bronson/vim-trailing-whitespace'
" Cucumber support
Plugin 'tpope/vim-cucumber'
call vundle#end()
" Use custom separator for inner windows
set fillchars=vert:│
filetype plugin indent on
syntax enable
" i18n and charset
let lang='en'
set langmenu=en
set encoding=utf8
set ffs=unix,dos,mac
" Ignored folders
set wildignore+=*/node_modules/*,*/dist/*,*/public/*,coverage
" Mouse support
if has('mouse')
set mouse=a
endif
" Improve editing and searching
set backspace=eol,start,indent
set ignorecase
set smartcase
set hlsearch
set incsearch
set showmatch
set ai
set si
set wrap
set magic
set history=500
set so=0
set wildmenu
set ruler
set lbr
set tw=500
set nu
set numberwidth=5
set conceallevel=1
" Avoid creating temporary files
set nobackup
set nowb
set noswapfile
" Convert tabs to spaces
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
" Make arrows work
set ww+=<,>
" Color system and scheme
set t_Co=256
set termguicolors
let g:gruvbox_termcolors = 256
colorscheme gruvbox
set background=dark
" Airline
let g:airline_powerline_fonts = 1
let g:airline_theme = 'gruvbox'
" Highlight current line number
set cursorline
let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype', '%p%%'])
let g:airline_section_z = airline#section#create(["\uE0A1" . '%{line(".")}' . " \uE0A3" . '%{col(".")}'])
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#syntastic#error_symbol = "\u2717"
let g:airline#extensions#syntastic#warning_symbol = "\uf071"
let g:airline#extensions#syntastic#stl_format_err = ' %e'
let g:airline#extensions#syntastic#stl_format_warn = ' %w'
" Nerdtree
" Ensure NERDTree is open
function! s:isOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" Reveal NERDTree file on open it
function! s:reveal()
if &modifiable && s:isOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction
autocmd VimEnter * if !argc() | Startify | NERDTree | wincmd w | endif
autocmd BufEnter * call s:reveal()
autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeMinimalUI = 1
let g:nerdtree_tabs_open_on_console_startup = 1
let g:NERDTreeIgnore = ['node_modules', 'public', 'coverage', 'target']
hi NERDTreeOpenable guifg=#27CBC0
hi NERDTreeClosable guifg=#DA3C78
let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '
let g:WebDevIconsNerdTreeBeforeGlyphPadding = ''
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment