[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Vim configuration



Hej

Vedlagt er mit eget cvs hack. Hvis et dokument indeholder $Id$ så 
binder den en tastekombination til "cvs commit"
Den anden cvs.vim kan jeg ikke huske hvor jeg har fået fra men den er
lidt udvidet.
Den sidste fil er min .vimrc den brude være god hvis man skal bruge
en idee-base. 

PS. Den er lavet da 5.4 var den nyeste funktion så den er måske 
lidt out of date.

/Lars 
Student at Department of Computer Science and Department of Psychology  
University of Copenhagen                  
http://www.diku.dk/students/larsj/     
When's the last time you used duct tape on a duct? -- Larry Wall
" Check for CVS
au BufEnter * :call CvsCheck()
function! CvsCheck()
let i = 1 
while strlen(getline(i)) != 0
	if getline(i) =~ '^.*\$Id.*\$.*'
		set statusline=[%n]\ %<%f\ %((%1*%M%*%R%Y,CVS)%)\ %=%-19(\LINE\ [%3l/%3L]\ COL\ [%02c%03V]%)\ ascii['%02b']\ %P
		" CVS commit
		map <C-D><C-D> :wa!<CR>:!cvs -d ${CVSROOT} commit<CR>:e!<CR>
	endif
	let i = i + 1
endwhile
endfunction
"
" produce a command line string for general cvs use
"
function CvsCmdString(cmd, filename, messagefile)
    let dir = fnamemodify(a:filename, ":p:h")
    let file = fnamemodify(a:filename, ":t")
    if strlen(a:messagefile)
        let mflags = (" -F " . a:messagefile . " ")
     else
        let mflags = " "
    endif
    " use /bin/sh to guarantee that we get the env variable CVS_RSH set right
    " for the command
    let command = ("/bin/sh -c 'cd " . dir . " && " ."CVS_RSH=" . $CVS_RSH)
    let command = (command . " cvs -d " . $CVSROOT . " " . a:cmd . mflags .  file . "'")
    return command
endfunction

"
" execute the command 'cmd' for the current buffer, don't create
" a new log message
"
function DoCvsCmdNoMsg(cmd)
    let command = CvsCmdString(a:cmd, expand("%"), "")
    exec ("! " . command)
endfunction

"
" execute the cmd 'cmd' for the current buffer, opening up
" a temp file for a log message, and binding ';cc' to 
" checking in the original buffer's file with the log message
" from the temp file
"
function DoCvsCmdGetMsg(cmd)
    let tempfname = tempname()
    let command = CvsCmdString(a:cmd, expand("%"), tempfname)
    new
    call append(0, "\CVS                CVS LOG ENTRY                       CVS")
    call append(1, "\CVS         Enter your change comments here            CVS")
    call append(2, "\CVS            type :q! to abort or                    CVS")
    call append(3, "\CVS             type ;cc to commit                     CVS")
    exec "write " . tempfname
    exec "map ;cc " . ":%! grep -v ^CVS
:w
:!" . command . "
:q!

"
endfunction

" Vim
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.gvimrc
"             for Amiga:  s:.gvimrc
"  for MS-DOS and Win32:  $VIM\_gvimrc

" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty
set vb

" Get Backspace working corectly
if &term != "xterm"
"set t_kb=^V<BS>
"fixdel
endif

" set the X11 font to use
" set guifont=-misc-fixed-medium-r-normal--10-130-75-75-c-70-iso8859-1

" Make command line two lines high
set ch=2

" Vi compatebility flags
set cpoptions="aABceFs"

" Set X11 font
set guifont=6x10

" What will be shown on the commandline
set shm="aAI"

" Matching chars
"set mps=(:),{:},[:],<:>

" Show (partial) command in status line.  
" set showcmd

" Ignore caseing in search
set ignorecase

" Ignore ignorecase if cased :)
set smartcase

" Use `cindent´
set smartindent

" File formats
set fileformats="unix,dos,mac"

" Use <Tab> to complete
set wildchar=<Tab>

" Completion mode
"set wildmode=list:longest

" Backspace over insert start
set backspace=2

" hmm..
set cindent

" No menubar, no scrollbar .. no nothing!
set guioptions=agi

" history in cmd
set history=20

" Cool jumpsearch thing.. 
set incsearch

" Where am I
set ruler

" To read .profile
set shell=bash\ -login

" Slow display
set scrolljump=20

" Statusline on all windows
set laststatus=2

" Can hidde buffers without closing them
set hidden

" Don't lave the backup files floating around on the disc
set backupdir=/tmp/

" Backup are for wips
set nobackup

" Swapdir
set dir=/tmp/

" Dont backup
set backup

" Match brackets and so on...
set showmatch

"set title titlestring=%<%f%=[%l/%L]\ [%02c%03V]\ %P

" Check for CVS
"so $VIM/vim54/cvs.vim

" Statusline deluxe
set statusline=[%n]\ %<%f\ %((%1*%M%*%R%Y)%)\ %=%-19(\LINE\ [%3l/%3L]\ COL\ [%02c%03V]%)\ ascii['%02b']\ %P

" Small tabs
set ts=4
set sw=4

" spell checker 
map <C-K><C-K> :w!<CR>:!xterm -e ispell -S % <CR>:e!<CR><CR>
map <C-S> :w!<CR>

" Make shift-insert work like in Xterm
"set mousemodel=extend
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" No help on F1 
map  <f1>   <nop>
map! <f1>   <nop>
map  <help> <nop>
map! <help> <nop>

autocmd BufNewFile * :r ~/.vim/template.%:e

" Only do this for Vim version 5.0 and later.
if version >= 500

  " I like highlighting strings inside C comments
  let c_comment_strings=0

  " Switch on syntax highlighting.
  set background=dark
  syntax on

  " Switch on search pattern highlighting.
  set hlsearch

  " Hide the mouse pointer while typing
  set mousehide
  " Dont move the cursor with the mouse
  " set mouse=""

  " Read the syntax file
  "so $VIM/syntax/syntax.vim

  " Set nice colors
  " background for normal text is light grey
  " Text below the last line is darker grey
  " Cursor is green
"  highlight Normal guibg=black guifg=white
 " highlight Cursor guibg=Green guifg=NONE
 " highlight NonText guibg=black
  highlight StatusLine ctermbg=Yellow ctermfg=Red gui=NONE
  highlight StatusLineNC ctermfg=NONE ctermfg=Red guibg=Yellow,bold guifg=Red
  highlight User1 ctermbg=Red ctermfg=Yellow
  highlight Search guibg=Yellow guifg=black 
  "highlight Special gui=NONE guibg=grey95

endif


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 18:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *