-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
160 lines (127 loc) · 3.5 KB
/
vimrc
File metadata and controls
160 lines (127 loc) · 3.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
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
" Minimal desired settings
set list
set number
set hidden
set cursorline
set background=dark
set shortmess+=c
set shiftwidth=4
set signcolumn=yes
set titlestring=VIM
set wildoptions-=pum
set fileformats=unix,mac,dos
const s:gui = has('gui_running') || strlen(&term) == 0 || &term ==? 'builtin_gui'
const s:neovim = has('nvim')
const s:windows = has('win16') || has('win32') || has('win64')
const gruvbox_material_foreground = 'mix'
const gruvbox_material_enable_bold = 1
const gruvbox_material_better_performance = 1
const gruvbox_material_disable_italic_comment = 0
const gruvbox_material_diagnostic_text_highlight = 1
const gruvbox_material_diagnostic_line_highlight = 1
" On macOS the default windows decoractions match 'medium', but on Linux with Gnome they match 'hard'
if system('arch') == "arm64"
const gruvbox_material_background = 'medium'
else
const gruvbox_material_background = 'hard'
endif
" Try to use 'gruvbox' as much as possible.
try
colorscheme gruvbox-material
catch
" This is a new builtin theme in vim9... what makes this super great is its pretty close to gruvbox outa the box
colorscheme retrobox
endtry
" On Windows, also use ~/.vim instead of vimfiles... Although these days I don't even have a Windows machine.
if s:windows
if !s:neovim
if has('multi_byte') || (has('gui_running') && &encoding ==# 'latin1')
set encoding=utf-8
endif
endif
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
endif
if has('mouse') || s:neovim
set mouse=a
endif
if has('clipboard') || s:neovim
set clipboard+=unnamedplus
endif
if v:version >= 704
set expandtab
endif
if v:version >= 800 || s:neovim
set listchars=tab:→\ ,trail:·,nbsp:•,extends:…,precedes:…
endif
if exists('+termguicolors')
set termguicolors
endif
if has('windows')
set splitbelow
endif
if has('vertsplit')
set splitright
endif
if has('cmdline_hist')
set history=500
endif
if s:gui
set guioptions-=L
set guioptions-=T
set guioptions-=m
set guioptions-=r
endif
if !s:neovim
set smarttab
set autoread
set autoindent
set langnoremap
set belloff=all
set display=lastline
set nrformats=bin,hex
set backspace=indent,eol,start
set laststatus=2
set sidescroll=1
set tabpagemax=50
set formatoptions=tcqj
set ttyfast
set viminfo^=!
set ttymouse=xterm2
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
if has('extra_search') && has('reltime')
set hlsearch incsearch
endif
if has('cmdline_info')
set showcmd ruler
endif
if has('autocmd')
filetype plugin indent on
endif
if has('wildmenu') | set wildmenu | endif
if has('mksession') | set sessionoptions-=options | endif
if exists('+fsync') | set nofsync | endif
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &runtimepath) ==# ''
runtime! macros/matchit.vim
endif
endif
if has('autocmd')
" .jsonc file support... especially for some VSCode config files.
autocmd FileType json syntax match Comment +\/\/.\+$+
" autocmd CursorMoved * lua vim.diagnostic.open_float(nil, {focusable = false})
function! CheckGitCommit()
:3
setlocal expandtab shiftwidth=2 tabstop=2 textwidth=80 colorcolumn=+1
if has('spell')
setlocal spell
endif
:highlight SpellBad ctermfg=red ctermbg=white
endfunction
augroup FileSettings
autocmd!
autocmd FileType gitcommit call CheckGitCommit()
augroup END
endif
highlight Comments cterm=italic gui=italic
scriptencoding utf-8