Saturday, November 11, 2006

vimrc

Vim can be one of the most powerful editors, however there is several annoyances that come with here. But thankfully its highly customizable, to customize vim you will need a file called a .vimrc file and you put this in your home directory. Here is how mine look like with comments


"----------------------------------------------------
" vimrc file for ed lim
" @author - Ed Lim
"----------------------------------------------------

"------------ editor behaviour block ------------------
set ruler " show curser position at all times
set sw=8 " Use 8 spaces when text is indented
set tabstop=8 " sets how many spaces a tab is
"set ai " auto indent
"set si " smart indent - attempts to guess where to indent
set et " tabs converted to spaces, uncomment when needed
set incsearch " incremental search
set nohlsearch " no highlight on searching
set nowrapscan " turn off search wrapping
set nowrap " no text wraps
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set term=ansi
"set background=dark " user brighter color if xterm has a dark background
set noerrorbells " do not beep on errors
set ttyfast " Smoother scrolling
set mouse=a " have mouse enabled at all time
set virtualedit=all " allows curser to roam freely
set backspace=2 " allows backspacing over everything
set showmode " show current mode you are in
set showcmd " display incomplete commands
set showmatch " show matching braces
set undolevels=500 " set the number of undo's
set novisualbell " no sound on error
set t_vb= " turn off error bells
set noerrorbells " No sound on error
set title " Shows title in console window
set ls=2 " always show status line
set foldmethod=marker " fold method using markers
"set foldmethod=indent " fold method using indent

"-------------- backup block ------------------
set backup
set backupdir=$HOME/.VimData/vimbak
set directory=$HOME/.VimData/vimtmp
set errorfile=$HOME/.VimData/vimtmp/errors.vim

"------------ Graphical block -----------------
syntax on " Turns on syntax highlighting
set nu " Line numbers

"------------- Color definitions ----------------
hi Comment terM=bold cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
hi Constant term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
hi Special term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=SlateBlue guibg=NONE
"hi Identifier term=bold cterm=NONE ctermfg=Black ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
hi Statement term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=bold guifg=Brown guibg=NONE
hi PreProc term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=Purple guibg=NONE
hi Type term=underline cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
hi Underlined term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
hi Ignore term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
"hi LineNr term=underline ctermfg=Black guifg=Black

" --------- key mappings --------------
" F1 show buffers
map <f1> :buffer<cr>

" F2 select buffer
map <f2> :buffer

1 comment:

The Red Setter said...

This is a worthy site. I just surfed onto it by accident, but I like. You have a very clear way of writing. I'm not that good with computers (I get by), but.... great site, dude. See ya round!