-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
192 lines (146 loc) · 4.26 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
"Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif
" Improvement
set nocompatible
let mapleader=","
let g:mapleader = ","
let maplocalleader = ","
let g:maplocalleader = ","
if has('vim_starting')
" vim plugins
source ~/.vim/plugs.vim
endif
set showcmd "show incomplete cmds down the bottom
set showmode "show current mode down the bottom
set number "show line numbers
"display tabs and trailing spaces
" set list
set listchars=tab:▸\ ,eol:¬,trail:.,nbsp:.
set ignorecase " Case insensitive search
set smartcase " Guess casing if the keyword contains uppercase characters
set hls
set wrap "dont wrap lines
set linebreak "wrap lines at convenient points
set textwidth=120
if has ('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
"undo settings
if has("persistent_undo") && !exists('g:vscode')
set undodir=$HOME/.undofiles
set undofile
endif
if v:version >= 703
set colorcolumn=+1 "mark the ideal max text width
endif
set cmdheight=2
"default indent settings
set tabstop=4
set shiftwidth=4
set softtabstop=4
set shiftround
set expandtab
set autoindent
set smartindent
set smarttab
"folding settings
set foldmethod=syntax "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "dont fold by default
set wildmode=list:longest "make cmdline tab completion similar to bash
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
"set wildignore+=doc " should not break helptags
set wildignore+=.git " should not break clone
set wildignore+=.git/* " should not break clone
set wildignore+=*/.git/*
set wildignore+=*/.hg/*
set wildignore+=*/.svn/*
"set wildignore+=*/.tox/*
set wildignore+=*.pyc,*.pyo
"set wildignore+=*/.*/*
set formatoptions-=o "dont continue comments when pushing o/O
"vertical/horizontal scroll off settings
set scrolloff=8
set sidescrolloff=7
set sidescroll=1
set lazyredraw
set ttyfast
set laststatus=2
set showtabline=2
set tags=./.tags,.tags,./tags,./.vimtags,tags,vimtags
"fzf
let g:fzf_layout = { 'window': {'height': 0.7, 'width': 0.9 } }
"lsp setings
let g:lsp_settings = {
\ 'hie': {'cmd': ['hls', '--lsp']}
\}
"snipmate settings
let g:snips_author = ""
let g:snips_organization = ""
" Configure WhichKey
" Re-add after figuring out why UI is so terrible in my terminal
" if !exists('g:vscode')
" autocmd! User vim-which-key call which_key#register('<Space>', 'g:which_key_map', 'n')
" endif
"dont load csapprox if we no gui support - silences an annoying warning
if !has("gui_running")
let g:CSApprox_loaded = 1
endif
if !exists('g:vscode')
set background=dark
" if $ITERM_PROFILE =~ "Presentation"
" set background=light
" else
" set background=dark
" endif
colorscheme solarized
if has('gui_macvim')
set transparency=5 " Make the window slightly transparent
endif
"Supertab
set pumheight=25
let g:SuperTabDefaultCompletionType = 'context'
let g:SuperTabClosePreviewOnPopupClose = 1
endif
autocmd BufReadPost * call vimrc#SetCursorPosition()
"spell check when writing commit logs
autocmd filetype svn,*commit* setlocal spell
"Show cursorline in active window only
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave,FocusLost * setlocal nocursorline
augroup END
"Backup and swap, version control & undo
set nobackup
set noswapfile
" Better grep
if executable('rg')
" Use rg over grep
set grepprg=rg\ --vimgrep\ --smart-case\ --hidden
elseif executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor\ --skip-vcs-ignores\ --follow\ --smart-case
endif
" GoldenView
let g:goldenview__enable_default_mapping = 0
" poetv
let g:poetv_auto_activate = 0
let g:poetv_set_environment = 1
let g:indent_guides_enable_on_vim_startup = 1
let g:EditorConfig_core_mode = 'external_command'
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
set hidden
if !exists('g:vscode')
"load ftplugins and indent files
filetype plugin indent on
"turn on syntax highlighting
syntax on
"some stuff to get the mouse going in term
set mouse=a
"set ttymouse=xterm2
"hide buffers when not displayed
set hidden
endif