1 "==============================================================================
3 "==============================================================================
5 " BEGIN Vim-Plug (https://github.com/junegunn/vim-plug)
6 " Run :PlugInstall after adding a new plugin
9 Plug 'dense-analysis/ale' " Syntastic's spiritual succesor
10 Plug 'preservim/nerdtree'
11 "Plug 'nvim-tree/nvim-web-devicons' " Needs patched fonts: https://www.nerdfonts.com/
12 Plug 'phha/zenburn.nvim'
13 Plug 'itchyny/lightline.vim'
14 Plug 'numToStr/Comment.nvim'
15 Plug 'rust-lang/rust.vim'
16 Plug 'neoclide/coc.nvim', {'branch': 'release'}
17 " Plug 'neovim/nvim-lspconfig'
19 " Plug 'hrsh7th/cmp-nvim-lsp', {'branch': 'main'}
20 " Plug 'hrsh7th/cmp-buffer', {'branch': 'main'}
21 " Plug 'hrsh7th/cmp-path', {'branch': 'main'}
22 " Plug 'hrsh7th/nvim-cmp', {'branch': 'main'}
24 " " Only because nvim-cmp _requires_ snippets
25 " Plug 'hrsh7th/cmp-vsnip', {'branch': 'main'}
26 " Plug 'hrsh7th/vim-vsnip'
28 " Plug 'simrat39/rust-tools.nvim'
33 lua require('Comment').setup()
34 " luafile ~/.config/nvim/setup-rust-tools.lua
35 "luafile ~/.config/nvim/setup-lsp-rust-jonhoo.lua
36 source ~/.config/nvim/setup-coc.vim
39 let NERDTreeShowLineNumbers=1
42 let g:rustfmt_autosave = 1
44 "==============================================================================
46 "==============================================================================
48 "------------------------------------------------------------------------------
50 "------------------------------------------------------------------------------
51 set nocompatible " Because plain vi is a bit annoying
52 set nu " Line numbers in gutter
53 "set rnu " Relative number. relativenumber rnu norelativenumber nornu
54 set ruler " Line and column numbers in status
55 set splitright splitbelow " Split window order
56 set bs=2 " Enable backspace key
57 set history=1000 " Bump history from default of 20
60 set ttimeoutlen=100 " Reduce delay when addinng libe above ("O")
64 set mouse=a " To scroll Coc tooltips. https://github.com/neoclide/coc.nvim/issues/1405
65 set spellfile=~/.vim/spell/en.utf-8.add
71 let g:lightline = {'colorscheme': 'seoul256'}
73 "------------------------------------------------------------------------------
75 "------------------------------------------------------------------------------
81 au TextYankPost * lua vim.highlight.on_yank {higroup="IncSearch", timeout=250, on_visual=true, on_macro=true}
83 "hi Normal guibg=NONE " Transparency
84 "hi Normal ctermbg=NONE " Transparency
86 "------------------------------------------------------------------------------
88 "------------------------------------------------------------------------------
94 "------------------------------------------------------------------------------
95 " Text format / indentation
96 "------------------------------------------------------------------------------
104 set textwidth=0 " What is the point of this again? Prevent auto-wrapping?
106 "------------------------------------------------------------------------------
108 "------------------------------------------------------------------------------
109 set foldmethod=indent
112 "------------------------------------------------------------------------------
114 "------------------------------------------------------------------------------
116 let &colorcolumn=join(range(80,80),",")
117 "match ErrorMsg '\%>79v.\+'
119 match ErrorMsg '\s\+$' " Trailing whitespace
120 "2match ErrorMsg '\t' " Tabs
122 " TODO: How to match more than 2 things? 3match is reserved for brackets.
124 "==============================================================================
125 " Per FileType overrides
126 "==============================================================================
129 autocmd FileType c set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
132 autocmd FileType typescript set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
135 autocmd FileType r set tabstop=2 | set softtabstop=2 | set shiftwidth=2
138 autocmd FileType python set omnifunc=pythoncomplete#Complete
141 autocmd FileType gitcommit set spell
144 "autocmd FileType markdown set spell
145 autocmd FileType markdown set expandtab | set tabstop=2 | set softtabstop=2 | set shiftwidth=2
148 autocmd FileType html set spell
151 autocmd FileType mediawiki set spell
152 autocmd FileType mediawiki set tabstop=2 | set softtabstop=2 | set shiftwidth=2
155 autocmd BufNewFile,BufRead *.tig set filetype=tiger
158 autocmd BufNewFile,BufRead *.sig set filetype=sml
161 autocmd BufNewFile,BufRead *.m set filetype=mma
162 autocmd BufNewFile,BufRead *.mt set filetype=mma
163 autocmd FileType mma set tabstop=2 | set softtabstop=2 | set shiftwidth=2
166 autocmd FileType fsharp set tabstop=4 | set softtabstop=4 | set shiftwidth=4
169 autocmd BufNewFile,BufRead twtxt.txt set filetype=conf | set noexpandtab
172 autocmd FileType scheme set tabstop=2 | set softtabstop=2 | set shiftwidth=2
175 autocmd FileType racket setlocal equalprg=scmindent.rkt
176 "autocmd FileType racket setlocal equalprg=raco\ fmt
179 "autocmd FileType erlang setlocal equalprg=erlfmt
180 autocmd FileType erlang set tabstop=4 | set softtabstop=4 | set shiftwidth=4
182 " -----------------------------------------------------------------------------
184 " -----------------------------------------------------------------------------
185 "let g:tsuquyomi_completion_detail = 1
186 "let g:tsuquyomi_use_local_typescript = 0
187 "let g:syntastic_typescript_checkers = ['tsuquyomi']
189 " -----------------------------------------------------------------------------
191 " -----------------------------------------------------------------------------
192 let g:syntastic_enable_racket_racket_checker = 0
194 " -----------------------------------------------------------------------------
196 " -----------------------------------------------------------------------------
197 autocmd FileType ocaml set tabstop=2 | set softtabstop=2 | set shiftwidth=2