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
41 "==============================================================================
43 "==============================================================================
45 "------------------------------------------------------------------------------
47 "------------------------------------------------------------------------------
48 set nocompatible " Because plain vi is a bit annoying
49 set nu " Line numbers in gutter
50 "set rnu " Relative number. relativenumber rnu norelativenumber nornu
51 set ruler " Line and column numbers in status
52 set splitright splitbelow " Split window order
53 set bs=2 " Enable backspace key
54 set history=1000 " Bump history from default of 20
57 set ttimeoutlen=100 " Reduce delay when addinng libe above ("O")
61 set mouse=a " To scroll Coc tooltips. https://github.com/neoclide/coc.nvim/issues/1405
62 set spellfile=~/.vim/spell/en.utf-8.add
68 let g:lightline = {'colorscheme': 'seoul256'}
70 "------------------------------------------------------------------------------
72 "------------------------------------------------------------------------------
78 au TextYankPost * lua vim.highlight.on_yank {higroup="IncSearch", timeout=250, on_visual=true, on_macro=true}
80 "hi Normal guibg=NONE " Transparency
81 "hi Normal ctermbg=NONE " Transparency
83 "------------------------------------------------------------------------------
85 "------------------------------------------------------------------------------
91 "------------------------------------------------------------------------------
92 " Text format / indentation
93 "------------------------------------------------------------------------------
101 set textwidth=0 " What is the point of this again? Prevent auto-wrapping?
103 "------------------------------------------------------------------------------
105 "------------------------------------------------------------------------------
106 set foldmethod=indent
109 "------------------------------------------------------------------------------
111 "------------------------------------------------------------------------------
113 let &colorcolumn=join(range(80,80),",")
114 "match ErrorMsg '\%>79v.\+'
116 match ErrorMsg '\s\+$' " Trailing whitespace
117 "2match ErrorMsg '\t' " Tabs
119 " TODO: How to match more than 2 things? 3match is reserved for brackets.
121 "==============================================================================
122 " Per FileType overrides
123 "==============================================================================
126 autocmd FileType c set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
129 autocmd FileType typescript set noexpandtab | set shiftwidth=8 | set tabstop=8 | set softtabstop=8
132 autocmd FileType r set tabstop=2 | set softtabstop=2 | set shiftwidth=2
135 autocmd FileType python set omnifunc=pythoncomplete#Complete
138 autocmd FileType gitcommit set spell
141 "autocmd FileType markdown set spell
142 autocmd FileType markdown set expandtab | set tabstop=2 | set softtabstop=2 | set shiftwidth=2
145 autocmd FileType html set spell
148 autocmd FileType mediawiki set spell
149 autocmd FileType mediawiki set tabstop=2 | set softtabstop=2 | set shiftwidth=2
152 autocmd BufNewFile,BufRead *.tig set filetype=tiger
155 autocmd BufNewFile,BufRead *.sig set filetype=sml
158 autocmd BufNewFile,BufRead *.m set filetype=mma
159 autocmd BufNewFile,BufRead *.mt set filetype=mma
160 autocmd FileType mma set tabstop=2 | set softtabstop=2 | set shiftwidth=2
163 autocmd FileType fsharp set tabstop=4 | set softtabstop=4 | set shiftwidth=4
166 autocmd BufNewFile,BufRead twtxt.txt set filetype=conf | set noexpandtab
169 autocmd FileType scheme set tabstop=2 | set softtabstop=2 | set shiftwidth=2
172 autocmd FileType racket setlocal equalprg=scmindent.rkt
173 "autocmd FileType racket setlocal equalprg=raco\ fmt
176 "autocmd FileType erlang setlocal equalprg=erlfmt
177 autocmd FileType erlang set tabstop=4 | set softtabstop=4 | set shiftwidth=4
179 " -----------------------------------------------------------------------------
181 " -----------------------------------------------------------------------------
182 "let g:tsuquyomi_completion_detail = 1
183 "let g:tsuquyomi_use_local_typescript = 0
184 "let g:syntastic_typescript_checkers = ['tsuquyomi']
186 " -----------------------------------------------------------------------------
188 " -----------------------------------------------------------------------------
189 let g:syntastic_enable_racket_racket_checker = 0
191 " -----------------------------------------------------------------------------
193 " -----------------------------------------------------------------------------
194 autocmd FileType ocaml set tabstop=2 | set softtabstop=2 | set shiftwidth=2