" " Bindu's vimrc file based on "An example for a vimrc file." " " Maintainer: Bindu Wavell " Last change: 2006 Nov 28 " " When started as "evim", evim.vim will already have " done these settings. if v:progname =~? "evim" finish endif " Set the vim current directory to be the directory " that the file in the current buffer is in. autocmd BufEnter * :lcd %:p:h " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options " as a side effect. set nocompatible set backspace=indent,eol,start " allow backspacing over " everything in insert mode set autoindent " always set autoindenting on set nobackup " don't keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set nowrap " make sure that long lines don't wrap set incsearch " perform incremental search set background=dark " Make sure we have a nice dark background set ch=2 " Make command line two lines high set laststatus=2 " Make sure the status line is always displayed " Try and enable color for xterms if &term =~ 'xterm' if has("terminfo") set t_Co=8 set t_Sf=[3%p1%dm set t_Sb=[4%p1%dm else set t_Co=8 set t_Sf=[3%dm set t_Sb=[4%dm endif endif " If we have a few colors or were running in gui mode if &t_Co > 2 || has("gui_running") " Switch syntax highlighting on syntax enable " Switch on highlighting of the last used search pattern. set hlsearch endif " Make external commands work through a pipe instead of a pseudo-tty "set noguipty " set the X11 font to use " set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 " Display bufnr:filetype (dos,unix,mac) in status line set statusline=%<%n:%f%h%m%r%=%{&ff}\ %l,%c%V\ %P " Hide buffers when they are abandoned rather " than unloading it. set hidden " Hide the mouse pointer while typing " The window with the mouse pointer does not " automatically become the active window " Right mouse button extends selections " Turn on mouse support set mousehide set nomousefocus set mousemodel=extend set mouse=a " Show paren matches " For 5 tenths of a second set showmatch set matchtime=5 " Setup tabs for 4 spaces set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab set shiftround set expandtab " Setup indenting set autoindent set smartindent " Enable wild menus set wildmenu " Nice default colorscheme colorscheme ron " Setup pasting for windows if has("win32") " regular yanks, etc go into the windows clipboard set clipboard=unnamed " visual selection is put into the windows clipboard set go+=a endif " Working on building nice development environment "map v :vsplit:vertical resize 20:Explorelsz1jh " === COMMAND MAPPINGS === " DOS to Unix conversion (remove ^M) " added mark (m) so we end up where we started noremap D mmHmt:%s///ge'tzt'm " VIM Ascii table noremap A :help digraph-table " Edit a file in the same directory as the current file noremap e :e =expand("%:p:h") . "/" " Retag the parent of the current folder noremap r :!fndtags " Map H to stop highlighting search matches noremap H :set hlsearch! " Make shift-insert work like in Xterm noremap noremap! " === COMMAND/FOLD MAPPINGS === " Fold Block - anywhere in or on block except closing brace noremap fb j[[zfaB " Fold Comment - anywhere in or on a block comment noremap fc j[*zf]* " Fold Mark - Fold to the a mark noremap fm zf'a " Delete a Fold noremap fd zd " === INSERT MAPPINGS === " VIM Calculator; type equation in insert mode, " then press inoremap c yiW==0 inoremap \sig Sincerely,Bindu Wavell blissDROP Computer ConsultingTel: 720-436-8146ggddOFrom: Bindu Wavell inoremap \zsig Sincerely,Bindu Wavell Zia ConsultingTel: 720-436-8146ggddOFrom: Bindu Wavell inoremap \fsig Sincerely,Bindu Wavell Flatirons SolutionsTel: 720-436-8146ggddOFrom: Bindu Wavell " === NORMAL MAPINGS === " make ' goto exact location of map (rather than the " beginning of the line where the map is) nnoremap ' ` " make ` execute the contents of the a register nnoremap ` @a " allow . to execute once for each line of a visual selection vnoremap . :normal . " allow ` to execute the contents of the a register once " for each line of a visual selection vnoremap ` :normal @a " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvdi=current_reg " === PLUGIN SETTINGS === " MiniBufExplorer "let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapCTabSwitchBufs = 1 "let g:miniBufExplorerDebugMode = 3 "let g:miniBufExplorerDebugLevel = 10 "let g:miniBufExplModSelTarget = 1 "let g:miniBufExplUseSingleClick = 1 "let g:miniBufExplVSplit = 20 "let g:miniBufExplorerMoreThanOne = 0 "let g:miniBufExplMaxSize = 30 "let g:miniBufExplMinSize = 4 "let g:miniBufExplTabWrap = 1 "let g:miniBufExplSplitBelow = 1 " below for vert = right "let g:miniBufExplSplitToEdge = 0 " 1 is default "hi MBENormal guifg=cyan "hi MBEChanged guifg=red "hi MBEVisibleNormal guibg=darkblue guifg=yellow "hi MBEVisibleChanged guibg=red guifg=yellow "map :UMiniBufExplorer "map :TMiniBufExplorer " TagList if has("win32") let Tlist_Ctags_Cmd = 'C:\\bin\\ctags531\\ctags.exe' endif let Tlist_Use_SingleClick = 1 " === AUTOCMD SETTINGS === " Only do this part when compiled with support for autocommands. 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 " Put these in an autocmd group, so that we can " delete them easily. augroup vimrcEx " Remove all vimrcEx autocommands au! " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif augroup END " The following should probably be handled " by the c language files... check sometime 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 java set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// set tags=./tags,../tags,../../tags,../../../tags,../../../../tags " Automatically save view information about " each file that is edited and restore the " settings (persists between VIM invocations.) au BufWinLeave *.c,*.cpp,*.h mkview au BufWinEnter *.c,*.cpp,*.h silent loadview augroup END endif " has("autocmd")