All pastes #635557 Raw Edit

Someone

public text v1 · immutable
#635557 ·published 2007-07-27 05:04 UTC
rendered paste body
" This is a modified example vimrc

set tabstop=4
set shiftwidth=2
set expandtab
set enc=utf-8

set nocompatible
set backspace=indent,eol,start
set nobackup
set history=100
set ruler
set showcmd
set incsearch
if version>=700
  set cursorline
  if has("gui_running")
    set tabpagemax=200
  endif
endif

" sessions should restore gui window position and size as well
set sessionoptions+=resize,winpos

" Display last line even if it doesn't fit onto the screen completely
set display+=lastline

set path+=/System/Library/Frameworks/GLUT.framework/Headers/

" Don't use Ex mode, use Q for formatting
map Q gq

if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

if has("autocmd")

  au BufNewFile,BufRead *.tri set syntax=triangle

  filetype plugin indent on

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  autocmd FileType text setlocal textwidth=78

  autocmd BufNewFile,BufRead *.som setf st

  " 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

else

  set autoindent		" always set autoindenting on

endif " has("autocmd")

if has("cscope")
  set csto=0
  set cst  " Bind C-] to cscope
  set nocsverb
  " add any database in current directory
  if filereadable("cscope.out")
    cs add cscope.out
    " else add database pointed to by environment
  elseif $CSCOPE_DB != ""
    cs add $CSCOPE_DB
  endif
  set csverb

  nmap <C-->s :cs find s <C-R>=expand("<cword>")<CR><CR>
  nmap <C-->g :cs find g <C-R>=expand("<cword>")<CR><CR>
  nmap <C-->c :cs find c <C-R>=expand("<cword>")<CR><CR>
  nmap <C-->t :cs find t <C-R>=expand("<cword>")<CR><CR>
  nmap <C-->e :cs find e <C-R>=expand("<cword>")<CR><CR>
  nmap <C-->f :cs find f <C-R>=expand("<cfile>")<CR><CR>
  nmap <C-->i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
  nmap <C-->d :cs find d <C-R>=expand("<cword>")<CR><CR>

  " Using 'CTRL-spacebar' then a search type makes the vim window
  " split horizontally, with search result displayed in
  " the new window.

  nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
  nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
  nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>

  " Hitting CTRL-space *twice* before the search type does a vertical
  " split instead of a horizontal one

  nmap <C-Space><C-Space>s
      \:vert scs find s <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space><C-Space>g
      \:vert scs find g <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space><C-Space>c
      \:vert scs find c <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space><C-Space>t
      \:vert scs find t <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space><C-Space>e
      \:vert scs find e <C-R>=expand("<cword>")<CR><CR>
  nmap <C-Space><C-Space>i
      \:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
  nmap <C-Space><C-Space>d
      \:vert scs find d <C-R>=expand("<cword>")<CR><CR>
endif