Created
November 14, 2019 18:42
-
-
Save JeffersonCarvalh0/4a13f5dbb34ff543484eec7c0fef16b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin() | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'leafgarland/typescript-vim' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'reasonml-editor/vim-reason-plus' | |
Plug 'hzchirs/vim-material' | |
Plug 'scrooloose/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'peitalin/vim-jsx-typescript' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-fugitive' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'mhinz/vim-startify' | |
Plug 'dart-lang/dart-vim-plugin' | |
Plug 'airblade/vim-rooter' | |
Plug 'tpope/vim-commentary' | |
Plug 'OmniSharp/omnisharp-vim' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' } | |
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=80 | |
set autoread | |
set nowrap | |
set ignorecase | |
set encoding=UTF-8 | |
colorscheme vim-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 | |
autocmd FileType ocaml setlocal commentstring=(*%s*) | |
" 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() | |
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR> | |
" Apply macro over multiple lines | |
function! ExecuteMacroOverVisualRange() | |
echo "@".getcmdline() | |
execute ":'<,'>normal @".nr2char(getchar()) | |
endfunction | |
" coc.vim settings | |
" if hidden is not set, TextEdit might fail. | |
set hidden | |
" Some servers have issues with backup files, see #649 | |
set nobackup | |
set nowritebackup | |
" Better display for messages | |
set cmdheight=2 | |
" You will have bad experience for diagnostic messages when it's default 4000. | |
set updatetime=300 | |
" don't give |ins-completion-menu| messages. | |
set shortmess+=c | |
" always show signcolumns | |
set signcolumn=yes | |
" Use <c-space> to trigger completion. | |
inoremap <silent><expr> <c-space> coc#refresh() | |
" Use K to show documentation in preview window | |
nnoremap <silent> K :call <SID>show_documentation()<CR> | |
function! s:show_documentation() | |
if (index(['vim','help'], &filetype) >= 0) | |
execute 'h '.expand('<cword>') | |
else | |
call CocAction('doHover') | |
endif | |
endfunction | |
" Highlight symbol under cursor on CursorHold | |
autocmd CursorHold * silent call CocActionAsync('highlight') | |
" End coc.vim settings | |
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_style='palenight' | |
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:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' | |
let $FZF_DEFAULT_COMMAND='rg -i --hidden --files' | |
let g:OmniSharp_server_stdio = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment