-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
89 lines (73 loc) · 1.69 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
"call plug#begin('~/.vim/plugged')
"
"Plug 'morhetz/gruvbox'
"
"call plug#end()
"
"execute pathogen#infect()
"colorscheme gruvbox
"
syntax enable
set background=dark
"colorscheme solarized
silent! set colorcolumn=80
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set ruler
set cursorline
"tabsetup
let mapleader=","
map <leader>tt :tabnew<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>tn :tabnext<cr>
map <leader>tp :tabprevious<cr>
set scrolloff=5 "keeps 5 lines above and below cursor
set ai "set auto indent
set si "set smart indent
set nu "set line numbers
" comments
map ,# :s/^/#/<CR>
map ,> :s/^/> /<CR>
map ," :s/^/\"/<CR>
map ,% :s/^/%/<CR>
map ,! :s/^/!/<CR>
map ,; :s/^/;/<CR>
map ,- :s/^/--/<CR>
" wrapping comments
map ,( :s/^\(.*\)$/\(\* \1 \*\)/<CR>
map ,< :s/^\(.*\)$/<!-- \1 -->/<CR>
map ,d :s/^\([/(]\*\\|<!--\) \(.*\) \(\*[/)]\\|-->\)$/\2/<CR>
function! Komment()
if getline(".") =~ '\/\*'
let hls=@/
s/^\/\*//
s/*\/$//
let @/=hls
else
let hls=@/
s/^/\/*/
s/$/*\//
let @/=hls
endif
endfunction
map <leader>k :call Komment()<CR>
imap jj <esc>
imap jk <esc>
imap kk <esc>
cmap W w
set makeprg=./compile
syntax on
filetype plugin on
filetype indent on
" Processing
"au BufRead,BufNewFile *.pde setf processing
"
" hardcore hax
":command! P :! processing-java --sketch=$PWD/ --output=temp --run --force
:command! PP :! processing-java --sketch=$PWD/ --output=temp --force --run
"autocmd BufNewFile,BufRead *.pde set makeprg=mkdir\ -p\ ./output\ &&\ processing-java\ --sketch=\"`pwd`\"\ --output=\"`pwd`\"/output\ --run\ --force
nnoremap <Tab> :w<bar>:make<bar><CR>
nnoremap ` :w<bar>:!./run %<CR>