" ************************** " * vim general options **** " ************************** set nocompatible set history=1000 set mouse=a " don't have files trying to override this .vimrc: set nomodeline " have prompt for a help topic, rather than displaying the introduction " page, and have it do this from any mode: nnoremap :help vmap omap map! set title " ************************** " * set visual options ***** " ************************** set nu set ruler " syntax highlighting for colour enabled terminals if has('syntax') && (&t_Co > 2) syntax on endif " set background=dark colorscheme desert set wildmenu set wildmode=list:longest,full " use "[RO]" for "[readonly]" set shortmess+=r set scrolloff=3 " display the current mode and partially-typed commands in the status line: set showmode set showcmd " don't make it look like there are line breaks where there aren't: set nowrap " ************************** " * set editing options **** " ************************** set autoindent filetype plugin indent on set backspace=eol,indent,start autocmd FileType text setlocal textwidth=80 autocmd FileType make set noexpandtab shiftwidth=8 " * Search & Replace " make searches case-insensitive, unless they contain upper-case letters: set ignorecase set smartcase " show the `best match so far' as search strings are typed: set incsearch " assume the /g flag on :s substitutions to replace all matches in a line: set gdefault " *************************** " * tab completion ********** " *************************** setlocal omnifunc=syntaxcomplete#Complete imap inoremap =InsertTabWrapper() " *************************** " * keyboard mapping ******** " *************************** imap :tabn 1i imap :tabn 2i imap :tabn 3i imap :tabn 4i imap :tabn 5i imap :tabn 6i imap :tabn 7i imap :tabn 8i imap :tabn 9i map :tabn 1 map :tabn 2 map :tabn 3 map :tabn 4 map :tabn 5 map :tabn 6 map :tabn 7 map :tabn 8 map :tabn 9 " *************************** " * Utilities Needed ******** " *************************** function InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction " end of .vimrc