-
Notifications
You must be signed in to change notification settings - Fork 3
/
vimrc
210 lines (188 loc) · 10.7 KB
/
vimrc
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
" ##################################
" # VIM SETTINGS
" #
" # REFERENCES:
" # https://github.com/mhinz/vim-galore/blob/master/static/minimal-vimrc.vim
" # http://ivanbrennan.nyc/blog/2014/01/16/rigging-vims-netrw/
" # http://www.drchip.org/astronaut/vim/index.html#NETRW
" # https://www.cs.clemson.edu/course/cpsc102/links/vimrc
" # http://ellengummesson.com/blog/2014/02/22/make-vim-really-behave-like-netrw/
" # https://gist.github.com/danidiaz/37a69305e2ed3319bfff9631175c5d0f
" # https://github.com/sickill/vim-monokai
" # https://jovicailic.org/mastering-vim-quickly/
" # https://medium.com/vim-drops/javascript-folding-on-vim-119c70d2e872
" # https://vimways.org/2018/from-vimrc-to-vim/
" # https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" # https://html.developreference.com/article/22757209/Forcing+vimdiff+to+wrap+lines%3F
" # https://remram44.github.io/regex-cheatsheet/regex.html
" # https://cheatography.com/fievel/cheat-sheets/vim-regexp/
" # http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml
" # https://vimtricks.com/p/highlight-syntax-inside-markdown/
" # https://vim.fandom.com/wiki/256_colors_in_vim
" # https://vimtricks.com/p/vim-search-ignore-case
" # https://cs.opensource.google/go/x/tools/+/refs/tags/gopls/v0.14.2:gopls/doc/vim.md
" #
" ##################################
" :::::::::: Vim General Settings ::::::::::
syntax enable " File syntax.
set nocompatible " Vim exclusive.
set autoindent " Vim auto indentation.
set ttyfast " Indicates a fast terminal connection.
set tabstop=2 " Tabs with 2 intervals.
set expandtab " Tabs replaced by spaces.
set shiftwidth=2 " Indentation with 2 intervals.
set softtabstop=2 " Indentation with 2 intervals.
set shiftround " Round indent to shiftwidth value.
set laststatus=2 " Last window status.
set display=lastline " Display the whole line instead of wrap with @.
set showmode " Already defined on Vim. Display current mode.
set incsearch " Highlight pattern on search while typing.
set hlsearch " Highlight all matches on search.
set wrapscan " Searches wrap around the end of the file.
set splitbelow " Puts the new splitted window below the current one.
set splitright " Puts the new splitted window right the current one.
set cursorline " Highlight the screen line of the cursor.
set report=0 " Reports number of lines changed. 0 stands for always.
set synmaxcol=0 " Maximum column to search for syntax items. Default: 3000. 0 removes the limit.
set number " Line number.
set relativenumber " Relative line number.
set wildmode=longest,list,full " Navigation method.
set wildmenu " Navigation through files/folders.
set wildignorecase " Case insensitive autocompletion for files and folders.
set ignorecase " Makes pattern matching case-insensitive.
set smartcase " Overrides ignorecase if your pattern contains mixed case.
set tabpagemax=100 " Number of tabs when using `vim -p` (default is 10).
set showtabline=2 " Tab display. 0: never; 1: only with 2 or more tabs; 2: always.
set foldcolumn=1 " Columns when folding.
set foldlevelstart=99 " Folding mode when opening files. 99 keeps all folds open.
set keywordprg=google " Execute `google` when hit K. Requires `bins/google` file from this repository.
set autoread " Vim will automatically read all changes made outside Vim.
set ruler " Display current line and column numbers, as `live, column`.
set title " Enables title
" Modify title format
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
filetype plugin on
filetype indent on
set nobackup " No backup files.
set nowritebackup " No backup write files.
set nowb " Don't write backup files.
set noswapfile " No swap files.
set noundofile " Deactivate file backup.
set t_Co=256 " Enable 256 colors.
set foldmethod=indent " Set which method is used for folding:
" - manual
" - indent
" - expr
" - marker
" - syntax (default)
" - diff
" See :h foldmethod
packadd! dracula
colorscheme dracula " Define the current color theme.
" Set highlight syntax on code written inside markdown blocks
let g:markdown_fenced_languages =
\ [
\ 'conf', 'css', 'cucumber', 'dockerfile', 'go', 'java', 'javascript',
\ 'json', 'kotlin', 'make', 'nginx', 'php', 'terraform', 'text', 'toml',
\ 'xml', 'yaml', 'html', 'bash', 'sh', 'vim'
\ ]
" Tabs
hi TabLine cterm=NONE ctermfg=Gray ctermbg=238
hi TabLineSel cterm=bold,italic ctermfg=123
hi TabLineFill cterm=NONE ctermbg=16
" :::::::::: Netrw Settings ::::::::::
let g:netrw_banner=0 " Netrw banner.
" 0 - Suppress.
" 1 - Display (default).
let g:netrw_liststyle=3 " Folder/file list style.
" 0 - Thin.
" 1 - Long.
" 2 - Wide.
" 3 - Tree.
let g:netrw_altv=1 " Control right/left splitting.
" 0 - Horizontal.
" 1 - Vertical.
let g:netrw_preview=1 " Control horizontal vs vertical splitting.
" 0 - Preview horizontal.
" 1 - Preview vertical.
let g:netrw_winsize=80 " Open the preview with 80% of the screen.
let g:netrw_special_syntax=1 " Special syntax for a given list of file
" types.
" 0 - Disabled.
" 1 - Enabled.
let g:netrw_fastbrowse=2 " Directory browsing.
" 0 - Slow.
" 1 - Medium (default).
" 2 - Fast.
" Do not display files and folders in the list.
let g:netrw_list_hide='^.git/$,.jpg$,.jpeg$,.png$,.svg,.ico,.gif$,.cache$,.woff2$,^nbproject/$'
let g:netrw_ignorenetrc=1 " .netrc file usage.
" 0 - Load.
" 1 - Ignore.
let g:netrw_browse_split=3 " Set how to display splitted files:
" 0 - Default.
" 1 - Horizontal split.
" 2 - Vertical split.
" 3 - New tab/window.
let g:netrw_hide=1 " File display mode:
" 0 - Show all.
" 1 - Show not hidden (default).
" 2 - Show only hidden.
let g:netrw_sort_by='name' " Display sort:
" 'name' - Alphabetically (default).
" 'time' - Modification time.
" 'size' - Size.
" 'exten' - Extension.
let g:netrw_sort_direction='normal' " Sort orientation:
" 'normal' - A to Z (default).
" 'reverse' - Z to A.
let g:netrw_sort_options='i' " Sort options.
" 'i' means 'case insensitive'.
" Time format for strftime().
let g:netrw_timefmt=' %a %Y-%m-%d %I:%M:%S %p'
let g:netrw_use_noswf=0 " Netrw creation of swap files for browser
" buffers:
" 1 - Enabled (default).
" 0 - Disabled.
let g:netrw_keepdir=1 " Current browser directory
" 1 - (default) keep current directory immune from the browsing directory.
" 0 - keep the current directory the same as the browsing directory.
let g:netrw_localcopycmd='cp-r' " Netrw's command to copy folders. Default: 'cp'
let g:netrw_localcopydircmd='cp -r' " Netrw's command to copy folders. Default: 'cp'
let g:netrw_localmkdir='mkdir -p'
let g:netrw_use_errorwindow=2
let g:netrw_sizestyle='H' " Changes how file size is displayed using qf.
" b - (default) Byte size
" h - Human friendly, base 1000
" H - Human friendly, base 1024
" :::::::::: vimdiff Settings ::::::::::
" Set line wrap when using vimdiff.
au VimEnter * if &diff | execute 'windo set wrap' | endif
if &diff
" vimdiff syntax highlight: added line.
hi DiffAdd ctermfg=Black ctermbg=LightGreen
" vimdiff syntax highlight: changed line.
hi DiffChange ctermfg=Black ctermbg=Yellow
" vimdiff syntax highlight: deleted line.
hi DiffDelete ctermfg=Black ctermbg=LightRed
" vimdiff syntax highlight: changed text within a changed line.
hi DiffText ctermfg=Black ctermbg=LightBlue
endif
" :::::::::: gitcommit Settings ::::::::::
hi diffAdded cterm=bold ctermfg=LightGreen ctermbg=Black
hi diffRemoved cterm=bold ctermfg=DarkRed ctermbg=Black
hi diffNewFile cterm=bold ctermfg=DarkBlue ctermbg=Black
hi diffFile cterm=bold ctermfg=LightBlue ctermbg=Black
hi gitcommitDiff cterm=NONE ctermfg=240
" :::::::::: vim-go Settings ::::::::::
let g:go_template_autocreate = 1
" Debug
let g:go_debug_windows = {
\ 'vars': 'rightbelow 60vnew',
\ 'stack': 'rightbelow 10new',
\ 'out': 'botright 5new',
\ }
let g:go_debug_preserve_layout = 1
" gopls
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'