1 "==============================================================================
3 "==============================================================================
5 " Alternative plugin managers to try:
6 " - https://github.com/Shougo/dein.vim
8 " BEGIN Vim-Plug (https://github.com/junegunn/vim-plug)
9 " Run :PlugInstall after adding a new plugin
12 Plug 'z0mbix/vim-shfmt', { 'for': 'sh' }
13 Plug 'dense-analysis/ale' " Syntastic's spiritual succesor
14 Plug 'preservim/nerdtree'
15 "Plug 'nvim-tree/nvim-web-devicons' " Needs patched fonts: https://www.nerdfonts.com/
16 Plug 'phha/zenburn.nvim'
17 Plug 'itchyny/lightline.vim'
18 Plug 'numToStr/Comment.nvim'
19 Plug 'rust-lang/rust.vim'
20 Plug 'neoclide/coc.nvim', {'branch': 'release'}
21 " Plug 'neovim/nvim-lspconfig'
23 " Plug 'hrsh7th/cmp-nvim-lsp', {'branch': 'main'}
24 " Plug 'hrsh7th/cmp-buffer', {'branch': 'main'}
25 " Plug 'hrsh7th/cmp-path', {'branch': 'main'}
26 " Plug 'hrsh7th/nvim-cmp', {'branch': 'main'}
28 " " Only because nvim-cmp _requires_ snippets
29 " Plug 'hrsh7th/cmp-vsnip', {'branch': 'main'}
30 " Plug 'hrsh7th/vim-vsnip'
32 " Plug 'simrat39/rust-tools.nvim'
37 lua require('Comment').setup()
38 " luafile ~/.config/nvim/setup-rust-tools.lua
39 "luafile ~/.config/nvim/setup-lsp-rust-jonhoo.lua
40 source ~/.config/nvim/setup-coc.vim
43 let NERDTreeShowLineNumbers=1
46 let g:rustfmt_autosave = 1
49 let g:shfmt_extra_args = '--indent 4 --language-dialect bash'
50 " let g:shfmt_fmt_on_save = 1 " on-save probably to invasive to mod existing scripts.
52 "==============================================================================
54 "==============================================================================
56 "------------------------------------------------------------------------------
58 "------------------------------------------------------------------------------
59 set nocompatible " Because plain vi is a bit annoying
60 set nu " Line numbers in gutter
61 "set rnu " Relative number. relativenumber rnu norelativenumber nornu
62 set ruler " Line and column numbers in status
63 set splitright splitbelow " Split window order
64 set bs=2 " Enable backspace key
65 set history=1000 " Bump history from default of 20
68 set ttimeoutlen=100 " Reduce delay when addinng libe above ("O")
72 set mouse=a " To scroll Coc tooltips. https://github.com/neoclide/coc.nvim/issues/1405
73 set spellfile=~/.vim/spell/en.utf-8.add
79 let g:lightline = {'colorscheme': 'seoul256'}
81 "------------------------------------------------------------------------------
83 "------------------------------------------------------------------------------
89 au TextYankPost * lua vim.highlight.on_yank {higroup="IncSearch", timeout=250, on_visual=true, on_macro=true}
91 "hi Normal guibg=NONE " Transparency
92 "hi Normal ctermbg=NONE " Transparency
94 "------------------------------------------------------------------------------
96 "------------------------------------------------------------------------------
102 "------------------------------------------------------------------------------
103 " Text format / indentation
104 "------------------------------------------------------------------------------
112 set textwidth=0 " What is the point of this again? Prevent auto-wrapping?
114 "------------------------------------------------------------------------------
116 "------------------------------------------------------------------------------
117 set foldmethod=indent
120 "------------------------------------------------------------------------------
122 "------------------------------------------------------------------------------
124 let &colorcolumn=join(range(80,80),",")
125 "match ErrorMsg '\%>79v.\+'
127 match ErrorMsg '\s\+$' " Trailing whitespace
128 "2match ErrorMsg '\t' " Tabs
130 " TODO: How to match more than 2 things? 3match is reserved for brackets.
132 "==============================================================================
133 " Per FileType overrides
134 "==============================================================================
137 autocmd FileType c set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
140 autocmd FileType typescript set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
143 autocmd FileType r set tabstop=2 | set softtabstop=2 | set shiftwidth=2
146 autocmd FileType python set omnifunc=pythoncomplete#Complete
149 autocmd FileType gitcommit set spell
152 "autocmd FileType markdown set spell
153 autocmd FileType markdown set expandtab | set tabstop=2 | set softtabstop=2 | set shiftwidth=2
156 autocmd FileType html set spell
159 autocmd FileType mediawiki set spell
160 autocmd FileType mediawiki set tabstop=2 | set softtabstop=2 | set shiftwidth=2
163 autocmd BufNewFile,BufRead *.tig set filetype=tiger
166 autocmd BufNewFile,BufRead *.sig set filetype=sml
169 autocmd BufNewFile,BufRead *.m set filetype=mma
170 autocmd BufNewFile,BufRead *.mt set filetype=mma
171 autocmd FileType mma set tabstop=2 | set softtabstop=2 | set shiftwidth=2
174 autocmd FileType fsharp set tabstop=4 | set softtabstop=4 | set shiftwidth=4
177 autocmd BufNewFile,BufRead twtxt.txt set filetype=conf | set noexpandtab
180 autocmd FileType scheme set tabstop=2 | set softtabstop=2 | set shiftwidth=2
183 autocmd FileType racket setlocal equalprg=scmindent.rkt
184 "autocmd FileType racket setlocal equalprg=raco\ fmt
187 "autocmd FileType erlang setlocal equalprg=erlfmt
188 autocmd FileType erlang set tabstop=4 | set softtabstop=4 | set shiftwidth=4
190 " -----------------------------------------------------------------------------
192 " -----------------------------------------------------------------------------
193 "let g:tsuquyomi_completion_detail = 1
194 "let g:tsuquyomi_use_local_typescript = 0
195 "let g:syntastic_typescript_checkers = ['tsuquyomi']
197 " -----------------------------------------------------------------------------
199 " -----------------------------------------------------------------------------
200 let g:syntastic_enable_racket_racket_checker = 0
202 " -----------------------------------------------------------------------------
204 " -----------------------------------------------------------------------------
205 autocmd FileType ocaml set tabstop=2 | set softtabstop=2 | set shiftwidth=2