Skip to content

Instantly share code, notes, and snippets.

@daotoad
Created August 20, 2019 01:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daotoad/b366f6c87d4f10ba8b13885cd27ae39a to your computer and use it in GitHub Desktop.
Save daotoad/b366f6c87d4f10ba8b13885cd27ae39a to your computer and use it in GitHub Desktop.
Vim Settings
" Set this variable to 1 to fix files when you save them.
let g:ale_fix_on_save = 1
highlight ALEWarning ctermbg=DarkMagenta
highlight ALEError ctermbg=DarkBlue
" Enable completion where available.
" This setting must be set before ALE is loaded.
let g:ale_completion_enabled = 1
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier', 'eslint'],
\ 'typescript': ['prettier', 'tslint'],
\ 'html': [ 'prettier' ],
\ 'perl': [ 'perltidy', 'remove_trailing_lines', 'trim_whitespace' ],
\}
let g:ale_linters = {
\ 'html': [ ]
\}
" Install vim-plug if we don't already have it
if empty(glob("~/.config/nvim/autoload/plug.vim"))
" Ensure all needed directories exist (Thanks @kapadiamush)
execute '!mkdir -p ~/.config/nvim/plugged'
execute '!mkdir -p ~/.config/nvim/autoload'
" Download the actual plugin manager
execute '!curl -fLo ~/.config/nvim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
call plug#begin('~/.config/nvim/plugged')
" Add new plug-ins below.
" Reload vimrc and run :PlugInstall to install them.
" See https://github.com/junegunn/vim-plug
" Load EditorConfig
Plug 'editorconfig/editorconfig-vim'
let g:EditorConfig_exec_path='/usr/local/bin/editorconfig'
" Syntax
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
" Make % match xml tags
Plug 'tmhedberg/matchit', { 'for': ['html', 'xml'] }
" Navigate files in a sidebar
Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'xolox/vim-misc'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'Valloric/ListToggle'
" Take notes and keep todo lists in vim
Plug 'vimwiki/vimwiki'
" Autocomplete and refactoring tools.
" Plug 'Valloric/YouCompleteMe'
" Plug 'zxqfl/tabnine-vim'
Plug 'dense-analysis/ale'
"Plug 'neomake/neomake'
" tsuquyomi is slow and buggy. Locks up vim
" Plug 'Quramy/tsuquyomi', { 'for': 'typescript' }
" Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
" Plug 'clausreinke/typescript-tools.vim', { 'for': 'typescript' , 'do': 'npm install' }
Plug 'HerringtonDarkholme/yats.vim', { 'for': 'typescript' }
Plug 'mhartington/nvim-typescript', { 'do': './install.sh' }
call plug#end()
nmap <F9> <Plug>(ale_fix)
nmap <F8> :TagbarToggle<CR>
nmap <F7> :NERDTreeToggle<CR>
noremap <C-l> <C-w>l
noremap <C-Right> <C-w>l
noremap <C-h> <C-w>h
noremap <C-Left> <C-w>h
noremap <C-j> <C-w>j
noremap <C-Down> <C-w>j
noremap <C-k> <C-w>k
noremap <C-Up> <C-w>k
autocmd FileType typescript setlocal shiftwidth=2 softtabstop=2 expandtab nu
autocmd FileType perl setlocal shiftwidth=4 softtabstop=4 expandtab nu
"set termguicolors
" Install vim-plug if we don't already have it
if empty(glob("~/.vim/autoload/plug.vim"))
" Ensure all needed directories exist (Thanks @kapadiamush)
execute '!mkdir -p ~/.vim/plugged'
execute '!mkdir -p ~/.vim/autoload'
" Download the actual plugin manager
execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
call plug#begin('~/.vim/plugged')
" Load EditorConfig
Plug 'editorconfig/editorconfig-vim'
let g:EditorConfig_exec_path='/usr/local/bin/editorconfig'
" Syntax
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
" Make % match xml tags
Plug 'tmhedberg/matchit', { 'for': ['html', 'xml'] }
" Navigate files in a sidebar
Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'xolox/vim-misc'
"Plug 'diraol/vim-easytags'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'Valloric/ListToggle'
" Take notes and keep todo lists in vim
Plug 'vimwiki/vimwiki'
" Autocomplete and refactoring tools.
Plug 'Valloric/YouCompleteMe'
Plug 'zxqfl/tabnine-vim'
" tsuquyomi is slow and buggy. Locks up vim
" Plug 'Quramy/tsuquyomi', { 'for': 'typescript' }
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
Plug 'clausreinke/typescript-tools.vim', { 'for': 'typescript' , 'do': 'npm install' }
"Plug 'HerringtonDarkholme/yats.vim', { 'for': 'typescript' }
call plug#end()
nmap <F8> :TagbarToggle<CR>
nmap <F7> :NERDTreeToggle<CR>
noremap <C-l> <C-w>l
noremap <C-Right> <C-w>l
noremap <C-h> <C-w>h
noremap <C-Left> <C-w>h
noremap <C-j> <C-w>j
noremap <C-Down> <C-w>j
noremap <C-k> <C-w>k
noremap <C-Up> <C-w>k
autocmd FileType typescript setlocal shiftwidth=2 softtabstop=2 expandtab nu
autocmd FileType perl setlocal shiftwidth=4 softtabstop=4 expandtab nu
" Fix spelling and YCM error highlighting color to be legible
hi clear SpellBad
hi SpellBad cterm=bold
" Typescript tags for tagbar
" npm install --global git+https://github.com/Perlence/tstags.git
" let g:tagbar_type_typescript = {
" \ 'ctagsbin' : 'tstags',
" \ 'ctagsargs' : '-f-',
" \ 'kinds': [
" \ 'e:enums:0:1',
" \ 'f:function:0:1',
" \ 't:typealias:0:1',
" \ 'M:Module:0:1',
" \ 'I:import:0:1',
" \ 'i:interface:0:1',
" \ 'C:class:0:1',
" \ 'm:method:0:1',
" \ 'p:property:0:1',
" \ 'v:variable:0:1',
" \ 'c:const:0:1',
" \ ],
" \ 'sort' : 0
" \ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment