-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.xvimrc
287 lines (240 loc) · 8.06 KB
/
.xvimrc
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
" **************************************
" * VARIABLES
" **************************************
set nocompatible " get rid of strict vi compatibility!
set nu " line numbering on
set autoindent " autoindent on
set noerrorbells " bye bye bells :)
set visualbell " Since intelliJ doesn't understand noerrorbells
"it will understand to switch to visualbells.
set modeline " show what I'm doing
set showmode " show the mode on the dedicated line (see
set nowrap " no wrapping!
set ignorecase " search without regards to case
set backspace=indent,eol,start " backspace over everything
set fileformats=unix,dos,mac " open files from mac/dos
set exrc " open local config files
set nojoinspaces " don't add white space when I don't tell
set ruler " which line am I on?
set showmatch " ensure Dyck language
set incsearch " incremental searching
set nohlsearch " meh
set bs=2 " fix backspacing in insert mode
set cursorline " highlighs current line
set formatoptions+=r " auto add askerus for comments
set expandtab
set ts=4
set shiftwidth=4
set sm " show matching {()} or as typed.
set whichwrap +=>,l
set whichwrap +=<,h "let l and h wrap around.
" :filetype on "Set it to recognize filetype
"Currently unsure of functionality^
" These change tabs to 2 space
" switch tabs on for makefiles (won't work with spaces):
au BufRead,BufNewfile Makefile set ts=4 sw=4 noexpandtab
" Enable arrow keys
imap ^[OA <ESC>ki
imap ^[OB <ESC>ji
imap ^{OC <ESC>li
imap ^[OD <ESC>hi
" Use jj to go to the end of the line
imap jj <Esc>$a
"use aa to go to the front of the line
imap aa <Esc>0i
" Remap dd to delete line (currently disabled)
" imap dd <Esc>ddi
" Enable jk becomes escape for leaving insert mode
imap jk <Esc>
imap ht <Esc>
" Use l; to save and quit
noremap l; :wq<CR>
noremap ns :wq<CR>
";TEMPORARY FOR INTERNATIONALIZATION SHORTCUT FOR IDENTITYMIND
noremap pq pxF"itr(<ESC>wf"a)<ESC>
noremap pa p0vf=y
"Allow all window commands in insert mode without accidentally
"deleting words
imap <C-w> <C-o><C-w>
" Autoclose tags
imap <p><SPACE> <p></p><ESC>hhhi
imap <h1><SPACE> <h1></h1><ESC>hhhhi
imap <h2><SPACE> <h2></h2><ESC>hhhhi
imap <h3><SPACE> <h3></h3><ESC>hhhhi
imap <h4><SPACE> <h4></h4><ESC>hhhhi
imap <h5><SPACE> <h5></h5><ESC>hhhhi
imap <h6><SPACE> <h6></h6><ESC>hhhhi
imap <title><SPACE> <title></title><ESC>hhhhhhhi
" multiline tags
imap <body><SPACE> <body><CR></body><ESC>ka<CR><SPACE><SPACE>
imap <html><SPACE> <html><CR></html><ESC>ka<CR><SPACE><SPACE>
imap <head><SPACE> <head><CR></head><ESC>ka<CR><SPACE><SPACE>
" Set open close brackets
"imap {<CR> {<CR><CR>}<ESC>ki<tab>
inoremap {<CR> {<CR>}<C-o>O
"Easier split navigations - remap left and right, up and down
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" nnoremap <C-S-Tab> <C-W><C-H>
" nnoremap <C-Tab> <C-W><C-L>
" Try insert mode
inoremap <C-J> <Esc><C-W><C-J>i
inoremap <C-K> <Esc><C-W><C-K>i
inoremap <C-L> <Esc><C-W><C-L>i
inoremap <C-H> <Esc><C-W><C-H>i
" Set splitirght
set splitright
"nmap :ba<CR> :b#<CR>
" Shows colors of syntax
syntax on
" Autocomplete paranthesis stuff
"inoremap ( ()<Esc>i
"inoremap () ()
"inoremap ( ()<Left>
"inoremap (<CR> (<CR>)<Esc>0
"inoremap [ []<Esc>i
"inoremap [] []
"inoremap [ []<Left>
"inoremap [<CR> [<CR>]<Esc>0
"imap { {}<Left>
"imap {<CR> {<CR>}<Esc>O
"imap {} {}
" Smart indent
set smartindent
set tabstop=4
set shiftwidth=4"originally 4
set expandtab
"theming
"set background=dark
"colorscheme solarized
colorscheme zellner
" Line number highlight
highlight LineNr ctermbg=black
" Highlight overlenght of 80
" highlight OverLength ctermbg=red ctermfg=white guibg=red
" match OverLength /\%81v.\+/
" Highlight current line color
"highlight CursorLine cterm=NONE ctermbg=black
" Highlight color of VISUAL mode
highlight Visual ctermbg=red
highlight Visual ctermfg=white
" Highlight color of Matching paranthesis
highlight MatchParen cterm=underline ctermbg=none ctermfg=white
"abbreviations
" ab Sop System.out.println( <RIGHT><RIGHT>;<LEFT><LEFT><LEFT>
" ab Sopl System.out.print(
" ab Privates private static final
ab FF /////////////////////////////////FIELDS/////////////////////////////////////
ab MM /////////////////////////////////METHODS////////////////////////////////////
ab CC //////////////////////////////CONSTRUCTORS//////////////////////////////////
ab SG ///////////////////////////SETTERS & GETTERS////////////////////////////////
iab pmain
\public static void main(String[] args<RIGHT><CR>
\{<CR>
iab header
\<CR>/*
\<CR>Name:
\<CR>Purpose:
\<CR>@param
\<CR>@return
\<CR>/<UP><UP><UP><UP><END>
iab ctorheader
\<CR>/*
\<CR>Constructor
\<CR>Purpose:
\<CR>/<UP><END>
iab fileheader
\/*
\<CR>Name: Vincent Yang
\<CR>Login: cs12ehh
\<CR>File:
\<CR>Date:
"\<CR>Sources of Help: API, Discussion
\<CR>
\<CR>Description:
\<CR>
\<CR>/
\<CR><UP><UP><UP><UP><UP><UP><UP><END>
iab classheader
\<CR>/*
\<CR>Name:
\<CR>Purpose:
\<CR>/<UP><UP><END>
iab testerclass
\public class Tester<CR>
\{<CR>
\public static void main(String[] args<RIGHT><CR>
\{<CR>
"colorscheme Zellner
"Testing Tab keyboard controls
"Movement between tabs OR buffers
"nnoremap <C-S-tab> :tabprevious<CR>
"nnoremap <C-S-tab> :call MyPrev()<CR>
"nnoremap <C-tab> :tabnext<CR>
"nnoremap <C-tab> :call MyPrev()<CR>
"nnoremap <C-t> :tabnew<CR>
"inoremap <C-S-tab> <Esc>:tabprevious<CR>i
"inoremap <C-tab> <Esc>:tabnext<CR>i
"inoremap <C-t> <Esc>:tabnew<CR>
" sets tab to fill wildchars for buffers
set wildchar=<tab> wildmenu wildmode=full
" Prompt if unsaved changes in buffer
set confirm
" Format statusline
set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P
" hi User1 ctermbg=white ctermfg=blue guibg=white guifg=blue
" hi User1 ctermbg=red ctermfg=blue
"guibg=red guifg=blue
set statusline+=%1*
set laststatus=2
if version >= 700
highlight statusline cterm=bold ctermfg=black ctermbg=red
au InsertLeave * highlight Statusline cterm=bold ctermfg=black ctermbg=red
au InsertEnter * highlight Statusline cterm=bold ctermfg=black ctermbg=green
endif
" nnoremap <C-W-W> :command vert 2ball<CR>
" nnoremap :vert 2ball<CR> <C-w-w>
"Switch to alternate file
" map <C-Tab> :bnext<cr>
" map <C-S-Tab> :bprevious<cr>
" set clipboard=unnamedplus
highlight LineNr ctermfg=white
" set colorcolumn=120
" Set Dedent.
" Handy function to search previous lines for indent levels and
" use those instead of multiples of shiftwidth.
function! DedentToPrevious()
python << EOF
import vim
tabsize = int(vim.eval("&ts"))
l = vim.current.line
rest = l.lstrip()
indent = l[:-len(rest)]
if indent != "":
cur_size = len(indent.replace("\t", " "*tabsize))
idx = vim.current.window.cursor[0]-2
while idx >= 0:
ll = vim.current.buffer[idx]
indent = ll[:-len(ll.lstrip())]
if len(indent.replace("\t", " "*tabsize)) < cur_size:
vim.current.line = indent+rest
break
idx-=1
EOF
endfunction
" replace the <C-D> in insert mode with the above function
" imap <C-d> <C-o>:call DedentToPrevious()<CR>
" To get more sane behaviour with auto-indent, use this instead:
" imap <C-d> <Left><Right><C-o>:call DedentToPrevious()<CR>
" Use visual mode to indent/unindent:
vmap <TAB> >gv
vmap <S-TAB> <gv
imap <S-TAB> <ESC>hhhha
noremap <S-LEFT> hxhxhxhx
noremap <S-RIGHT> i<SPACE><SPACE><SPACE><SPACE><ESC><RIGHT>
"set shortcut delay time
set timeout timeoutlen=250 ttimeoutlen=100
"Set relative numbers
set rnu