-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc-save
92 lines (67 loc) · 2.22 KB
/
.vimrc-save
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
" use visual bell instead of beeping
set vb
" incremental search
set incsearch
" syntax highlighting
set bg=light
syntax on
" autoindent
autocmd FileType perl set autoindent|set smartindent
autocmd FileType python set autoindent|set smartindent
" python specific
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
" 4 space tabs
autocmd FileType perl set tabstop=4|set shiftwidth=4|set expandtab|set softtabstop=4
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab|set softtabstop=4
" show matching brackets
autocmd FileType perl set showmatch
autocmd FileType python set showmatch
" show line numbers
autocmd FileType perl set number
autocmd FileType python set number
" check perl code with :make
autocmd FileType perl set makeprg=perl\ -c\ %\ $*
autocmd FileType perl set errorformat=%f:%l:%m
autocmd FileType perl set autowrite
" dont use Q for Ex mode
map Q :q
" make tab in v mode ident code
vmap <tab> >gv
vmap <s-tab> <gv
" make tab in normal mode ident code
nmap <tab> I<tab><esc>
nmap <s-tab> ^i<bs><esc>
" paste mode - this will avoid unexpected effects when you
" cut or copy some text from one window and paste it in Vim.
set pastetoggle=<F11>
" comment/uncomment blocks of code (in vmode)
vmap _c :s/^/#/gi<Enter>
vmap _C :s/^#//gi<Enter>
" my perl includes pod
let perl_include_pod = 1
" syntax color complex things like @{${"foo"}}
let perl_extended_vars = 1
" Tidy selected lines (or entire file) with _t:
nnoremap <silent> _t :%!perltidy -q<Enter>
vnoremap <silent> _t :!perltidy -q<Enter>
" Deparse obfuscated code
nnoremap <silent> _d :.!perl -MO=Deparse 2>/dev/null<cr>
vnoremap <silent> _d :!perl -MO=Deparse 2>/dev/null<cr>
" my perl includes pod
let perl_include_pod = 1
" syntax color complex things like @{${"foo"}}
let perl_extended_vars = 1
" pathogen https://github.com/tpope/vim-pathogen
execute pathogen#infect()
filetype plugin indent on
" vim-header variables
let g:header_auto_add_header = 0
let g:header_field_author = 'Ed Davison'
let g:header_field_author_email = '[email protected]'
let g:header_field_timestamp = 0
let g:header_max_size = 10
let g:header_field_filename = 0
map <F4> :AddHeader<CR>
" scroll window
:set scrolloff=5
colors elflord