Skip to content

Instantly share code, notes, and snippets.

@JeffersonCarvalh0
Created June 6, 2019 20:45
Show Gist options
  • Save JeffersonCarvalh0/fb180dd36d9f5b5da9186b505d1ae5a4 to your computer and use it in GitHub Desktop.
Save JeffersonCarvalh0/fb180dd36d9f5b5da9186b505d1ae5a4 to your computer and use it in GitHub Desktop.
call plug#begin()
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'kaicataldo/material.vim'
Plug 'mhinz/vim-startify'
Plug 'dart-lang/dart-vim-plugin'
Plug 'natebosch/vim-lsc'
Plug 'airblade/vim-rooter'
Plug 'tpope/vim-commentary'
Plug 'reasonml-editor/vim-reason-plus'
Plug '~/.fzf'
call plug#end()
set number
set autoindent
set smarttab
set smartindent
set showmatch
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set completeopt-=preview
set background=dark
set termguicolors
set cursorline
set colorcolumn=120
set autoread
set nowrap
set ignorecase
colorscheme material
autocmd vimenter * NERDTree
autocmd vimenter * 2wincmd w
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
" Check if NERDTree is open or active
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
" file, and we're not in vimdiff
function! SyncTree()
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction
" Highlight currently open buffer in NERDTree
autocmd BufEnter * call SyncTree()
map <C-s> :w<CR>
map <C-\> :NERDTreeToggle<CR>
map <C-p> :FZF<CR>
map <C-x> dd
nnoremap <C-Up> :m-2<CR>
nnoremap <C-Down> :m+<CR>
inoremap <C-Up> <Esc>:m-2<CR>
inoremap <C-Down> <Esc>:m+<CR>
cmap w!! w !sudo tee > /dev/null %
let g:fzf_action = { 'enter': 'vsplit' }
let g:airline_powerline_fonts = 1
let g:airline_theme='material'
let g:material_theme_style='dark'
let g:startify_session_persistence = 1
let g:startify_session_autoload = 1
let dart_html_in_string=v:true
let dart_corelib_highlight=v:true
let g:lsc_server_commands = {'dart': 'dart_language_server'}
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
let $FZF_DEFAULT_COMMAND='rg -i --hidden --files'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment