-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
64 lines (57 loc) · 1.7 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
set nu
colorscheme elda
set tabstop=4
set shiftwidth=4
set autoindent
set cindent
set cc=80
filetype indent on
"Make lines wrap at 80 chars
au BufRead,BufNewFile *.c setlocal textwidth=80
au BufRead,BufNewFile *.java setlocal textwidth=80
"Make vim faster? For terminal too
set timeoutlen=1000
"Also add maptimeout 0 to ~/.screenrc
set ttimeoutlen=0
"Adds quoting ability to vim
:nnoremap <Leader>q" ciw""<Esc>P
:nnoremap <Leader>q' ciw''<Esc>P
:nnoremap <Leader>qd daW"=substitute(@@,"'\\\|\"","","g")<CR>P
" Split screen switch faster with leader
:nnoremap <Leader>k <C-w><up>
:nnoremap <Leader>h <C-w><left>
:nnoremap <Leader>j <C-w><down>
:nnoremap <Leader>l <C-w><right>
" Inserts an inline comment
:nnoremap <Leader>oc o<Esc>cc/* */<Esc>2hi
:nnoremap <Leader>Oc O<Esc>cc/* */<Esc>2hi
" Insert mode: insert /* */ comment
:inoremap <Leader>c /* */<Esc>2hi
" Auto bracket completion
:inoremap {<CR> {<CR><CR>}<Esc>kcc
" Javadoc shortcut
:nnoremap <Leader>jdc cc/**<CR><BS>* <CR>*<CR>* <CR>*/<ESC>3ka
" Inserts <CR> in normal mode
:nnoremap <SPACE><CR> o<ESC>
" System.out.println and System.out.print
:inoremap <Leader>spl System.out.println();<Esc>hi
:inoremap <Leader>sop System.out.print();<Esc>hi
" 81 char -- too long, error message
:match ErrorMsg '\%>80v.\+'
" WordProcessor function: type /":WP" to run
func! WordProcessor()
" movement changes
map j gj
map k gk
" formatting text
setlocal formatoptions=1
setlocal noexpandtab
setlocal wrap
setlocal linebreak
" spelling and thesaurus
setlocal spell spelllang=en_us " 3 l's here is intention
set thesaurus+=/home/nathan/.vim/thesaurus/mthesaur.txt
" complete+=s makes autocompletion search the thesaurus
set complete+=s
endfu
com! WP call WordProcessor()