1 " ************************************************************************
2 " G E N E R A L S T U F F
6 " needed for pathogen to work as expected
9 " Load pathogen plugin manager
10 " http://www.vim.org/scripts/script.php?script_id=2332
11 call pathogen#runtime_append_all_bundles()
13 set smartindent "Turn on smart indent
14 set tabstop=4 "set tab character to 4 characters
15 set expandtab "turn tabs into whitespace
16 set shiftwidth=4 "indent width for autoindent
22 " Highlight current line
25 set formatoptions=tcqn2
31 " Avoids to add 2 spaces after dots when joining lines
34 " Makes the unnamed yank register global
35 " avoiding use of "+ prefix for y / p / d / c
36 "set clipboard+=unnamed
38 " stop indenting when pasting
39 nnoremap <f7> :set invpaste paste?<CR>
43 " Disable auto-identing
44 nnoremap <f8> :setl noai nocin nosi inde=<CR>
45 " Re-enable auto-identing
46 nnoremap <f9> :setl ai cin si<CR>
50 set guifont=Monospace\ 9
57 " http://www.vim.org/scripts/script.php?script_id=3264
58 let g:todo_done_file="DONE"
60 " ************************************************************************
61 " C O L O R T H E M E O P T I O N S
65 "let g:solarized_termtrans=1
66 let g:solarized_contrast="high"
72 " Toggles background (dark vs. light theme)
73 if !exists("no_plugin_maps") && !hasmapto('<Plug>ToggleBackground')
74 call togglebg#map("<F5>")
78 " ************************************************************************
79 " B E G I N A U T O C O M M A N D S
84 " Enable file type detection.
85 " Use the default filetype settings, so that mail gets 'tw' set to 72,
86 " 'cindent' is on in C files, etc.
87 " Also load indent files, to automatically do language-dependent indenting.
88 filetype plugin indent on
90 " Add an autocommand to update serial in bind zone files
91 command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UpdateDNSSerialZone(submatch(1), submatch(2)) . submatch(3)/gc
92 autocmd BufWritePre /etc/bind/db.* Soa
97 " ************************************************************************
101 " This function is used to update the serial in the SOA from a bind file
102 function! UpdateDNSSerialZone(date, num)
103 if (strftime("%Y%m%d") == a:date)
104 return a:date . a:num+1
106 return strftime("%Y%m%d") . '01'