Ben
this is my _vimrc file:
set nocompatiblecd c:\devset nobackupset nowbset noswapfileset wildmenuset novbset wrapset numberset backspace=indent,eol,startset autoindentset smarttabset history=500set rulerset showcmdset incsearchset showbreak=\set cursorlineset cmdheight=3set so=10set visualbellset digraphset equalalwaysset splitbelowset hiddenset ignorecaseset noebset autowriteset ek noet nosolset fo=cqrtset shm=atset ww=<,>,h,lset comments=b:#,:%,n:>set novb"set list listchars=tab:»·,trail:·set su=.bak,~,.o,.h,.info,.swp,.obj,.dvi,.pdf,.log,.aux,.exe,.tar,.gz,.zip,.bz2,.exeset expandtabset sbset lines=40"Mappingsmap Q gqmap <F5> :ls<CR>map <F6> :bd<CR>map <F7> :bp<CR>map <F8> :bn<CR>map j gjmap <DOWN> gjmap k gkmap <UP> gkmap <F9> :make <CR>map :bd :bd!vnoremap p :let current_reg = @"gvs=current_reg" This is an alternative that also works in block mode, but the deleted" text is lost and it only works for putting the current register."vnoremap p "_dp" Switch syntax highlighting on, when the terminal has colors" Also switch on highlighting the last used search pattern.if &t_Co > 2 || has("gui_running")syntax onset hlsearchendif" Only do this part when compiled with support for autocommands.if has("autocmd")" Enable file type detection." Use the default filetype settings, so that mail gets 'tw' set to 72," 'cindent' is on in C files, etc." Also load indent files, to automatically do language-dependent indenting.filetype plugin indent on" For all text files set 'textwidth' to 78 characters.autocmd FileType text setlocal textwidth=78" 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`\"" |\ endifendif " has("autocmd")" MS Windows Behavior shortcutssource $VIMRUNTIME\mswin.vimbehave mswin" Auto Commands" Placing Vim into the directory where the file is.autocmd VimEnter,BufNewFile,BufRead,BufEnter * if strlen (@%) !=0 | cd %:p:h | endifau VimEnter,BufNewFile,BufRead,BufEnter *.sql set ft=plsql" vim -b : edit binary using xxd-format!augroup Binaryau!au BufReadPre *.bin *.bqy let &bin=1au BufReadPost *.bin *.bqy if &bin | %!xxdau BufReadPost *.bin *.bqy set ft=xxd | endifau BufWritePre *.bin *.bqy if &bin | %!xxd -rau BufWritePre *.bin *.bqy endifau BufWritePost *.bin *.bqy if &bin | %!xxdau BufWritePost *.bin *.bqy set nomod | endifaugroup END
What I have noticed is that it occurs on that java log file that are being written while edited, and on where I often do string search.
Maybe I can force the readonly mode for those file as a workarround.
Thanks a lot for your help.
Eddine.
2011/10/27 Benjamin R. Haskell <vim@benizi.com>
On Wed, 26 Oct 2011, Eddine wrote:No, that's not what I meant at all. I thought something simpler might be making things worse, though in hindsight, I think it'd be about the same.Hey BenI think you give me the right hint I have this autocmd in my _vimrcautocmd BufReadPost *\ if line("'\"") > 0 && line("'\"") <= line("$") |\ exe "normal g`\"" |\ endifso is it replacable by the autocmd you gaveau BufReadPost * normal g`"I think the problem is something else that causes that autocmd to be fired at the wrong time. I mentioned the 'autoread' option (which I don't think will ever fire when you're in insert mode, but comes into play with files that change on disk while you're editing). It seems more likely to me that some other autocmd (possibly on the CursorMovedI event?) might do something that would trigger a reload of changed files.What plugins have you installed, or what other autocmds do you have?--Best,Ben--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
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
No comments:
Post a Comment