-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.in
115 lines (85 loc) · 3.34 KB
/
vimrc.in
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
set nocompatible
syntax on
" from Perl Best Practices:
" Changing to puppet style with 2-column tabs
" http://docs.puppetlabs.com/guides/style_guide.html
set tabstop=2 "An indentation level every two columns"
set expandtab "Convert all tabs to spaces"
set shiftwidth=2 "Indent/outdent by 2"
set shiftround "Always indent/outdent to nearest tabstop"
"set backup " keep a backup file
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
" Recommended .vimrc from
" http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails
" === start ===
filetype plugin indent on " Enable filetype-specific indenting and plugins
" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim
augroup myfiletypes
" Clear old autocmds in group
autocmd!
" autoindent with two spaces, always expand tabs
autocmd FileType ruby,eruby,yaml set ci sw=4 sts=2 et
augroup END
" === end ===
" http://vim.wikia.com/wiki/Word_wrap_without_line_breaks
set lbr
" == start http://maatkit.googlecode.com/svn/wiki/CodingStandards.wiki ==
set autoindent "Preserve current indent on new lines
set textwidth=78 "Wrap at this column
set backspace=indent,eol,start "Make backspaces delete sensibly
set matchpairs+=<:> "Allow % to bounce between angles too
set iskeyword+=: "Perl double colons are valid part of
"identifiers.
set number
set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P
" My color/font selections from
" http://software-developer.me/changing-the-default-gvimmacvim-color-scheme/2008/10/21/
:colorscheme koehler
filetype plugin on
"reread .vimrc file after editing
autocmd BufWritePost $HOME/.vimrc source $HOME/.vimrc
" use visual bell instead of beeping
set vb
" syntax highlighting
" set bg=light
set bg=dark
syntax on
" autoindent
autocmd FileType perl set autoindent|set smartindent
" show matching brackets
autocmd FileType perl set showmatch
" 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>
" Tlist Config
nnoremap <silent> <F8> :TlistToggle<CR>
" perltidy mappings
map <F2> <ESC>:%! perltidy<CR>
map <F3> <ESC>:'<,'>! perltidy<CR>
" Perl test files as Perl code
au BufRead,BufNewFile *.t set ft=perl
" Don't use Ex mode, use Q for formatting
map Q gq
" Insert Puppet disclaimer
iab abpuppet
\<CR># **************************** NOTICE ****************************
\<CR># * This file is centrally managed by the Puppet configuration
\<CR># * management system. Any changes made locally will be overriden
\<CR># * on the next run of Puppet. To permanently effect a change,
\<CR># * contact your system administration team,
\<CR># * [email protected]
\<CR># **************************** NOTICE ****************************