aboutsummaryrefslogtreecommitdiffstats
path: root/vim/min-vim
blob: b26e1f20b5b152db05555ce7e818d753ac399605 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
filetype plugin on
filetype plugin indent on

"source ~/.vim/grep.vim

let maplocalleader = "\\"
let mapleader = ","

syntax on
set autoread
set foldmethod=marker
set autowrite
set backspace=indent,eol,start
"set colorcolumn=80
"set cursorline
set completeopt=menuone,longest
set display=truncate
set equalalways
set fileformat=unix
set hidden
set history=1000
set grepprg=git\ grep\ -n\ $*
set ignorecase
set incsearch
set infercase
set lazyredraw
set laststatus=2
"set list
set listchars=nbsp:%,tab:▸\ ,trail:_,eol:¬,precedes:←,extends:→
set matchtime=8
set nobackup
set nocompatible
set hlsearch
set nojoinspaces
set nomodeline
set noshelltemp
set noswapfile
set nocursorline
set noundofile
set nowritebackup
set path+=**
set report=0
set ruler
set scrolloff=5
set shell=bash
set shortmess+=c
set showcmd
"set showbreak=\
set showmatch
set showmode
set laststatus=0
set signcolumn=number
set splitright
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
set ttimeout
set ttyfast
set ttimeoutlen=100
"set viminfo=
set wildmenu
set wildoptions=pum
set wildmode=longest:full,full
set wildignore=**/__pycache*/**,*/node_modules/*,*/.venv/*
set undodir=$HOME/.vimundo
set undofile
set undolevels=999
set undoreload=10000
set wrap
packadd! matchit

" Snippets 
let g:UltiSnipsExpandTrigger="<C-y>"
let g:UltiSnipsJumpForwardTrigger="<S-f>"
let g:UltiSnipsJumpBackwardTrigger="<S-b>"
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]

" Vital plugins

call plug#begin()
Plug 'tpope/vim-commentary'
Plug 'SirVer/UltiSnips'
Plug 'preservim/vim-markdown'
Plug 'honza/vim-snippets'
Plug 'mhinz/vim-signify'
Plug 'vim-test/vim-test'
Plug 'dense-analysis/ale'
call plug#end()

" ALE 
let g:ale_enabled = 1
let g:ale_set_balloons = 0
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_sign_error = '!'
let g:ale_sign_warning = '?'
let g:ale_lint_on_text_changed = 1
let g:ale_hover_cursor = 1
let g:ale_virtualtext_cursor = 'disabled'
let g:ale_sign_column_always = 1
let g:ale_open_list = 0
let g:ale_set_highlights = 1
let g:ale_set_signs = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'ALE Error'
let g:ale_echo_msg_format = 'ALE: %linter% - %code: %%s'
let g:ale_loclist_msg_format = 'ALE: %linter% - %code: %%s'
let g:ale_echo_msg_warning_str = 'ALE Warning'
let g:ale_linters = {'python': ['ruff', 'mypy'],
\                    'ruby': ['standardrb', 'rubocop'],
\                    'ocaml': ['merlin'],
\					 'javascript': ['eslint'],
\                    'cpp': ['clangd'],
\                    'yaml': ['yamllint'],
\                    'c': ['clangd'],
\                    'go': ['gopls', 'golint', 'gofmt'],
 \}
let g:ale_fixers = {
\           'python': ['ruff_format', 'isort', 'yapf'],
\           'ruby': ['standardrb'],
\	        'javascript': ['eslint'],
\           'go': ['gofmt', 'goimports', 'gopls'],
\	        'cpp': ['clang-format'],
\	        'c': ['clang-format'],
\           'rust': ['rustfmt']
\           }
let g:ale_python_mypy_ignore_invalid_syntax = 1
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_options = '--config-file mypy.ini'
" let g:ale_sign_error = '>>'
let g:ale_fix_on_save = 1
let g:ale_linters_explicit = 0
let g:ale_completion_enabled = 1
" Map movement through errors without wrapping.
" nmap <silent> <C-k> <Plug>(ale_previous)
" nmap <silent> <C-j> <Plug>(ale_next)
" OR map keys to use wrapping.
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)

" highlight spaces at the end of line
highlight WhiteSpaceEOL ctermbg=darkgreen
match WhiteSpaceEOL /\s$/
autocmd WinEnter * match WhiteSpaceEOL /\s$/

" after you paste something, press gb to select it in visual mode
" so that you could format it or do something else
nnoremap <expr> gb '`[' . strpart(getregtype(), 0, 1) . '`]'

nnoremap <leader>ev <C-w>s<C-w>j<C-w>L:e $HOME/.vim/vimrc<cr>

nnoremap <C-l> :nohl<CR><C-L>

cnoreabbrev w!! w !sudo tee > /dev/null %|       " write file with sudo

command! W w

augroup textfiles
  autocmd!
  autocmd filetype markdown setlocal spell spelllang=en
augroup end

" ghetto snippets - leave out for now
" augroup htmlshortcuts
"     autocmd!
"     autocmd filetype htmldjango,html inoremap `li <li><cr></li><esc>ka<cr>
"     autocmd filetype htmldjango,html inoremap `ul <ul><cr></ul><esc>ka<cr>
"     autocmd filetype htmldjango,html inoremap `div <div><cr></div><esc>ka<cr>
"     autocmd filetype htmldjango,html inoremap `p <p></p><esc>hhhi
"     autocmd filetype htmldjango,html inoremap `{{ {{ }}<esc>hhi
"     autocmd FileType htmldjango,html inoremap `{% {% %}<Left><Left><Left>
" augroup end

set background=dark
colorscheme koehler