-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
88 lines (77 loc) · 2.5 KB
/
vimrc
File metadata and controls
88 lines (77 loc) · 2.5 KB
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
""" Vimlink .vimrc
"""
""" Copyright (c) 2015-2026, Augusto Damasceno.
""" All rights reserved.
"""
""" SPDX-License-Identifier: BSD-2-Clause
""" STRUCTURE AND APPEARANCE
""" see line numbers
set number
""" highlight syntax
syntax on
""" Tabs are four columns wide
""" Each indentation level is one tab
""" Don't change tab for spaces
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
""" Equal size windows
winc =
""" English Dictionary
set dictionary+=~/.dic/en_US.dic
""" Colors legible for dark background
set background=dark
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
""" MAPPING COMMANDS
"""" Convert all tabs into 4 spaces
noremap ctabs :%s/\t/ /g<CR>
""" Show/Hide Tagbar window
noremap tags :TagbarToggle<CR>
""" Switch buffer files
noremap <C-b> :bn<CR>
""" Indent All Lines
noremap <C-i> gg=G
""" NERDTree file explorer
noremap <C-t> :NERDTree<CR>
""" FUNCTIONS AND RELATED COMMANDS
function! ReplaceBeginningChars(numChars, newText) range
let l:pattern = '^.\{' . a:numChars . '}\ze'
execute a:firstline . ',' . a:lastline . 's/' . l:pattern . '/' . a:newText . '/'
endfunction
command! -nargs=+ -range=% Rbeg :<line1>,<line2>call ReplaceBeginningChars(<f-args>)
""" Toggle YouCompleteMe on/off
command! Ycmoff if get(g:, 'ycm_auto_trigger', 1) |
\ let g:ycm_auto_trigger = 0 | echo "YCM disabled" |
\ else |
\ let g:ycm_auto_trigger = 1 | echo "YCM enabled" |
\ endif
"""" Ale Pluging Configuration by Victor Mours (Reference 4 in notes.md)
nmap <silent> <C-e> <Plug>(ale_next_wrap)
let g:ale_lint_on_enter = 0
let g:ale_sign_error = '●'
let g:ale_sign_warning = '.'
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? 'OK' : printf(
\ '%d⨉ %d⚠ ',
\ all_non_errors,
\ all_errors
\)
endfunction
set statusline+=%=
set statusline+=\ %{LinterStatus()}
""" PLUGINS
" Resolve Python 3 path at startup so YCM always finds the correct interpreter
let g:ycm_server_python_interpreter = exepath('python3')
call plug#begin('~/.vim/plugged')
Plug 'vim-scripts/vim-asm'
Plug 'dense-analysis/ale'
Plug 'majutsushi/tagbar'
Plug 'preservim/nerdtree'
Plug 'ycm-core/YouCompleteMe'
Plug 'itchyny/lightline.vim'
Plug 'nathanaelkane/vim-indent-guides'
call plug#end()
let g:indent_guides_enable_on_vim_startup = 1
set laststatus=2