Skip to content

Instantly share code, notes, and snippets.

@goldblade
Last active September 5, 2020 16:10
Show Gist options
  • Select an option

  • Save goldblade/09d58ce2fd65cc0cc31c9843e5a98b14 to your computer and use it in GitHub Desktop.

Select an option

Save goldblade/09d58ce2fd65cc0cc31c9843e5a98b14 to your computer and use it in GitHub Desktop.
My .vimrc file
set nocompatible
set clipboard=unnamed
set backspace=indent,eol,start
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
:let mapleader = ","
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'vim-ruby/vim-ruby'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'davidhalter/jedi-vim'
Plugin 'w0rp/ale'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-rails'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'vim-vdebug/vdebug'
Plugin 'tjammer/blayu.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'slim-template/vim-slim.git'
Plugin 'mileszs/ack.vim'
Plugin 'mattn/emmet-vim'
Plugin 'luochen1990/rainbow'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'dracula/vim', { 'as': 'dracula' }
Bundle 'low-ghost/nerdtree-fugitive'
Plugin 'wakatime/vim-wakatime'
Plugin 'preservim/nerdcommenter'
Plugin 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plugin 'ternjs/tern_for_vim', { 'do': 'npm install' }
Plugin 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
Plugin 'neoclide/coc.nvim', {'branch': 'release'}
" Plugin 'ryanoasis/vim-devicons'
" Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
"Plugin 'vwxyutarooo/nerdtree-devicons-syntax'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
Plugin 'maxmellon/vim-jsx-pretty'
" Plugin 'leafgarland/typescript-vim'
" Plugin 'peitalin/vim-jsx-typescript'
"
" let g:coc_node_path = '/Users/eduardojr/.asdf/shims/node'
call vundle#end()
call togglebg#map("<F5>")
" set guifont=Fira\ Code\ Retina:h11
set guifont=Fira\ Code:h12
if has('gui_running')
set background=dark
" colorscheme solarized
color dracula
set t_Co=256
else
" colorscheme zenburn
" colors zenburn
color dracula
endif
if exists('g:is_vdebug_loaded')
finish
endif
" Set a special flag used only by this plugin for preventing doubly
" loading the script.
let g:is_vdebug_loaded = 1
"execute pathogen#infect()
autocmd vimenter * NERDTree
let python_highlight_all=1
" Rubycomplete {{{
autocmd FileType ruby set omnifunc=rubycomplete#Complete
let g:rubycomplete_rails=1
let g:rubycomplete_classes_in_global=1
let g:rubycomplete_buffer_loading=1
let g:rubycomplete_include_object=1
let g:rubycomplete_include_objectspace=1
" }}}
let g:python3_host_prog = '/Users/eduardojr/.asdf/shims/python3'
let g:python2_host_prog = '/usr/bin/python2'
" let g:loaded_python3_provider = 1
let g:loaded_python_provider = 0
" WEB DEVICONS
" let g:webdevicons_enable = 1
" let g:webdevicons_enable_nerdtree = 1
" autocmd FileType javascript set formatprg=prettier\ --stdin
" autocmd BufWritePre *.js :normal gggqG
" autocmd BufWritePre *.jsx :normal gggqG
"
let g:vdebug_options = {
\ 'debug_window_level' : 2,
\ 'debug_file_level': 2,
\ 'port' : 9000,
\ 'server' : '',
\ 'path_maps': {
\ '/myapp': '/Users/eduardojunior/projetos/fai/www/'
\ }
\}
syntax on
filetype plugin indent on
" coc.vim config
set hidden
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
autocmd CursorHold * silent call CocActionAsync('highlight')
" end coc.vim config
set omnifunc=syntaxcomplete#Complete
set number
au BufNewFile,BufRead *.py set tabstop=4
au BufNewFile,BufRead *.py set softtabstop=4
au BufNewFile,BufRead *.py set shiftwidth=4
au BufNewFile,BufRead *.py set textwidth=79
au BufNewFile,BufRead *.py set expandtab
au BufNewFile,BufRead *.py set autoindent
au BufNewFile,BufRead *.py set fileformat=unix
" rb files
au BufNewFile,BufRead *.rb set tabstop=2
au BufNewFile,BufRead *.rb set shiftwidth=2
" au bufnewfile,bufread *.rb set autoindent
au bufnewfile,bufread *.rb set textwidth=79
au bufnewfile,bufread *.rb set expandtab
" jsx files
au BufNewFile,BufRead *.jsx set tabstop=2
au BufNewFile,BufRead *.jsx set softtabstop=2
au BufNewFile,BufRead *.jsx set shiftwidth=2
au BufNewFile,BufRead *.jsx set textwidth=79
au BufNewFile,BufRead *.jsx set expandtab
au BufNewFile,BufRead *.jsx set autoindent
au BufNewFile,BufRead *.jsx set fileformat=unix
" js files
au BufNewFile,BufRead *.js set tabstop=2
au BufNewFile,BufRead *.js set softtabstop=2
au BufNewFile,BufRead *.js set shiftwidth=2
au BufNewFile,BufRead *.js set textwidth=79
au BufNewFile,BufRead *.js set expandtab
au BufNewFile,BufRead *.js set autoindent
au BufNewFile,BufRead *.js set fileformat=unix
" ts files
au BufNewFile,BufRead *.ts set tabstop=2
au BufNewFile,BufRead *.ts set softtabstop=2
au BufNewFile,BufRead *.ts set shiftwidth=2
au BufNewFile,BufRead *.ts set textwidth=79
au BufNewFile,BufRead *.ts set expandtab
au BufNewFile,BufRead *.ts set autoindent
au BufNewFile,BufRead *.ts set fileformat=unix
au BufNewFile,BufRead *.tsx set tabstop=2
au BufNewFile,BufRead *.tsx set softtabstop=2
au BufNewFile,BufRead *.tsx set shiftwidth=2
au BufNewFile,BufRead *.tsx set textwidth=79
au BufNewFile,BufRead *.tsx set expandtab
au BufNewFile,BufRead *.tsx set autoindent
au BufNewFile,BufRead *.tsx set fileformat=unix
autocmd BufNewFile,BufRead *.tsx set filetype=typescript.tsx
" vue files
au BufNewFile,BufRead *.vue set tabstop=2
au BufNewFile,BufRead *.vue set softtabstop=2
au BufNewFile,BufRead *.vue set shiftwidth=2
au BufNewFile,BufRead *.vue set textwidth=79
au BufNewFile,BufRead *.vue set expandtab
au BufNewFile,BufRead *.vue set autoindent
au BufNewFile,BufRead *.vue set fileformat=unix
" html files
au BufNewFile,BufRead *.html set tabstop=2
au BufNewFile,BufRead *.html set softtabstop=2
au BufNewFile,BufRead *.html set shiftwidth=2
au BufNewFile,BufRead *.html set textwidth=79
au BufNewFile,BufRead *.html set expandtab
au BufNewFile,BufRead *.html set autoindent
au BufNewFile,BufRead *.html set fileformat=unix
" php files
au BufNewFile,BufRead *.php set tabstop=2
au BufNewFile,BufRead *.php set softtabstop=2
au BufNewFile,BufRead *.php set shiftwidth=2
au BufNewFile,BufRead *.php set textwidth=79
au BufNewFile,BufRead *.php set expandtab
au BufNewFile,BufRead *.php set autoindent
au BufNewFile,BufRead *.php set fileformat=unix
au BufNewFile,BufRead *.phtml set tabstop=2
au BufNewFile,BufRead *.phtml set softtabstop=2
au BufNewFile,BufRead *.phtml set shiftwidth=2
au BufNewFile,BufRead *.phtml set textwidth=79
au BufNewFile,BufRead *.phtml set expandtab
au BufNewFile,BufRead *.phtml set autoindent
au BufNewFile,BufRead *.phtml set fileformat=unix
" erb files
au BufNewFile,BufRead *.erb set tabstop=2
au BufNewFile,BufRead *.erb set softtabstop=2
au BufNewFile,BufRead *.erb set shiftwidth=2
au BufNewFile,BufRead *.erb set textwidth=79
au BufNewFile,BufRead *.erb set expandtab
au BufNewFile,BufRead *.erb set autoindent
au BufNewFile,BufRead *.erb set fileformat=unix
au BufNewFile,BufRead *.coffee.erb set filetype=coffee
" slim files
au BufNewFile,BufRead *.slim set tabstop=2
au BufNewFile,BufRead *.slim set softtabstop=2
au BufNewFile,BufRead *.slim set shiftwidth=2
au BufNewFile,BufRead *.slim set textwidth=79
au BufNewFile,BufRead *.slim set expandtab
au BufNewFile,BufRead *.slim set autoindent
au BufNewFile,BufRead *.slim set fileformat=unix
au BufNewFile,BufRead *.slim setlocal filetype=slim
" scss files
au BufNewFile,BufRead *.scss set tabstop=2
au BufNewFile,BufRead *.scss set softtabstop=2
au BufNewFile,BufRead *.scss set shiftwidth=2
au BufNewFile,BufRead *.scss set textwidth=79
au BufNewFile,BufRead *.scss set expandtab
au BufNewFile,BufRead *.scss set autoindent
au BufNewFile,BufRead *.scss set fileformat=unix
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" 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)
set encoding=UTF-8
" Syntastic
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"silent! nmap <F6> :SyntasticToggleMode<CR>
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
" Eslint
"let g:syntastic_javascript_checkers=['eslint']
"let g:syntastic_javascript_eslint_exe='yarn lint'
"let g:syntastic_javascript_eslint_args=['--cache']
" let g:syntastic_javascript_eslint_exe = '[ -f $(npm bin)/eslint ] && $(npm bin)/eslint || eslint'
let b:ale_linters = ['eslint', 'flake8', 'pylint', 'pyflakes', 'remark-lint', 'tsserver', 'tslint']
let g:ale_completion_enabled = 1
let g:ale_sign_column_always = 1
let g:lightline = {
\ 'active': {
\ 'left': [['mode', 'paste' ], ['readonly', 'filename', 'modified']],
\ 'right': [['lineinfo'], ['percent'], ['fileformat', 'fileencoding']]
\ }
\ }
" Ag usage: ag string
let g:ackprg = 'ag --vimgrep'
" NERDTree Toogle
"let NERDTreeMapOpenInTab='<ENTER>'
map <C-o> :NERDTreeToggle<CR>
nnoremap <silent> <Leader>v :NERDTreeFind<CR>
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
" Clipboard
map <F2> :.w !pbcopy<CR><CR>
map <F3> :r !pbpaste<CR>
" Emmet
let g:user_emmet_mode='a'
let g:user_emmet_install_global = 0
autocmd FileType html,css,eruby,scss,less EmmetInstall
" Rainbow
let g:rainbow_active = 1
let g:rainbow_conf = {
\ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'],
\ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'],
\ 'operators': '_,_',
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
\ 'separately': {
\ '*': {},
\ 'tex': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'],
\ },
\ 'lisp': {
\ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'],
\ },
\ 'vim': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
\ },
\ 'html': {
\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold'],
\ },
\ 'javascript': {
\ 'parentheses': [['(',')'], ['\[','\]'], ['{','}']],
\ 'operators': '_,\|!\|>\|<\|>=\|<=\|===\|!==\|!=\|==\|&&\||_',
\ },
\ 'css': 0,
\ }
\}
" CtrlP
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/node_modules/* " MacOSX/Linux
" let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn|node_modules)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|node_modules|DS_Store)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" deoplete autocomplete
" let g:deoplete#enable_at_startup=1
" Set bin if you have many instalations
" let g:deoplete#sources#ternjs#tern_bin = '~/.vim/bundle/tern_for_vim/node_modules/tern/bin/tern'
" let g:deoplete#sources#ternjs#timeout = 1
if !exists('g:tern#command')
let g:tern#command = ["node", '~/.vim/bundle/tern_for_vim/node_modules/tern/bin/tern', '--no-port-file']
"" Use tern_for_vim.
let g:tern#arguments = ["--persistent"]
endif
" TypeScript colors
" light-grey
hi tsxTypeBraces guifg=#999999
" dark-grey
hi tsxTypes guifg=#666666
hi ReactState guifg=#C176A7
hi ReactProps guifg=#D19A66
hi WebBrowser ctermfg=204 guifg=#56B6C2
hi ReactLifeCycleMethods ctermfg=204 guifg=#D19A66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment