Here is my .vimrc file.
This might be a bit long...

"""""""""""""""""""""""""""""""""""""""""""""""
"        Generic
"""""""""""""""""""""""""""""""""""""""""""""""
"not compatible for vi, and make <- works
set nocompatible
set backspace=2

" Lines of history Vim need to remember
set history=800

" enable filetype plugin
filetype plugin on
filetype indent on

" Auto read if file is changed outside
set autoread

" Set <Leader> mapping to use more combinations
let mapleader=","
let g:mapleader=","

" Quick key sets using <leader> key
nmap <leader>w :w!<cr>
nmap <leader>q :q<cr>
nmap <leader>e :e ~/.vimrc<cr>

" enable C-C, C-V
map <C-q> <C-v>
map <C-V> "+gP
cmap <C-V> <C-R>+
vnoremap <C-C> "+y

"auto reload vimrc
autocmd! bufwritepost .vimrc source %

"""""""""""""""""""""""""""""""""""""""""""""""
"        Interface
"""""""""""""""""""""""""""""""""""""""""""""""
" use wild menu
set wildmenu
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,
                \*.jpg,*.gif,*.png

" always show current position
set ruler

" set commander bar height
set cmdheight=2

" ignore case for searching
set ignorecase
set smartcase

set hlsearch
set incsearch

" don't redraw while executing macro
set nolazyredraw

" set magic on for regex
set magic

" show matching bracet
set showmatch

" how many sec to blink the cursor
set mat=2

" no sound on error
set noerrorbells
set novisualbell

" set 256 color for vim
if version >= 700 && &term != 'cygwin' && !has('gui_running')
    " In the color terminal, try to use CSApprox.vim plugin or
    " guicolorscheme.vim plugin if possible in order to have
consistent
    " colors on different terminals.
    "
    " Uncomment one of the following line to force 256 or 88 colors if
    " your terminal supports it. Or comment both of them if your
terminal
    " supports neither 256 nor 88 colors. Unfortunately, querying the
    " number of supported colors does not work on all terminals.
    set t_Co=256
    if &t_Co == 256 || &t_Co == 88
        " Check whether to use CSApprox.vim plugin or
guicolorscheme.vim plugin.
        if has('gui') &&
                    \ filereadable(expand("$HOME/.vim/plugin/
CSApprox.vim"))
            let s:use_CSApprox = 1
        elseif filereadable(expand("$HOME/.vim/plugin/
guicolorscheme.vim"))
            let s:use_guicolorscheme = 1
        endif
    endif
endif

if exists('s:use_CSApprox')
    " Can use the CSApprox.vim plugin.
    let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' :
'' }
    colorscheme desert
elseif exists('s:use_guicolorscheme')
    " Can use the guicolorscheme plugin. It needs to be loaded before
    " running GuiColorScheme (hence the :runtime! command).
    runtime! plugin/guicolorscheme.vim
    GuiColorScheme desert
else
    colorscheme desert
endif

"""""""""""""""""""""""""""""""""""""""""""""""
"      Color and font
"""""""""""""""""""""""""""""""""""""""""""""""
" syntax highlight
syntax enable

set gfn=Monospace\ 12

" set shell
set shell=/bin/tcsh

"set encoding
set encoding=utf8

" default file type
set ffs=unix,dos,mac


"""""""""""""""""""""""""""""""""""""""""""""""
"        Backup and undo
"""""""""""""""""""""""""""""""""""""""""""""""
" no backup needed
set nobackup
set nowb
set noswapfile

"set undo dir
if version >= 730
  set undodir=~/.vim/undodir
endif


"""""""""""""""""""""""""""""""""""""""""""""""
"        Tab, text, indent
"""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab

set lbr
set tw=500

set autoindent
set smartindent
set wrap


"""""""""""""""""""""""""""""""""""""""""""""""
"        Key bindings
"""""""""""""""""""""""""""""""""""""""""""""""
" mapping window moving
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l

" tab operations
map <leader>t :tabnew<cr>
map <C-left> :tabprev<cr>
map <C-right> :tabnext<cr>

"bind Space for page down, shift-Space for page up
noremap <space> <C-d>
noremap <S-space> <C-b>

"""""""""""""""""""""""""""""""""""""""""""""""
"        Status line
"""""""""""""""""""""""""""""""""""""""""""""""
" always show the bar
set laststatus=2

" bar format

set statusline=
set statusline +=%1*\ %n\ %*            "buffer number
set statusline +=%5*%{&ff}%*            "file format
set statusline +=%3*%y%*                "file type
set statusline +=%4*\ %<%F%*            "full path
set statusline +=%2*%m%*                "modified flag
set statusline +=%1*%=%5l%*             "current line
set statusline +=%2*/%L%*               "total lines
set statusline +=%1*%4c\ %*             "column number
set statusline +=%2*0x%04B\ %*          "character under cursor

hi User1 guifg=#eea040 guibg=#222222
hi User2 guifg=#dd3333 guibg=#222222
hi User3 guifg=#ff66ff guibg=#222222
hi User4 guifg=#a0ee40 guibg=#222222
hi User5 guifg=#eeee40 guibg=#222222

"""""""""""""""""""""""""""""""""""""""""""""""
"       Omni Auto complete
"""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType css set omnifunc=csscomplete#CompleteCSS


"""""""""""""""""""""""""""""""""""""""""""""""
"       Folding
"""""""""""""""""""""""""""""""""""""""""""""""
" set folding on
set foldenable

"dont auto folding
set foldlevel=100

"what movement will open fold
set foldopen=block,hor,mark,percent,quickfix,tag

" Custom fold text function
function! SimpleFoldText()
    return getline(v:foldstart).' '
endfunction

set foldtext=SimpleFoldText()

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to