-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
142 lines (121 loc) · 4.18 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
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set laststatus=2
set shiftwidth=4
set tabstop=4
set softtabstop=4
set smarttab
set expandtab
if version >= 700
set cursorline
endif
highlight CursorLine cterm=NONE guibg=lightblue ctermbg=lightgray
set number
iabbrev myAddr 10 Woodsage Ln Durham NC 27713
iabbrev teh the
"Tags file
autocmd FileType tags set noexpandtab
autocmd FileType tags set nonumber
autocmd FileType tags set wrap
au BufRead,BufNewFile *.t set syntax=perl
au BufRead,BufNewFile *.page set syntax=html
:imap <Insert> <Esc>a
filetype on
" Arrow Keys aren't functional
nnoremap <Up> <nop>
inoremap <Up> <nop>
vnoremap <Up> <nop>
if version >= 700
snoremap <Up> <nop>
endif
" nnoremap! <Up> <Esc>
nnoremap <Down> <nop>
inoremap <Down> <nop>
vnoremap <Down> <nop>
if version >= 700
snoremap <Down> <nop>
endif
" nnoremap! <Down> <Esc>
nnoremap <Left> <nop>
inoremap <Left> <nop>
vnoremap <Left> <nop>
if version >= 700
snoremap <Left> <nop>
endif
" nnoremap! <Left> <Esc>
nnoremap <Right> <nop>
inoremap <Right> <nop>
vnoremap <Right> <nop>
if version >= 700
snoremap <Right> <nop>
endif
" nnoremap! <Right> <Esc>
function! RunMe()
if filereadable('Makefile')
"excl.mark = suppress jumping on warr/err
make!
" open quickfix window IF there was any error
cwindow
else
" run current file as a script
!./%
endif
endfunction
"Make or run on F9
map <F9> :w<CR>:call RunMe()<CR>
imap <F9> <esc>:w<CR>:call RunMe()<CR>
"set makeprg=[[\ -f\ Makefile\ ]]\ &&\ make\ \\\|\\\|\ make\ -C\ ..
" window
nmap <leader>swh :topleft vnew<CR>
nmap <leader>swl :botright vnew<CR>
nmap <leader>swk :topleft new<CR>
nmap <leader>swj :botright new<CR>
" buffer
nmap <leader>sh :leftabove vnew<CR>
nmap <leader>sl :rightbelow vnew<CR>
nmap <leader>sk :leftabove new<CR>
nmap <leader>sj :rightbelow new<CR>
" http://nvie.com/posts/how-i-boosted-my-vim/
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
noremap <F6> <esc>:call MoveTestToScratch()<CR>
let mapleader=","
" Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set showmatch " show matching parens
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
set pastetoggle=<F2>
"au BufEnter *.cls set syntax=java tabstop=4 shiftwidth=4 softtabstop=4 nowrap
au BufEnter *.cls set syntax=java tabstop=4 shiftwidth=4 nowrap noexpandtab
au BufEnter *.cls exec 'match Todo /\%>180v.\+/'
"au BufEnter *.cls exec 'match Todo /\%>80v.\+/'
"au BufEnter *.trigger set syntax=java tabstop=4 shiftwidth=4 softtabstop=4 nowrap
au BufEnter *.cls set syntax=java tabstop=4 shiftwidth=4 nowrap noexpandtab
au BufEnter *.trigger exec 'match Todo /\%>180v.\+/'
"au BufEnter *.trigger exec 'match Todo /\%>80v.\+/'
" http://vim.wikia.com/wiki/Do_not_auto-add_a_newline_at_EOF
au BufWritePre * :set binary | set noeol
au BufWritePost * :set nobinary | set eol
noremap <F4> I//df<Esc><Esc>
noremap <F5> :s/\/\/df//<Esc><Esc>
set tabpagemax=50
"set swb=usetab
noremap <F8> :tab drop /tmp/output.txt<CR> :q!<CR> :!bash ~/bin/scratch_test.bash<CR> :tab drop /tmp/output.txt<CR>
"noremap <F8> :tab drop /tmp/output.txt<CR>:q!<CR>:!solenopsis git-push && solenopsis --logtype=Debugonly run-tests scratch_Test 2&> /tmp/output.txt<CR>:tab drop /tmp/output.txt<CR>
"noremap <F8> :tab drop /tmp/output.txt<CR>:q!<CR>:tabnew /tmp/output.txt<CR>
command TrailingWhitespace %s/\s\+$//