" Mike Makuch's vimrc file
"
: hi LineNr term=none
"turn off auto paren matching
:let loaded_matchparen=1
syntax off
set nohlsearch
set number
set autoindent
set smartindent
"set noic
set ignorecase
set smartcase
set showmode
set tabstop=4
set shiftwidth=4
"set expandtab
set smarttab
"set paste
"set scs
set formatoptions=tcqlw nocindent comments&
:map  :s/^# //j
:map  0i# j
:set nohls
"
:filetype on
:filetype plugin on
"set foldmethod=indent
"set foldcolumn=0
"set foldlevel=0
":set verbose=9
"
" write a backup copy of the file being edited to $HOME/vibak/... upon write
if !exists("autocoms_loaded")
	augroup mkm
	au! mkm
	let autocoms_loaded = 1
	au mkm BufWritePre * exe 'write! ' substitute(expand("$HOME") . '/vibak/' . substitute(substitute(expand("%:p"), '/', '_', 'g'),'_','','').'-'.strftime("%Y%m%d.%H%M%S"),' ','_','g')
endif
"
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
     \ if line("'\"") > 0 && line("'\"") <= line("$") |
     \   exe "normal! g`\"" |
     \ endif

"
"Reformat a complete paragraph.
":map F {j!}fmt --width=24
}be
:map F {j!}fmt -w 90
}be
"
"
"	From: Dave Myers 
"	Goto top of file.  Complement of G.
:map g 1G
":map  $GG
"
"	COMMENTING MACROS -- these are actually pretty amazing
" duplicate a line
":map  yypj
"
"	from edit mode, this comments a line
":map  !!ccomment
j0
"
":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   :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
""
""
fu! SaveSess()
    execute 'mksession! ' . getcwd() . '/.session.vim'
endfunction

fu! RestoreSess()
if filereadable(getcwd() . '/.session.vim')
    execute 'so ' . getcwd() . '/.session.vim'
    if bufexists(1)
        for l in range(1, bufnr('$'))
            if bufwinnr(l) == -1
                exec 'sbuffer ' . l
            endif
        endfor
    endif
endif
"syntax on
endfunction

"autocmd VimLeave * call SaveSess()
"autocmd VimEnter * call RestoreSess()
"
" ############
" end of .exrc
" ############
:nnoremap  :bnext
:nnoremap  :bprevious

"set iskeyword=@,48-57,_,192-255,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94,x,y,z
"set iskeyword=33-47,58-64,91-96,123-127
"set iskeyword=@,48-57,_,192-255

":set nocompatible
":filetype indent plugin on
":syntax on

set iskeyword-=.
:map  :set iskeyword-=.
set autoindent
set smartindent

:source ~/.vim/plugin/matchit.vim
runtime vimrc_example.vim 

" make matchit work on C-like filetypes 
" " c and cpp are already handled by their ftplugin 
au Filetype css,javascript 
         \ let b:match_words = &matchpairs 

set nohlsearch

"  redraws the screen and removes any search highlighting.
nnoremap   :nohl

set noincsearch


set nobackup
set nowritebackup

:map  :tabp
:map  :tabn