if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif call plug#begin() Plug 'tpope/vim-repeat' Plug 'tpope/vim-commentary' Plug 'tpope/vim-surround' Plug 'jiangmiao/auto-pairs' Plug 'yggdroot/indentline' Plug 'kien/ctrlp.vim' Plug 'mbbill/undotree' Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' Plug 'vim-airline/vim-airline' " style Plug 'sonph/onehalf', { 'rtp': 'vim' } " js/ts/... Plug 'pangloss/vim-javascript' Plug 'leafgarland/typescript-vim' Plug 'peitalin/vim-jsx-typescript' " html Plug 'mattn/emmet-vim' Plug 'neoclide/coc.nvim', {'branch': 'release'} let g:coc_global_extensions = [ \ 'coc-tsserver', \ 'coc-html', \ 'coc-json', \ 'coc-pyright', \ 'coc-rust-analyzer' \ ] call plug#end() " snippets let g:UltiSnipsExpandTrigger="" " coc if isdirectory('./node_modules') && isdirectory('./node_modules/prettier') let g:coc_global_extensions += ['coc-prettier'] endif " disabled eslint in favor of xo if isdirectory('./node_modules') && isdirectory('./node_modules/eslint') let g:coc_global_extensions += ['coc-eslint'] endif " coc shortcuts inoremap y coc#pum#visible() ? coc#pum#confirm() : "\" nnoremap gK :call CocAction('doHover') nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gr (coc-references) nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) nnoremap d :CocList diagnostics nnoremap s :CocList -I symbols nmap do (coc-codeaction) nmap rn (coc-rename) nmap xo :!npx xo --fix % let g:ctrlp_custom_ignore = 'node_modules' if has("persistent_undo") let target_path = expand('~/.vimundo') " create the directory and any parent directories " if the location does not exist. if !isdirectory(target_path) call mkdir(target_path, "p", 0700) endif let &undodir=target_path set undofile endif " style if exists('+termguicolors') let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors endif syntax on autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ set t_Co=256 colorscheme onehalfdark let g:airline_theme='onehalfdark' let g:lightline = { 'colorscheme': 'onehalfdark' } " select last paste in visual mode nnoremap gb '`[' . strpart(getregtype(), 0, 1) . '`]' filetype plugin indent on set conceallevel=0 let g:indentLine_setConceal = 0 " js/ts/... autocmd Filetype javascript setlocal ts=2 sw=2 expandtab autocmd Filetype typescript setlocal ts=2 sw=2 expandtab autocmd Filetype json setlocal ts=2 sw=2 expandtab autocmd Filetype typescriptreact setlocal ts=2 sw=2 expandtab autocmd Filetype html setlocal ts=2 sw=2 expandtab autocmd Filetype htmldjango setlocal ts=2 sw=2 expandtab autocmd Filetype scss setlocal ts=2 sw=2 expandtab autocmd Filetype css setlocal ts=2 sw=2 expandtab autocmd Filetype python setlocal ts=4 sts=4 sw=4 expandtab " rust " PYTHON PROVIDERS {{{ if has('macunix') " OSX let g:python3_host_prog = '/opt/homebrew/bin/python3' " -- Set python 3 provider let g:python_host_prog = '/opt/homebrew/bin/python2' " --- Set python 2 provider endif " lua require('init')