Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1e306dda22
Fetching contributors…

Cannot retrieve contributors at this time

118 lines (91 sloc) 3.861 kb
set nocompatible " I want Vim
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
map r :redo<CR>
" have syntax highlighting in terminals which can display colours:
if has('syntax') && (&t_Co > 2)
syntax on
se hlsearch
set background=dark
endif
set incsearch
set ruler
set history=1000
" remember all of these between sessions, but only 10 search terms; also
" remember info for 10 files, but never any on removable disks, don't remember
" marks in files, don't rehighlight old search patterns, and only save up to
" 100 lines of registers; including @10 in there should restrict input buffer
" but it causes an error for me:
set viminfo=/10,'10,r/mnt/zip,r/mnt/floppy,f0,h,\"100
" 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).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" have command-line completion <Tab> (for filenames, help topics, option names)
" first list the available options and complete the longest common part, then
" have further <Tab>s cycle through the possibilities:
set wildmode=list:longest,full
" use "[RO]" for "[readonly]" to save space in the message line:
set shortmess+=r
" display the current mode and partially-typed commands in the status line:
set showmode
set showcmd
set showmatch
" don't have files trying to override this .vimrc:
set nomodeline
set softtabstop=4
set tabstop=4
set expandtab
set autoindent
set shiftwidth=4
" wildmenu
"set wildmode=longest:full
"set wildmenu
" * Text Formatting -- Specific File Formats
" enable filetype detection:
filetype on
" recognize anything in my .Postponed directory as a news article, and anything
" at all with a .txt extension as being human-language text [this clobbers the
" `help' filetype, but that doesn't seem to prevent help from working
" properly]:
augroup filetype
autocmd BufNewFile,BufRead *.txt set filetype=human
autocmd BufNewFile,BufRead *.tmpl set filetype=html
autocmd BufNewFile,BufRead *.tt set filetype=html
autocmd BufNewFile,BufRead *.pod set filetype=human
autocmd BufNewFile,BufRead *.t set filetype=perl
autocmd BufNewFile,BufRead *.psgi set filetype=perl
autocmd BufNewFile,BufRead *.wsgi set filetype=python
augroup END
" in human-language files, automatically format everything at 72 chars:
autocmd FileType human set formatoptions+=t textwidth=72
" for C-like programming, have automatic indentation:
autocmd FileType c,cpp,slang set cindent
" for actual C (not C++) programming where comments have explicit end
" characters, if starting a new line in the middle of a comment automatically
" insert the comment leader characters:
autocmd FileType c set formatoptions+=ro
" for Perl programming, have things in braces indenting themselves:
autocmd FileType perl set smartindent
" for CSS, also have things in braces indented:
autocmd FileType css set smartindent
" for HTML, generally format text, but if a long line has been created leave it
" alone when editing:
autocmd FileType html set formatoptions+=tl
" for both CSS and HTML, use genuine tab characters for indentation, to make
" files a few bytes smaller:
autocmd FileType html,css set noexpandtab tabstop=4
" apply the color scheme before hightlight settings
colorscheme desert256
" trailing whitespace highlighting
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
Jump to Line
Something went wrong with that request. Please try again.