" ************************************************************************ " G E N E R A L S T U F F " syntax on " needed for pathogen to work as expected filetype off " Load pathogen plugin manager " http://www.vim.org/scripts/script.php?script_id=2332 "call pathogen#runtime_append_all_bundles() call pathogen#infect() set smartindent "Turn on smart indent set tabstop=4 "set tab character to 4 characters set expandtab "turn tabs into whitespace set shiftwidth=4 "indent width for autoindent " Add line numbering set number "set numberwidth=4 " Highlight current line set cursorline set formatoptions=tcqn2 set ruler set modeline set laststatus=2 set wildmode=longest,list set wildmenu " Avoids to add 2 spaces after dots when joining lines set nojoinspaces " Makes the unnamed yank register global " avoiding use of "+ prefix for y / p / d / c "set clipboard+=unnamed " stop indenting when pasting nnoremap :set invpaste paste? set pastetoggle= set showmode " Disable auto-identing nnoremap :setl noai nocin nosi inde= " Re-enable auto-identing nnoremap :setl ai cin si " GUI options if has('gui_running') set guifont=Monospace\ 10 :winpos 20 20 :set lines=40 :set columns=160 endif " vimtodo options " http://www.vim.org/scripts/script.php?script_id=3264 let g:todo_done_file="DONE" " spell checking setlocal spell spelllang=fr,en set nospell " Allows command completion (using ) :set wildmenu " ************************************************************************ " C O L O R T H E M E O P T I O N S " " solarized optons "let g:solarized_termtrans=1 let g:solarized_contrast="high" set background=dark " sets theme colorscheme solarized " Toggles background (dark vs. light theme) if !exists("no_plugin_maps") && !hasmapto('ToggleBackground') call togglebg#map("") endif " ************************************************************************ " B E G I N A U T O C O M M A N D S " if has("autocmd") " Enable file type detection. " Use the default filetype settings, so that mail gets 'tw' set to 72, " 'cindent' is on in C files, etc. " Also load indent files, to automatically do language-dependent indenting. filetype plugin indent on " Add an autocommand to update serial in bind zone files command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UpdateDNSSerialZone(submatch(1), submatch(2)) . submatch(3)/gc autocmd BufWritePre /etc/bind/db.* Soa endif " ************************************************************************ " F U N C T I O N S " " This function is used to update the serial in the SOA from a bind file function! UpdateDNSSerialZone(date, num) if (strftime("%Y%m%d") == a:date) return a:date . a:num+1 endif return strftime("%Y%m%d") . '01' endfunction