" My vimrc file " " : hi LineNr term=none "turn off auto paren matching :let loaded_matchparen=1 syntax off set number "set ai sm sw=4 set ai sw=4 set smartindent "set noic set ignorecase set showmode set tabstop=4 "set expandtab " " " write a backup copy of the file being edited to $HOME/vibak/... if !exists("autocoms_loaded") augroup mkm au! mkm let autocoms_loaded = 1 au BufReadPost * exe 'write! ' substitute(expand("$HOME") . '/vibak/' . substitute(substitute(expand("%:p"), '/', '_', 'g'),'_','','').'-'.strftime("%Y%m%d.%H%M%S"),' ','_','g') au BufEnter *.py set expandtab endif " "set backup "au BufWritePre * let &bex = '-' . strftime("%Y%m%d.%H%M%S") "au BufWritePre * let &bex = '-' . expand("%:p") . '-' . strftime("%Y%m%d.%H%M%S") "au BufWritePre * let &backupext = '-' . substitute("abc", "b", "x", "") "au BufWritePre * let &backupdir = expand("$HOME") . '/vibak' " "au BufWritePre * let &backupext = substitute(expand("%:p"), "\/", "_", "g") . '-' . strftime("%Y%m%d.%H%M%S") " " " " "set backupdir=/vibak " " " The Super .exrc File " " An assorted collection of macros from various users. " Compiled and edited by Anthony Howe " " " From: nessie.cs.id.ethz.ch!wyle (Mitchell Wyle) " Reformat a complete paragraph. ":map F {j!}fmt --width=24 }be :map F {j!}fmt }be " " " From: Dave Myers " Goto top of file. Complement of G. :map g 1G :map  $GG " META MACROS, all begin with meta-key '\' ; more later in file " " COMMENTING MACROS -- these are actually pretty amazing " duplicate a line :map  yypj " " from edit mode, this comments a line :map !!ccomment j0 ":map  0i/* A */^ ":map  0i/* $76a 074 DA*/j0 ":map  0i-- j " ":map  0i# j ":map  :s/^# //j :map  0i// j :map  :s/\/\/ //j " " and this undoes it ":map  :s/\/\* \([^*]*\) \*\//\1j ":map  :s/\/\* \([^*]*\) \*\//\1:s/ *$//j ":map  :s/^--//j " " Center Text and Other assorted macros. " From: Dave Beyerl " Center text on 70 columns " :map C :s/[ ]*// $ma71a 71|D`alxd0:s/ / /g $p " ^ ^ tab ^ escape " ^ not escape :map C :s/[ ]*//$99a 079 D?[^ ] D0P:s/ / /g " " :map  :set number :map  :set nonumber :map  /^From\\|^### :map  :set noai " ":map X :.w! ~/.vi/%ZZ ":map X :.,+3w! ~/.vi/%ZZ ":map X :.,+3w !vi.save.pos %ZZ ":map X :.,+3w !vi.save.pos %ZZ " " ############ " end of .exrc " ############ "if has("autocmd") " augroup cprog " Remove all cprog autocommands " au! " When starting to edit a file: " For C and C++ files set formatting of comments and set C-indenting on. " For other files switch it off. " Don't change the order, it's important that the line with * comes first. " autocmd FileType * set formatoptions=tcql nocindent comments& " autocmd FileType c,cpp set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// " autocmd FileType c,cpp :map  0i// j " autocmd FileType c,cpp :map  :s/\/\/ //j " autocmd FileType * :map  :s/^# //j " autocmd FileType * :map  0i# j "autocmd FileType py set expandtab " augroup END "endif " has("autocmd")