-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
84 lines (55 loc) · 1.76 KB
/
vimrc
File metadata and controls
84 lines (55 loc) · 1.76 KB
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
set nocompatible
set history=1000
set ruler
set modeline " debian turns this off by default. it's annoying, even if it is safer.
syntax on
set background=dark
set autoindent
set showcmd
set linebreak " break lines at word boundaries
set scrolloff=3
""" Line numbering
set number
" F11 toggles wrapping long lines
map <F11> :set number!<bar>set number?<CR>
""" Highlighting
" Make comments and line numbers less garish
highlight Comment ctermfg=darkgreen
highlight LineNr ctermfg=darkgrey
" Make TODO flags more garish
highlight Todo ctermfg=white ctermbg=red
""" Search
set incsearch " search-as-you-type
set nohlsearch
" F5 toggles hlsearch
map <F5> :set hls!<bar>set hls?<CR>
set grepprg=ack
""" Miscellanea
" toggle case-sensitive search
map <F9> :set ignorecase!<bar>set ignorecase?<CR>
" F10 toggles wrapping long lines
map <F10> :set wrap!<bar>set wrap?<CR>
" cull trailing whitespace
nmap <silent> <C-F10> :%s,\s\+$,,e<CR>
vmap <silent> <C-F10> :s,\s\+$,,e<CR>
" cycle fast through buffers
nmap <C-PageUp> :bn<CR>
nmap <C-PageDown> :bp<CR>
" and through errors
nmap <M-PageDown> :cn<CR>
nmap <M-PageUp> :cp<CR>
" <F12> toggles spell-checking
set spelllang=en_gb
map <F12> :set spell!<bar>set spell?<CR>
""" Abbreviations
iab #### ################################################################################
""" Commenting
nmap ,# :s/^/# /<CR>
nmap ,; :s/^/; /<CR>
nmap ," :s/^/" /<CR>
""" Skeleton files
" Automatically set the package line in Perl modules.
autocmd BufNewFile *.pm 0r ~/.vim/skeleton/perl.pm | $d | 1s/{{{PACKAGE}}}/\=ExpectedPackageName()/
autocmd BufNewFile *.pl 0r ~/.vim/skeleton/perl.pl | $d
autocmd BufNewFile *.t 0r ~/.vim/skeleton/perl.t | $d
autocmd BufNewFile *.cgi 0r ~/.vim/skeleton/perl.cgi | $d | set ft=perl