Skip to content

Instantly share code, notes, and snippets.

Last active June 18, 2022 19:44
Show Gist options
  • Save carvalhoviniciusluiz/81eb9223bfaf1478271faff94a507253 to your computer and use it in GitHub Desktop.
Save carvalhoviniciusluiz/81eb9223bfaf1478271faff94a507253 to your computer and use it in GitHub Desktop.
" Must come first because it changes other options
set nocompatible
" [vim-plug] Load plugins
call plug#begin()
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'junegunn/vim-easy-align'
Plug 'pangloss/vim-javascript' " JavaScript support
Plug 'leafgarland/typescript-vim' " TypeScript syntax
Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax
Plug 'jparise/vim-graphql' " GraphQL syntax
Plug 'neoclide/coc.nvim', {'branch': 'release'} " Code completions
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-endwise'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'janko-m/vim-test'
Plug 'rking/ag.vim'
Plug 'airblade/vim-gitgutter'
Plug 'ervandew/supertab'
Plug 'tomtom/tlib_vim' | Plug 'MarcWeber/vim-addon-mw-utils' | Plug 'honza/vim-snippets'
Plug 'w0rp/ale'
call plug#end()
" [vim-airline] Status bar settings
let g:airline_theme='dracula'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" CoC extensions
let g:coc_global_extensions = ['coc-tsserver']
let g:dracula_colorterm = 0
let g:dracula_italic = 0
syntax on
colorscheme dracula
color dracula
" [vim-test] Test runner settings
let test#strategy = 'dispatch'
let test#ruby#minitest#file_pattern = 'test_.*\.rb'
nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>l :TestLast<CR>
nmap <silent> <leader>g :TestVisit<CR>
" Remap keys for applying codeAction to the current line.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Personal settings
set cc=80 " Set rule to 80 columns
set showmode " Display the mode you're in
set hidden " Handle multiple buffers better
set wildmode=list:longest " Complete files like a shell
set ignorecase " Case-insensitive searching
set smartcase " But case-sensitive if expression contains a capital letter
set number " Show absolute line numbers (cf. relativenumber)
set hlsearch " Highlight matches
set list " Highlight unwanted spaces
set wrap " Turn on line wrapping
set shiftwidth=2 "
set tabstop=2 " Tabs and spaces
set expandtab "
set visualbell " No beeping
set nobackup " No backups
set nowritebackup " No backups
set noswapfile " No swap files; more hassle than they're worth
set undofile " Set persistent undo
set undodir=~/.vim/undo " Set .un~ files directory
set tildeop " Make tilde command behave like an operator
set shortmess=atI " Avoid unnecessary hit-enter prompts
set noequalalways " Resize windows as little as possible
set notimeout " Don't time out partially entered mapped key sequences
set ttimeout " But do time out key codes
set tags=.git/tags,tags " Look for tags in .git/
set clipboard=unnamed " Use OS clipboard by default
set cpo+=J " Two spaces delimit my sentences
set novisualbell
highlight ColorColumn ctermbg=8 guibg=lightgrey
" Remove trailing white space on write
autocmd BufWritePre * :%s/\s\+$//e
" Clear the search buffer when hitting return
nnoremap <CR> :nohlsearch<CR>
" Netrw
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 2
let g:netrw_altv = 1
let g:netrw_winsize = 30
" Ale
let g:ale_sign_error = '●' " Less aggressive than the default '>>'
let g:ale_sign_warning = '.'
let g:ale_lint_on_enter = 0 " Less distracting when opening a new file
Copy link

carvalhoviniciusluiz commented Nov 6, 2019

Install Plug Vim

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \

install Dracula

Plug 'dracula/vim', { 'as': 'dracula' }

Install Python Support

pip3 install --user pynvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment