The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
" TAGS
set tags=tags,../tags,../../tags,../../../tags,../../../../tags,../../../../../tags
" remap ctrl+[ to use cscope
autocmd BufEnter *.php set cst
" but try standard ctags for the unique match first
set csto=1
" backup handling
set nobackup
set writebackup
" do not highlight search result
set nohlsearch
" filetype-specific issues
autocmd BufEnter *.tex setlocal textwidth=80
autocmd BufNewFile,BufRead *.cpy,*.vpy setf python
autocmd BufNewFile,BufRead *.cpt,*.pt setf html
autocmd BufEnter */vimperator-*.tmp setlocal linebreak
autocmd BufNewFile,BufRead,BufRead COMMIT_EDITMSG setlocal spell
" rows numbering
" autocmd BufEnter *.tex setlocal number
" show a ruler with line number, % through file on status line
set ruler
" ident just 2 chars in HTML
" autocmd BufEnter *.htm? set tabstop=2 shiftwidth=2 softtabstop=2
" ident 8 chars in C
autocmd BufEnter *.c set tabstop=8 shiftwidth=8 softtabstop=8
" Do smart indentation depending on code syntax (e.g. change after { }, keywords etc)
set smartindent
" PHP Moodle and Mahara coding style
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab
" automatically indent files
set autoindent
set backspace=indent,eol,start
" ctrl-d and ctrl-u for scrolling by one line
set scroll=1
syntax on
colorscheme mudrd8mz
" highlight trailing whitespace
:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+\%#\@<!$/
:au InsertEnter * match ExtraWhiteSpace /\s\+\%#\@<!$/
:au InsertLeave * match ExtraWhiteSpace /\s\+$/
" latexSuite tips
filetype plugin on
set grepprg=grep\ -nH\ $*
filetype indent on
" Restore your cursor position in a file over several editing sessions.
set viminfo='10,\"100,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
au BufEnter COMMIT_EDITMSG :normal 1G
" (), ] or }) matching
set showmatch
map <PageDown> :set scroll=0<CR>:set scroll^=2<CR>:set scroll-=1<CR><C-D>:set scroll=0<CR>
map <PageUp> :set scroll=0<CR>:set scroll^=2<CR>:set scroll-=1<CR><C-U>:set scroll=0<CR>
" F5 put a Moodle debugging msg
map <F5> oprint_object(); die(); // DONOTCOMMIT<Esc>23hi
" F8 taglist
let Tlist_GainFocus_On_ToggleOpen = 1
map <F8><Esc> :TlistToggle<CR>
nnoremap <silent> <F8> :TlistToggle<CR>
" F9 save and run make
map <F9> :w<CR>:!make<CR>
" F10 toggle the insert mode for mouse middle button clipboard paste
map <F10> :call Paste_on_off()<CR>
set pastetoggle=<F10>
let paste_mode = 0 " 0 = normal, 1 = paste
func! Paste_on_off()
if g:paste_mode == 0
set paste
let g:paste_mode = 1
else
set nopaste
let g:paste_mode = 0
endif
return
endfunc
" F12 switch encoding to latin2
map <F12> :call Switch_to_latin2()<CR>
func! Switch_to_latin2()
e ++enc=latin2
endfunc
" Fix problem with latex-vim suite and central european diacritics
imap <S-F4>L <Plug>Tex_LeftRight
imap <S-F4>I <Plug>Tex_InsertItem
"
" Mapping for mouse wheel support - see ~/.Xdefaults
"
":map <M-Esc>[62~ <MouseDown>
":map! <M-Esc>[62~ <MouseDown>
":map <M-Esc>[63~ <MouseUp>
":map! <M-Esc>[63~ <MouseUp>
":map <M-Esc>[64~ <S-MouseDown>
":map! <M-Esc>[64~ <S-MouseDown>
":map <M-Esc>[65~ <S-MouseUp>
":map! <M-Esc>[65~ <S-MouseUp>
" <Backslash>+p is mapped to run the current buffer through a Python
" interpreter. The output appears in a new window below the current one.
" This uses the handy preview window feature of Vim. Flagging a window as a
" preview window is useful because you can use pclose! to get rid of it,
" meaning you can reuse that vim real estate over and over for commands that
" produce output, and the output has to go somewhere.
" http://strongdynamic.blogspot.com/2007/10/vim-run-current-buffer-as-python-code.html
func! DoRunPyBuffer2()
pclose! " force preview window closed
setlocal ft=python
" copy the buffer into a new window, then run that buffer through python
sil %y a | below new | sil put a | sil %!python