-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
102 lines (63 loc) · 1.73 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
"set runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim81/,/usr/share/vim/vimfiles/after,~/.vim/after
set nobomb
" disable octal arithmetic (it's annoying as hell)
set nrformats-=octal
syntax on
"syntax off
set tabstop=8
set softtabstop=0
set shiftwidth=8
set autoindent
set nosmartindent
set nocindent
set copyindent
set modeline
set showcmd
" Uncomment following line to see both tabs and spaces
set list
"set listchars=tab:>\
set listchars=tab:>\ ,space:·,conceal:X
highlight SpecialKey ctermfg=238
" Line numbering options:
set nu " Line numbering throughout the whole file
set rnu " Relative line numbering
set ruler
" vimdiff colors
highlight DiffText ctermbg=88 cterm=bold,underline
highlight DiffChange ctermbg=52
highlight DiffAdd ctermbg=22
highlight DiffDelete ctermbg=28
" Make text more readable
" full white
"highlight Normal ctermfg=15
" tinted gray
highlight Normal ctermfg=252
highlight ColorColumn ctermbg=235
let &colorcolumn=join(range(81,999),",")
set cursorline
highlight CursorLine cterm=NONE ctermbg=235
highlight CursorLineNr cterm=NONE
set backspace=indent,eol,start
" Set the postgres path for autocompletion
if isdirectory('/usr/local/pgsql/include')
set path+=/usr/local/pgsql/include
endif
function! PrefillLine(key) abort
let lnum1 = line('.') + (a:key ==# 'O' ? -1 : 0)
let lnum2 = lnum1 - 1
let line1 = getline(lnum1)
let line2 = getline(lnum2)
let prefill = ''
let i = 0
while line1[i] ==# line2[i] && i < len(line1)
let prefill.= line1[i]
let i+= 1
endwhile
if prefill !~ '^\s*$'
return a:key . "\<C-o>0\<C-o>D" . prefill
endif
return a:key
endfunction
inoremap <expr> <CR> PrefillLine('<CR>')
nnoremap <expr> O PrefillLine('O')
nnoremap <expr> o PrefillLine('o')