"========================================================== " " this file at http://gorwits.me.uk/data/files/vimrc " "========================================================== " this section for basic stuff set nocompatible syntax on set backspace=indent,eol,start set number set background=dark set ruler set autoindent " mouse movement/srolling (shift-select to copy) set mouse=a " for PuTTY set ttymouse=xterm2 set tabstop=4 set softtabstop=4 set expandtab autocmd FileType make setlocal noexpandtab autocmd BufEnter * :syntax sync fromstart " hack for perl t/*.t module test files autocmd FileType tads set filetype=perl set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc set shiftwidth=4 set shiftround set encoding=utf8 set fileformats=unix,dos set showmatch set scrolloff=10 "allow one-line scroll from within insert mode inoremap inoremap "========================================================== " this section for fancier setup " allow shift+TAB to create a real TAB (for makefiles) inoremap " display real TABs as >--- set listchars=tab:>- set list " then also colour real TAB areas blue highlight TabChar ctermfg=lightblue match TabChar /\t/ " nicer colour for comments and line numbers highlight Comment ctermfg=DarkGreen highlight LineNr ctermfg=DarkGreen " highlight the character on col 79 "highlight Col79 ctermbg=red "match Col79 /\%<80v.\%>79v/ " repeat - there's a bug in this config? set background=dark "========================================================== " this section for hotkey toggle setup " hotkey F2 to reformat current paragraph map gq} " hotkey F5 to toggle highlighting of real TABs nnoremap \tl :set invlist list? nmap \tl imap \tl " hotkey F4 toggles highlighting search locations nnoremap \th :set invhls hls? nmap \th imap \th " default is to have wrapping ON set wrap set sidescroll=5 set listchars+=precedes:<,extends:> " by default text will not be auto-wrapped at 78 chars, " but setup hotkey F6 to toggle this on and off. " the VimEnter autocmd line is needed due to a Fedora bug set textwidth=78 autocmd VimEnter * set formatoptions-=t nnoremap \tf :if &fo =~ 't' set fo-=t else set fo+=t endif set invwrap wrap? nmap \tf imap \tf " hotkey F7 to toggle paste mode nnoremap \tp :set invpaste paste? nmap \tp imap \tp set pastetoggle= " hotkey F8 to toggle line numbers nnoremap \tn :set invnumber number? nmap \tn imap \tn "========================================================== " this section for memos... ":TOhtml