Last active
June 26, 2020 06:42
-
-
Save vinchi777/ef0261a51e0c9c4f957b6fe4e8f9cb9e to your computer and use it in GitHub Desktop.
Nvim config
This file contains 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
set nocompatible " be iMproved, required | |
filetype off " required | |
call plug#begin('~/.vim/plugged') | |
" let Vundle manage Vundle, required | |
" Plug 'gmarik/Vundle.vim' | |
" Color schemes | |
Plug 'phanviet/vim-monokai-pro' | |
"Plug 'liuchengxu/space-vim-dark' | |
Plug 'dracula/vim' | |
"Plug 'morhetz/gruvbox' | |
Plug 'chriskempson/base16-vim' | |
Plug 'joshdick/onedark.vim' | |
"Plug 'flrnprz/candid.vim' | |
Plug 'Rigellute/shades-of-purple.vim' | |
Plug 'tpope/vim-rhubarb' | |
Plug 'rakr/vim-one' | |
Plug 'nightsense/strawberry' | |
"Plug 'ksevelyar/joker.vim' | |
Plug 'edkolev/tmuxline.vim' | |
Plug 'nightsense/snow' | |
Plug 'arzg/vim-colors-xcode' | |
" Editor Extensions | |
"Plug 'SirVer/ultisnips' | |
Plug 'mhinz/vim-startify' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'jiangmiao/auto-pairs' | |
Plug '/usr/local/opt/fzf' | |
Plug 'junegunn/fzf.vim' | |
Plug 'honza/vim-snippets' | |
Plug 'tpope/vim-sensible' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-fugitive' | |
Plug 'voldikss/vim-floaterm' | |
Plug 'mileszs/ack.vim' | |
Plug 'slim-template/vim-slim' | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'tpope/vim-ragtag' | |
Plug 'sbdchd/neoformat' | |
Plug 'shumphrey/fugitive-gitlab.vim' | |
"Plug 'leafgarland/typescript-vim' | |
Plug 'alvan/vim-closetag' | |
"Plug 'w0rp/ale' | |
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}} | |
Plug 'scrooloose/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'tiagofumo/vim-nerdtree-syntax-highlight' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'mhinz/vim-signify' | |
" Languages | |
"Plug 'sheerun/vim-polyglot' | |
Plug 'groenewege/vim-less' | |
Plug 'pangloss/vim-javascript' | |
Plug 'maxmellon/vim-jsx-pretty' | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'storyn26383/vim-vue' | |
Plug 'digitaltoad/vim-pug' | |
Plug 'fatih/vim-go', { 'for': 'go' } | |
"Plug 'posva/vim-vue' | |
call plug#end() | |
"filetype on | |
"filetype plugin indent on " required | |
"set expandtab | |
"set autoindent | |
"set smartindent | |
" map escape | |
imap jj <esc> | |
" resize windows | |
map <C-J> <C-W>j<C-W>_ | |
map <C-K> <C-W>k<C-W>_ | |
" map paste toggle | |
set pastetoggle=<F2> | |
" show line numbers | |
set number | |
" trailing whitespace | |
set listchars=tab:\ \ ,trail:~,extends:> | |
set list | |
"FUGITIVE | |
let g:fugitive_gitlab_domains = ['https://my.gitlab.com'] | |
" map nerdtree toggle | |
nmap 9i :NERDTreeToggle<CR> | |
let g:WebDevIconsUnicodeDecorateFolderNodes = 1 | |
let NERDTreeMinimalUI=1 | |
set splitright | |
" no swapfile | |
set noswapfile | |
" map autocompletion | |
inoremap <Nul> <C-n> | |
"auto copy to clipboard | |
"set clipboard=unnamedplus | |
"remove trailing whitespace | |
nnoremap <silent> dt :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> | |
nnoremap <CR> :noh<CR><CR> | |
" INDENTING | |
autocmd BufNewFile,BufReadPost *.html.erb,*.html setl shiftwidth=2 expandtab | |
autocmd BufNewFile,BufReadPost *.vue,*.php setl shiftwidth=4 expandtab | |
autocmd BufNewFile,BufReadPost *.go setl shiftwidth=4 tabstop=4 noexpandtab | |
autocmd BufNewFile,BufReadPost *.js,*.ts,*.tsx setl shiftwidth=2 expandtab | |
autocmd BufNewFile,BufReadPost *.css,*.scss setl shiftwidth=2 | |
autocmd FileType yaml setl shiftwidth=2 expandtab | |
" set filetypes as typescript.tsx | |
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx | |
" vim-closetag | |
let g:closetag_filenames = '*.html,*.js,*.vue,*.html.erb,*.tsx' | |
" COC | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | |
" Golang | |
"let g:go_def_mode='gopls' | |
let g:go_info_mode='gopls' | |
let g:go_doc_keywordprg_enabled = 0 | |
"autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif | |
set signcolumn=yes | |
nmap <silent>gd <Plug>(coc-definition) | |
nmap <leader>hf <Plug>(coc-float-hide) | |
inoremap <silent><expr> <c-space> coc#refresh() | |
" Use K to show documentation in preview window | |
nnoremap <silent>K :call CocAction('doHover')<CR> | |
" FORMATTING | |
nmap <leader>qf <Plug>(coc-fix-current) | |
command! -nargs=0 Format :call CocAction('format') | |
command! -nargs=0 FormatJS :CocCommand eslint.executeAutofix | |
command! -nargs=0 FormatTS :CocCommand tslint.fixAllProblems | |
"set shortmess+=c | |
"set cmdheight=2 | |
let g:airline_section_error = '%{airline#util#wrap(airline#extensions#coc#get_error(),0)}' | |
let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' | |
"let g:airline_section_info = '%{airline#util#wrap(airline#extensions#coc#get_info(),0)}' | |
"let g:shades_of_purple_airline = 1 | |
"let g:airline_theme='shades_of_purple' | |
let g:airline_theme='light' | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#fnamemod = ':t' | |
let g:airline#extensions#tabline#show_buffers=2 | |
set colorcolumn=80 | |
"Ack | |
nmap <D-S-F> :Ack<space> | |
" use the silver searcher in Ack | |
let g:ackprg = 'ag --nogroup --nocolor --column' | |
" Startify | |
let g:startify_files_number = 4 | |
let g:startify_padding_left = (&columns - (&columns/2)) - 30 | |
let g:startify_enable_special = 1 | |
let g:startify_change_to_dir = 0 | |
autocmd User Startified setlocal buflisted | |
" Simplify the startify list to just recent files and sessions | |
let g:startify_lists = [ | |
\ { 'type': 'dir', 'header': startify#pad(['Recent files']) }, | |
\ { 'type': 'sessions', 'header': startify#pad(['Saved sessions']) }, | |
\ ] | |
" Fancy custom header | |
let g:startify_custom_header = startify#center([ | |
\ " ", | |
\ " ", | |
\ " ", | |
\ " ", | |
\ " ", | |
\ ' ╻ ╻ ╻ ┏┳┓', | |
\ ' ┃┏┛ ┃ ┃┃┃', | |
\ ' ┗┛ ╹ ╹ ╹', | |
\ ' ', | |
\ ' ', | |
\ ' ', | |
\ ]) | |
" Customize fzf colors to match your color scheme | |
" 'hl': ['fg', 'PreProc'], | |
"\ 'hl': ['fg', 'PreProc'], | |
let g:fzf_colors = | |
\ { 'fg': ['fg', 'Normal'], | |
\ 'bg': ['bg', 'Normal'], | |
\ 'hl': ['fg', 'Identifier'], | |
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], | |
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], | |
\ 'hl+': ['fg', 'Identifier'], | |
\ 'info': ['fg', 'Comment'], | |
\ 'border': ['fg', 'Ignore'], | |
\ 'prompt': ['fg', 'Conditional'], | |
\ 'pointer': ['fg', 'Exception'], | |
\ 'marker': ['fg', 'Keyword'], | |
\ 'spinner': ['fg', 'Label'], | |
\ 'header': ['fg', 'Comment'] } | |
let $FZF_DEFAULT_COMMAND = 'ag -g ""' | |
let g:fzf_action = { | |
\ 'B': 'bd|e'} | |
nnoremap <silent> <C-p> :Files<CR> | |
nnoremap <silent> <C-l> :Buffers<CR> | |
nnoremap <C-s> :Ag | |
" Change Ag list color and show preview | |
autocmd VimEnter * command! -nargs=* Ag call fzf#vim#ag(<q-args>, '--color-path 400 --color-line-number 400', fzf#vim#with_preview()) | |
" Floaterm | |
let g:floaterm_width= float2nr(&columns - (&columns * 2 / 10)) | |
let g:floaterm_position='center' | |
let g:floaterm_keymap_toggle = '<C-x>' | |
set hidden " Floaterm work without clearing session | |
"BUFFERS | |
nnoremap qq :w\|bd<cr> | |
autocmd BufEnter *.png,*.jpg,*gif exec "! open ".expand("%") | :bw | |
" buffer navigation | |
" map gr gT | |
nmap gt :bnext<CR> | |
nmap gr :bprevious<CR> | |
" COLOR THEMES | |
" | |
set t_Co=256 | |
"set background=light | |
"set background=dark | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
syntax on "load polyglot language packs | |
syntax enable | |
"colorscheme base16-tomorrow | |
"colorscheme dracula | |
"colorscheme candid | |
"colorscheme monokai_pro | |
"colorscheme shades_of_purple | |
"colorscheme joker | |
"colorscheme onedark | |
"colorscheme one | |
"colorscheme strawberry-light | |
"colorscheme space-vim-dark | |
"colorscheme gruvbox | |
colorscheme xcodelight | |
"highlight Normal ctermbg=NONE | |
"highlight nonText ctermbg=NONE | |
"Only underline search results | |
"highlight Search guibg='#f0dde6' guifg='#d4ac35' gui=underline | |
"hi CocErrorSign ctermfg=Red guifg=#d46a84 guibg=#f0dde6 | |
"hi CocWarningSign ctermfg=Brown guifg=#b56f45 guibg=#f0dde6 | |
"hi CocInfoSign ctermfg=Yellow guifg=#ab8e38 guibg=#f0dde6 | |
"hi CocHintSign ctermfg=Blue guifg=#557b9e guibg=#f0dde6 | |
" floatwindow colors | |
"highlight Pmenu ctermbg=141 guibg=Grey82 | |
" Floaterm theme | |
"hi FloatermNF guibg=#f0dded | |
hi FloatermBorderNF guibg=#f6f8fa | |
"au ColorScheme monokai_pro hi Normal ctermbg=None | |
"hi Normal ctermbg=LightMagenta ctermfg=Black guifg=Black guibg=LightMagenta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment