/
vimrc
71 lines (52 loc) · 1.84 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
"e 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
" 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
autocmd FileType python set makeprg=python\ -t\ %\ $*
autocmd FileType python set errorformat=%f:%l:%m
autocmd FileType python 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:
"http://perltidy.sourceforge.net/
nnoremap <silent> _t :%!perltidy -q<Enter>
vnoremap <silent> _t :!perltidy -q<Enter>
" Deparse obfuscated code - nada de ofuscar
"nnoremap <silent> _d :.!perl -MO=Deparse 2>/dev/null<cr>
"vnoremap <silent> _d :!perl -MO=Deparse 2>/dev/null<cr>
nnoremap ' :wa<CR>:!dcop konsole-`pidof konsole` session-1 sendSession r<CR><CR>