-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
140 lines (116 loc) · 3.35 KB
/
vimrc
File metadata and controls
140 lines (116 loc) · 3.35 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
" Pathogen
execute pathogen#infect()
" ==============
syntax on
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:·
set title
set ruler
set backspace=indent,eol,start
"/usr/share/vim/vim*/colors
colorscheme default
set background=dark
" Change colorscheme for diffing only
if &diff
colorscheme xoria256
endif
set statusline=%{winnr()}
set statusline+=\
set statusline+=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
set autoread
set number
set modeline
set colorcolumn=80
highlight ColorColumn ctermbg=black
set hlsearch
hi Search ctermfg=black
" Matching paren highlight
hi MatchParen ctermfg=black
let loaded_matchparen = 1
set cino+=(0
set cino+=:0
" Choosewin
" invoke with '-'
"nmap - <Plug>(choosewin)
nmap _ <Plug>(choosewin)
let g:choosewin_blink_on_land = 0
"let g:choosewin_overlay_enable = 1
" Tmux style window selection
"map <Leader>ws :ChooseWin<cr>
" NERDTree
map <C-n> :NERDTreeToggle<CR>
let c_space_errors = 1
let python_space_errors = 1
set tags=./tags;/;../tags
let g:ctags_statusline = 1
let generate_tags = 1
" Press Space to turn off highlighting and clear any message already displayed.
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" ...
endif
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
"" Automatically load cscope.out DB, if it exists
"function! LoadCscope()
" let db = findfile("cscope.out", ".;")
" if (!empty(db))
" let path = strpart(db, 0, match(db, "/cscope.out$"))
" set nocscopeverbose " suppress 'duplicate connection' error
" exe "cs add " . db . " " . path
" set cscopeverbose
" endif
"endfunction
"au BufEnter /* call LoadCscope()
" Put new window on right of horizontal split
set splitright
" Put new window below existing in vertical split
set splitbelow
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
set completeopt-=preview
" This function changes the way the tabline is rendered,
if exists("+showtabline")
function MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
"let s .= ' '
"let s .= i . ':'
"let s .= ' %*'
let s .= '%*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let s .= '[ '. i . ':'
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let s .= ' ]'
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
endif
" Remove all the leading + chars after pasting a patch hunk
map :%s/^+//