Skip to content

Instantly share code, notes, and snippets.

@maxsuelmarinho
Last active April 16, 2023 00:24
Show Gist options
  • Save maxsuelmarinho/ab46527e88b4fc1b41059dff1d466fe2 to your computer and use it in GitHub Desktop.
Save maxsuelmarinho/ab46527e88b4fc1b41059dff1d466fe2 to your computer and use it in GitHub Desktop.
Vim + Golang + NerdTree + dracula theme
" 1 - Create a ~/.vimrc file with this content:
" 2 - Plugin manager: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" 3 - Install plugins: vim +PlugInstall
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'SirVer/ultisnips'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'editorconfig/editorconfig-vim'
Plug 'dracula/vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
call plug#end()
"*****************************************************************************
" visual settings
"*****************************************************************************
syntax on
set ruler
set number
color dracula " turn-on dracula color scheme
"****************************************************************************
" go-vim settings
"****************************************************************************
let g:go_fmt_command = "goimports"
" Status line types/signatures.
let g:go_auto_type_info = 1
" autocomplete prompt to appear automatically whenever you press the dot (.)
au filetype go inoremap <buffer> . .<C-x><C-o>
"****************************************************************************
" NERDTree settings
"****************************************************************************
let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite
nnoremap <silent> <F2> :NERDTreeFind<CR>
noremap <F3> :NERDTreeToggle<CR>
"" set shortcut for open Nerdtree
map <C-n> :NERDTreeToggle<CR>
"" Make Nerdtree show .files by default
let NERDTreeShowHidden=1
"****************************************************************************
" vim-airline settings
"****************************************************************************
let g:airline_theme = 'powerlineish'
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
let g:airline_skip_empty_sections = 1
"****************************************************************************
" snippets settings
"****************************************************************************
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
"****************************************************************************
" git settings
"****************************************************************************
noremap <Leader>ga :Gwrite<CR>
noremap <Leader>gc :Gcommit<CR>
noremap <Leader>gsh :Gpush<CR>
noremap <Leader>gll :Gpull<CR>
noremap <Leader>gs :Gstatus<CR>
noremap <Leader>gb :Gblame<CR>
noremap <Leader>gd :Gvdiff<CR>
noremap <Leader>gr :Gremove<CR>
" Open current line on GitHub
nnoremap <Leader>o :.Gbrowse<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment