/
.vimrc
199 lines (167 loc) · 4.5 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
193
194
195
196
197
198
199
" No-compatible mode
set nocp
" Setup language
language C
set langmenu=none
" Make sure encodings are correct
set encoding=utf-8
set termencoding=latin1
set fileencodings=ucs-bom,utf-8,latin1
setglobal fileencoding=latin1
set runtimepath+=~/Install/VimConfig/.vim/before
set runtimepath+=~/Install/VimConfig/.vim
set runtimepath+=~/Install/VimConfig/.vim/after
" Enable syntax highlighting
syntax on
" Color-setup
"if has("autocmd")
"autocmd ColorScheme * hi Pmenu guibg=Yellow guifg=Black | hi Pmenusel guibg=DarkGray guifg=White | hi CursorLine guibg=Yellow guifg=Black
"endif
"colorscheme settlemyer
"colorscheme vibrantink
let g:rdark_current_line=1
"colorscheme rdark
"colorscheme argoyle
colorscheme zenburn
" Position and size for GUI
if has("gui_running")
" My favourite font
if $OS =~ "Windows"
set gfn=DejaVu_Sans_Mono:h9:cANSI
else
set gfn=DejaVu\ Sans\ Mono\ 10
endif " $OS =~ "Windows"
"set gfn=Bitstream\ Vera\ Sans\ Mono
winpos 0 0
set columns=120
set lines=80
set guioptions-=T
set maxmem=1024
set maxmemtot=2048
set maxmempattern=1024
endif
set ruler
set iskeyword+=_
set iskeyword+=$
set incsearch
set hlsearch
set autoindent
set showcmd
set list
set listchars=tab:»»,trail:·
set tags=./.tags;/
set showmatch
set formatoptions+=crowan
set textwidth=130
set fileformats=unix,dos
set wildmode=list:longest
set diffopt+=iwhite
set hidden
set lazyredraw
set nowrap
set nosol
set nrformats-=octal
set mouse=a
set eadirection=hor
runtime macros/matchit.vim
filetype plugin indent on
runtime! indent.vim
call pathogen#infect()
" Mappings for copying file and path to windows clipboard
nmap ,cs :let @*=expand("%")<CR>
nmap ,cl :let @*=expand("%:p")<CR>
nnoremap ' `
nnoremap ` '
imap ;d =strftime("%Y-%m-%d")
inoreabbr \date\ <c-r>=strftime("%y%m%d")<CR>
if has("gui_running") && $OS =~ "Windows"
set shell=cmd.exe
" Setup Cygwin
"set shell=C:/cygwin/bin/bash
"let $BASH_ENV='~/.bashrc'
"let g:netrw_cygwin=1
"let &shellcmdflag='-lc'
let &shellcmdflag='/q /c'
"set shellxquote='
set shellslash
let g:netrw_scp_cmd = 'c:/Progra~1/PuTTY/pscp.exe -q -batch'
endif
if has("statusline")
set statusline=%<%f\ %h%m%r%=%y\ %k[%{(&fenc\ ==\\"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]\ %-14.(%l,%c%V%)\ %P
endif
set laststatus=2
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
if $OS =~ "Windows"
let VCSCommandCVSExec="c:/cygwin/bin/cvs"
endif " $OS =~ "Windows"
let g:miniBufExplForceSyntaxEnable=1
function! s:Cursor_Moved()
let cur_pos= line ('.')
if g:last_pos==0
set cul
let g:last_pos=cur_pos
return
endif
let diff= g:last_pos - cur_pos
if diff > 1 || diff < -1
set cul
else
set nocul
end
let g:last_pos=cur_pos
endfunction
autocmd CursorMoved,CursorMovedI * call s:Cursor_Moved()
let g:last_pos=0
" gitosis.conf has long lines. Make sure it's not wrapped
au BufReadPre gitosis.conf setlocal tw=3000
au FileChangedShell * call FCSHandler(expand("<afile>:p"))
function! FCSHandler(name)
let msg = 'File "'.a:name.'"'
let v:fcs_choice = ''
if v:fcs_reason == "deleted"
let msg .= " no longer available - 'modified' set"
call setbufvar(expand(a:name), '&modified', '1')
elseif v:fcs_reason == "time"
let msg .= " timestamp changed"
elseif v:fcs_reason == "mode"
let msg .= " permissions changed"
let v:fcs_choice = "ask"
elseif v:fcs_reason == "changed"
let msg .= " contents changed"
let v:fcs_choice = "ask"
elseif v:fcs_reason == "conflict"
let msg .= " CONFLICT --"
let msg .= " is modified, but"
let msg .= " was changed outside Vim"
let v:fcs_choice = "ask"
echohl Error
else " unknown values (future Vim versions?)
let msg .= " FileChangedShell reason="
let msg .= v:fcs_reason
let v:fcs_choice = "ask"
endif
redraw!
echomsg msg
echohl None
endfunction
function! MoveToClosed()
let text = getline ('.')
exe "normal \"_dd"
let paste_pos = search("Closed")
cursor(paste_pos)
exe "normal o<esc>"
setline(paste_pos+1, text)
endfunction
set ea
autocmd VimResized * set noea | set ea
let g:splice_initial_layout_grid=1
let g:splice_initial_scrollbind_grid=1