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()
12 call pathogen#infect()
14 set smartindent "Turn on smart indent
15 set tabstop=4 "set tab character to 4 characters
16 set expandtab "turn tabs into whitespace
17 set shiftwidth=4 "indent width for autoindent
23 " Highlight current line
26 set formatoptions=tcqn2
32 " Avoids to add 2 spaces after dots when joining lines
35 " Makes the unnamed yank register global
36 " avoiding use of "+ prefix for y / p / d / c
37 "set clipboard+=unnamed
39 " stop indenting when pasting
40 nnoremap <f7> :set invpaste paste?<CR>
44 " Disable auto-identing
45 nnoremap <f8> :setl noai nocin nosi inde=<CR>
46 " Re-enable auto-identing
47 nnoremap <f9> :setl ai cin si<CR>
51 set guifont=Monospace\ 10
58 " http://www.vim.org/scripts/script.php?script_id=3264
59 let g:todo_done_file="DONE"
62 setlocal spell spelllang=fr,en
65 " vimfootnotes options
66 set g:vimfootnotenumber = -1
68 " Allows command completion (using <tab>)
72 " ************************************************************************
73 " C O L O R T H E M E O P T I O N S
77 "let g:solarized_termtrans=1
78 let g:solarized_contrast="high"
84 " Toggles background (dark vs. light theme)
85 if !exists("no_plugin_maps") && !hasmapto('<Plug>ToggleBackground')
86 call togglebg#map("<F5>")
90 " ************************************************************************
91 " B E G I N A U T O C O M M A N D S
96 " Enable file type detection.
97 " Use the default filetype settings, so that mail gets 'tw' set to 72,
98 " 'cindent' is on in C files, etc.
99 " Also load indent files, to automatically do language-dependent indenting.
100 filetype plugin indent on
102 " Add an autocommand to update serial in bind zone files
103 command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UpdateDNSSerialZone(submatch(1), submatch(2)) . submatch(3)/gc
104 autocmd BufWritePre /etc/bind/db.* Soa
109 " ************************************************************************
113 " This function is used to update the serial in the SOA from a bind file
114 function! UpdateDNSSerialZone(date, num)
115 if (strftime("%Y%m%d") == a:date)
116 return a:date . a:num+1
118 return strftime("%Y%m%d") . '01'