Vim updates
fe74741801f78098de0f4d7cbeda13dfb9881261
1 parent
e128afc2
.vimrc
+10 -15
| 53 | 53 | set gdefault " Always use /g with %s/ |
|
| 54 | 54 | set colorcolumn=80 |
|
| 55 | 55 | set list |
|
| 56 | 56 | set listchars=tab:·\ ,eol:¬,trail:█ |
|
| 57 | 57 | set fillchars=diff:\ ,vert:│ |
|
| 58 | - | set diffopt=filler,vertical,foldcolumn:0 |
|
| 58 | + | set diffopt=filler,vertical,foldcolumn:0,algorithm:patience |
|
| 59 | 59 | set statusline=%<%f\ (%{gitbranch#name()})\ %h%m%r%=%y\ \ %-14(%{&sw}:%{&sts}:%{&ts}%)%-14.(%l,%c%V%)\ %P |
|
| 60 | - | let &statuscolumn='%=%{v:lnum} ' |
|
| 61 | 60 | set guicursor=n-v-c:block-Cursor/lCursor-blinkon0,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor |
|
| 62 | 61 | set spelllang=en_us,en_gb |
|
| 63 | 62 | set completeopt=menu |
|
| 64 | 63 | set shell=/bin/sh |
|
| 65 | 64 | set signcolumn=yes |
| 89 | 88 | set nocompatible " Don't try to be compatible with vi |
|
| 90 | 89 | set ttyfast |
|
| 91 | 90 | set t_Co=256 |
|
| 92 | 91 | endif |
|
| 93 | 92 | ||
| 93 | + | " Number column |
|
| 94 | + | let &statuscolumn='%=%s%{v:lnum} ' |
|
| 95 | + | ||
| 94 | 96 | let mapleader = "\<Space>" |
|
| 95 | 97 | ||
| 96 | 98 | " vim.wiki |
|
| 97 | 99 | let g:wiki_filetypes = ['wiki'] |
|
| 98 | 100 |
| 103 | 105 | let g:vimtex_quickfix_mode = 0 |
|
| 104 | 106 | ||
| 105 | 107 | " Why this is not the default, I don't know. |
|
| 106 | 108 | let g:c_syntax_for_h = 1 |
|
| 107 | 109 | ||
| 108 | - | " Svelte |
|
| 109 | - | let g:svelte_preprocessors = ['typescript', 'ts'] |
|
| 110 | - | let g:svelte_preprocessor_tags = [ |
|
| 111 | - | \ { 'name': 'ts', 'tag': 'script', 'as': 'typescript' } |
|
| 112 | - | \ ] |
|
| 113 | - | ||
| 114 | 110 | " inccommand |
|
| 115 | 111 | if has("nvim") |
|
| 116 | 112 | set inccommand=nosplit |
|
| 117 | 113 | endif |
|
| 118 | 114 |
| 126 | 122 | ||
| 127 | 123 | " Per file-type indentation |
|
| 128 | 124 | au FileType haskell setlocal number sts=4 sw=4 expandtab formatprg=stylish-haskell |
|
| 129 | 125 | au FileType javascript setlocal number sts=2 sw=2 expandtab nowrap |
|
| 130 | 126 | au FileType typescript setlocal number sts=2 sw=2 expandtab nowrap |
|
| 131 | - | au FileType svelte setlocal number sts=2 sw=2 expandtab nowrap |
|
| 132 | 127 | au FileType css setlocal number sts=2 sw=2 expandtab nowrap |
|
| 133 | 128 | au FileType go setlocal number ts=4 sw=4 noexpandtab |
|
| 134 | 129 | au FileType c,cpp,glsl setlocal number ts=4 sw=4 noexpandtab nowrap |
|
| 135 | 130 | au FileType lua setlocal number sw=2 expandtab |
|
| 136 | 131 | au FileType sh,zsh setlocal number sts=2 sw=2 expandtab |
| 139 | 134 | au FileType solidity setlocal number ts=4 sw=4 expandtab nowrap |
|
| 140 | 135 | au FileType graphql setlocal number ts=4 sw=4 expandtab nowrap |
|
| 141 | 136 | au FileType rust setlocal number signcolumn=yes nowrap colorcolumn=100 textwidth=100 |
|
| 142 | 137 | au FileType plain setlocal nonumber noai nocin nosi inde= wrap linebreak textwidth=80 |
|
| 143 | 138 | au FileType pandoc setlocal nonumber |
|
| 144 | - | au FileType markdown setlocal nonumber conceallevel=0 |
|
| 139 | + | au FileType markdown setlocal nonumber conceallevel=0 formatprg=fmt\ -w\ 80 |
|
| 145 | 140 | au FileType rst setlocal nonumber sw=2 expandtab wrap linebreak textwidth=80 |
|
| 146 | 141 | au FileType todo setlocal nonumber sw=2 expandtab nolinebreak nowrap textwidth=0 |
|
| 147 | 142 | au FileType fountain setlocal nonumber noai nocin nosi inde= wrap linebreak |
|
| 148 | 143 | au FileType tex setlocal |
|
| 149 | 144 | au FileType verilog setlocal commentstring=//\ %s |
|
| 150 | 145 | au FileType riscv setlocal number sts=4 sw=4 expandtab noautoindent commentstring=#\ %s |
|
| 151 | - | au FileType radiance setlocal number ts=4 sw=4 expandtab nowrap commentstring=//\ %s |
|
| 146 | + | au FileType radiance setlocal number ts=4 sw=4 expandtab nowrap commentstring=//\ %s comments=:///,:// |
|
| 152 | 147 | ||
| 153 | 148 | au BufRead,BufNewFile *.md setf markdown |
|
| 154 | 149 | au BufRead,BufNewFile *.tex setf tex |
|
| 155 | 150 | au BufRead,BufNewFile *.todo setf todo |
|
| 156 | 151 | au BufRead,BufNewFile *.tikz setf tex |
|
| 157 | 152 | au BufRead,BufNewFile *.toml setf toml |
|
| 158 | 153 | au BufRead,BufNewFile *.rs setf rust |
|
| 159 | 154 | au BufRead,BufNewFile *.mustache setf mustache |
|
| 160 | 155 | au BufRead,BufNewFile *.tera setf htmldjango |
|
| 161 | - | au BufRead,BufNewFile *.svelte setf svelte |
|
| 162 | 156 | au BufRead,BufNewFile *.wiki setf wiki |
|
| 163 | 157 | au BufRead,BufNewFile *.r setf radiance |
|
| 164 | - | au BufRead,BufNewFile *.h set filetype=c |
|
| 158 | + | au BufRead,BufNewFile *.rir setf rir |
|
| 159 | + | au BufRead,BufNewFile *.h setf c |
|
| 165 | 160 | ||
| 166 | 161 | " If no file-type is detected, set to plain. |
|
| 167 | 162 | autocmd BufEnter * if &filetype == "" | setlocal ft=plain | endif |
|
| 168 | 163 | ||
| 169 | 164 | let c_no_curly_error = 1 |
| 348 | 343 | ||
| 349 | 344 | if has("nvim") |
|
| 350 | 345 | call plug#begin() |
|
| 351 | 346 | ||
| 352 | 347 | Plug 'tpope/vim-commentary' |
|
| 353 | - | Plug 'evanleck/vim-svelte', { 'for': ['svelte'], 'branch': 'main' } |
|
| 354 | 348 | Plug 'pangloss/vim-javascript', { 'for': ['javascript'] } |
|
| 355 | 349 | Plug 'bronson/vim-visual-star-search' |
|
| 356 | 350 | Plug 'cloudhead/neovim-fuzzy' |
|
| 357 | 351 | Plug 'cloudhead/shady.vim' |
|
| 358 | 352 | Plug 'tikhomirov/vim-glsl' |
| 360 | 354 | Plug 'exu/pgsql.vim' |
|
| 361 | 355 | Plug 'lervag/vimtex', { 'for': ['tex'] } |
|
| 362 | 356 | Plug 'itchyny/vim-gitbranch' |
|
| 363 | 357 | Plug 'cespare/vim-toml' |
|
| 364 | 358 | Plug 'rust-lang/rust.vim' |
|
| 365 | - | Plug 'neoclide/coc.nvim', { 'branch': 'release', 'for': ['rust', 'typescript', 'svelte', 'c'] } |
|
| 359 | + | Plug 'neoclide/coc.nvim', { 'branch': 'release', 'for': ['rust', 'typescript', 'c'] } |
|
| 366 | 360 | Plug 'neovim/nvim-lspconfig' |
|
| 367 | 361 | Plug 'lewis6991/gitsigns.nvim' |
|
| 368 | 362 | Plug 'leafgarland/typescript-vim', { 'for': ['typescript'] } |
|
| 369 | 363 | Plug 'lervag/wiki.vim' |
|
| 370 | 364 | Plug 'laurelmay/riscv.vim' |
| 409 | 403 | ||
| 410 | 404 | command! Write setlocal spell | Goyo 100x98% |
|
| 411 | 405 | command! Code setlocal nospell | Goyo! |
|
| 412 | 406 | command! GitAdd silent !git add % |
|
| 413 | 407 | command! GitStage silent :Gitsigns stage_hunk |
|
| 408 | + | command! GitReset silent :Gitsigns reset_hunk |
|
| 414 | 409 | xnoremap <silent> <leader>s :Gitsigns stage_hunk<CR> |
|
| 415 | 410 | ||
| 416 | 411 | " Delete the current file. |
|
| 417 | 412 | command! Delete call delete(expand('%')) | bdelete! |
|
| 418 | 413 |