talideon.com

Some assembly required

March 14, 2007 at 2:46PM My .vimrc

For my own reference and for those geeky enough to be interested in this kind of thing, here it is:

" Default tab settings: I like an indent of four across the board.
set tabstop=4
set softtabstop=4
set shiftwidth=4

" How I want Vim's GUI to appear.
set nocompatible " Get rid of the VI-isms I dislike.
set toolbariconsize=tiny
set ruler        " Show where we are in the file.
set showmode     " Because I'm stupid and like to know what mode I'm in.
set history=50
set visualbell
set showcmd
set nobackup
set incsearch
set backspace=indent,eol,start
set enc=utf-8
set tenc=utf-8
set laststatus=2

set statusline=%<%f%h%m%r%=%l,%c%V\ %P\ %{&ff}\

"set guifont=Monaco\ 8
set guifont=Consolas\ 9
syntax on
colors koehler

" Don't use Ex mode, use Q for formatting. Ex is annoying anyway.
map Q gq

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

" 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
  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

  " Settings for various modes.
  autocmd BufNewFile,BufRead,Syntax *.rb  setlocal sw=2 ts=2 sts=2 et
  autocmd BufNewFile,BufRead,Syntax *.scm setlocal sw=2 ts=2 sts=2 et

  " automatically give executable permissions if filename is *.pl
  au BufWritePost *.pl,*.cgi,*.sh :!chmod a+x <afile>

else

  set autoindent " always set autoindenting on

endif " has("autocmd")

let php_noShortTags=1
"let php_folding=1
set background=dark

" Sane tab navigation
nmap <A-PageUp>   :tabprevious<cr>
nmap <A-PageDown> :tabnext<cr>
map  <A-PageUp>   :tabprevious<cr>
map  <A-PageDown> :tabnext<cr>
imap <A-PageUp>   <ESC>:tabprevious<cr>i
imap <A-PageDown> <ESC>:tabnext<cr>i
nmap <C-n>        :tabnew<cr>
imap <C-n>        <ESC>:tabnew<cr>
Technorati Search Technorati Search Irish Bloggers

Comments

1 On March 14, 2007 at 15:51, Revence 27 wrote:

You know, mine should be somewhat similar. I don’t change much from the example file (usually somewhere in /usr/share/vim/vimXX/vimrcexample.vim).

It is rather similar to that. I just: =pre set autoindent set tabstop=4 set nobackup =/pre

That’s all I change.

2 On March 14, 2007 at 15:59, Revence 27 wrote:

Oh, God! Won’t I ever get Textuality right? :-(

Post a comment

All form information is optional, but it’s a good idea to fill in your name and email address if you want me to take your comment seriously.

Spammers, don’t bother posting crap down here. The site is set up so that legitimate search engines (Google, for instance) won’t index pages with comments on them. Posting crud here only means you’re wasting my time and patience. Shoo!

Real names, please. Please include!
Won’t be displayed. Please include!
Displayed, if present.