-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
175 lines (126 loc) · 4.12 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
" vim-tiny lacks 'eval'
if has("eval")
let skip_defaults_vim = 1
endif
set nocompatible
"####################### Vi Compatible (~/.exrc) #######################
" automatically indent new lines
set autoindent " (alpine)
" replace tabs with spaces automatically
set expandtab " (alpine)
" number of spaces to replace a tab with when expandtab
set tabstop=2 " (alpine)
" use case when searching
set noignorecase
" automatically write files when changing when multiple files open
set autowrite
" deactivate line numbers
set nu
set rnu
" turn col and row position on in bottom right
set ruler " see ruf for formatting
" show command and insert mode
set showmode
"#######################################################################
" disable visual bell (also disable in .inputrc)
set t_vb=
let mapleader=","
set softtabstop=2
" mostly used with >> and <<
set shiftwidth=2
set smartindent
set smarttab
if v:version >= 800
" stop vim from silently messing with files that it shouldn't
set nofixendofline
" better ascii friendly listchars
set listchars=space:*,trail:*,nbsp:*,extends:>,precedes:<,tab:\|>
" i hate automatic folding
set foldmethod=manual
set nofoldenable
endif
" mark trailing spaces as errors
match IncSearch '\s\+$'
" enough for line numbers + gutter within 80 standard
set textwidth=72
"set colorcolumn=73
" makes ~ effectively invisible
"highlight NonText guifg=bg
" turn on default spell checking
"set spell
" disable spellcapcheck
set spc=
" more risky, but cleaner
set nobackup
set noswapfile
set nowritebackup
set icon
" center the cursor always on the screen
"set scrolloff=999
" highlight search hits
set hlsearch
set incsearch
set linebreak
" avoid most of the 'Hit Enter ...' messages
set shortmess=aoOtTI
" prevents truncated yanks, deletes, etc.
set viminfo='20,<1000,s1000
" not a fan of bracket matching or folding
if has("eval") " vim-tiny detection
let g:loaded_matchparen=1
endif
set noshowmatch
" wrap around when searching
set wrapscan
set nowrap
" Just the formatoptions defaults, these are changed per filetype by
" plugins. Most of the utility of all of this has been superceded by the use of
" modern simplified pandoc for capturing knowledge source instead of
" arbitrary raw text files.
set fo-=t " don't auto-wrap text using text width
set fo+=c " autowrap comments using textwidth with leader
set fo-=r " don't auto-insert comment leader on enter in insert
set fo-=o " don't auto-insert comment leader on o/O in normal
set fo+=q " allow formatting of comments with gq
set fo-=w " don't use trailing whitespace for paragraphs
set fo-=a " disable auto-formatting of paragraph changes
set fo-=n " don't recognized numbered lists
set fo+=j " delete comment prefix when joining
set fo-=2 " don't use the indent of second paragraph line
set fo-=v " don't use broken 'vi-compatible auto-wrapping'
set fo-=b " don't use broken 'vi-compatible auto-wrapping'
set fo+=l " long lines not broken in insert mode
set fo+=m " multi-byte character line break support
set fo+=M " don't add space before or after multi-byte char
set fo-=B " don't add space between two multi-byte chars
set fo+=1 " don't break a line after a one-letter word
set backspace=indent,eol,start
" stop complaints about switching buffer with changes
set hidden
" command history
set history=100
" here because plugins and stuff need it
if has("syntax")
syntax enable
endif
" faster scrolling
set ttyfast
" allow sensing the filetype
filetype plugin on
" high contrast for streaming, etc.
set background=dark
" make gutter less annoying
hi SignColumn ctermbg=NONE
" Edit/Reload vimrc configuration file
nnoremap confe :e $HOME/.vimrc<CR>
nnoremap confr :source $HOME/.vimrc<CR>
set ruf=%30(%=%#LineNr#%.50F\ [%{strlen(&ft)?&ft:'none'}]\ %l:%c\ %p%%%)
" make Y consistent with D and C (yank til end)
map Y y$
" better command-line completion
set wildmenu
" disable search highlighting with <C-L> when refreshing screen
nnoremap <C-L> :nohl<CR><C-L>
" start at last place you were editing
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"au BufWritePost ~/.vimrc so ~/.vimrc