1 " ************************************************************************
2 " G E N E R A L S T U F F
7 set smartindent "Turn on smart indent
8 set tabstop=4 "set tab character to 4 characters
9 set expandtab "turn tabs into whitespace
10 set shiftwidth=4 "indent width for autoindent
16 " Highlight current line
19 set formatoptions=tcqn2
25 " Avoids to add 2 spaces after dots when joining lines
28 " stop indenting when pasting
29 nnoremap <f7> :set invpaste paste?<CR>
33 " Disable auto-identing
34 nnoremap <f8> :setl noai nocin nosi inde=<CR>
35 " Re-enable auto-identing
36 nnoremap <f9> :setl ai cin si<CR>
39 set guifont=Monospace\ 9
46 " ************************************************************************
47 " C O L O R T H E M E O P T I O N S
51 "let g:solarized_termtrans=1
52 let g:solarized_contrast="high"
58 " Toggles background (dark vs. light theme)
59 if !exists("no_plugin_maps") && !hasmapto('<Plug>ToggleBackground')
60 call togglebg#map("<F5>")
64 " ************************************************************************
65 " B E G I N A U T O C O M M A N D S
70 " Enable file type detection.
71 " Use the default filetype settings, so that mail gets 'tw' set to 72,
72 " 'cindent' is on in C files, etc.
73 " Also load indent files, to automatically do language-dependent indenting.
74 filetype plugin indent on
76 " Add an autocommand to update serial in bind zone files
77 command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UpdateDNSSerialZone(submatch(1), submatch(2)) . submatch(3)/gc
78 autocmd BufWritePre /etc/bind/db.* Soa
83 " ************************************************************************
87 " This function is used to update the serial in the SOA from a bind file
88 function! UpdateDNSSerialZone(date, num)
89 if (strftime("%Y%m%d") == a:date)
90 return a:date . a:num+1
92 return strftime("%Y%m%d") . '01'