Wednesday, September 30, 2009

my ~/.vimrc

"-------------------------------------
" always show this custom status line
set notitle       " to avoid vim renaming the title of the xterm window
set nonumber      " we don't need line numbers on the left, because we have status line
set laststatus=2  " always show the status line
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ %{strftime(\"%c\",getftime(expand(\"%:p\")))}%=\ col:%c%V\ line:%l\,%L\ %P
" -------------------------------------
" use 2-space indentation
" set tabstop=2     " read :help tab for explanation of tabstop, softtabstop, shiftwidth
" set softtabstop=2 "
set shiftwidth=2  "
" set expandtab     " inserts spaces instead of tab (for real tab use ctrl-V - tab)
" -------------------------------------
set showmatch     " When a bracket is inserted, briefly jump to the matching one if it is visible on the screen.
set matchtime=3
" -------------------------------------
" set autoindent
" set smartindent
" set paste       " you can set paste temporarily, but be aware that it interferes with autoindent
                  " it turns it off (and many other settings). Read :help paste
" -------------------------------------
set incsearch     " search incremental
set ignorecase    " search case-insensitive
set smartcase     " search case-insensitive for small chars, case-sensitive if at least 1 capital char
set nohlsearch    " search highlighting
" -------------------------------------
" This only works if you have plugin under .vim in home dir
" or if you include here a command to source plugin, for example:
"   source ~lselector/lselector/.vim/plugin/taglist.vim
:map :TlistToggle
let Tlist_Exit_OnlyWindow = 1
" -------------------------------------

set ignorecase
set smartcase
set incsearch
set title
set wrap
set wildmenu
set noautoindent smartindent
set hlsearch
set paste
set ic

set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab

match ErrorMsg '\%>80v.\+'
match

nnoremap :set invpaste paste?
set pastetoggle=
set showmode

nnoremap :set nowrap!
"set wrap!=
"set showmode

":set mouse=a
":map
":map
":map
":map

:map
:map
noremap :call ToggleMouse()

function! ToggleMouse()
  if &mouse == 'a'
    set mouse=
  else
    set mouse=a
  endif
endfunction

if match($TERMCAP, 'Co#256:') == 0 || match($TERMCAP, ':Co#256:') > 0          
      set t_Co=256                                                               
endif

command -nargs=1 T2 :2match Search //




2nd paragraph is for not putting tab as /t ( instead, put it as 2 spaces).
3rd paragraph is for limiting column to 80. It will start highlighting if it goes after 80. For undoing it in some cases you can say ':match'.

No comments:

Post a Comment