From e86ee645f5f56a6b3fe3f6d97c6d5eb64070616f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 14 Jan 2008 21:25:49 +0000 Subject: [PATCH] Set GUI options more elegantly. Removed C/Perl mode mapping. Use filetype indent instead. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@92 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .vimrc | 47 ++++------------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/.vimrc b/.vimrc index 3a2f754..d10c4d7 100644 --- a/.vimrc +++ b/.vimrc @@ -79,7 +79,7 @@ autocmd! let oldcols=&columns " More GUI options. Add icon, tearoffs and toolbar. -se go=agilmrtT +se go+=itT " Allow dynamic window resize even if we aren't in an xterm. se t_WS=[8;%p1%d;%p2%dt @@ -170,46 +170,10 @@ endfun " Restore window size. au VimLeave * if exists("oldcols") | let &columns=oldcols | endif -" Map C mode. -au BufEnter * if &ft == "c" || &ft == "cpp" | call CMode_map() | endif -au BufLeave * if &ft == "c" || &ft == "cpp" | call CMode_unmap() | endif - -" Map Perl mode. -au BufEnter * if &ft == "perl" | call PerlMode_map() | endif -au BufLeave * if &ft == "perl" | call PerlMode_unmap() | endif - " Map Makefile mode. au BufEnter * if &ft == "make" | call MakeMode_map() | endif au BufLeave * if &ft == "make" | call MakeMode_unmap() | endif -" Entering C mode. -fun! CMode_map() - let oldcinkeys=&cinkeys - let oldcinwords=&cinwords - set cinkeys=0{,0},:,0#,!^F,o,O,e - set cinwords=if,else,while,do,for,switch -endfun - -" Leaving C mode. -fun! CMode_unmap() - set cinkeys=oldcinkeys - set cinwords=oldcinwords -endfun - -" Entering Perl mode. -fun! PerlMode_map() - let oldcinkeys=&cinkeys - let oldcinwords=&cinwords - set cinkeys=0{,0},:,!^F,o,O,e - set cinwords=if,else,while,do,for,eval -endfun - -" Leaving Perl mode. -fun! PerlMode_unmap() - set cinkeys=oldcinkeys - set cinwords=oldcinwords -endfun - " Entering Make mode. fun! MakeMode_map() set list @@ -232,6 +196,9 @@ endif if version >= "600" version 6.0 +" Set indenting by filetype. +filetype indent on + " Track changing number mode. let g:numbercols=&columns let g:numberchanges=0 @@ -378,12 +345,6 @@ map Qt :Tlist " Clear search pattern with Q/. map Q/ :let @/="": -" Leaving Perl mode. -fun! PerlMode_unmap() - set cinkeys=oldcinkeys - set cinwords=oldcinwords - set foldmethod=manual -endfun endif """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- 2.20.1