1

WindowsVistaでgVim7.3を使用してUNCパス経由でディレクトリ/ファイルにアクセスすると、非常に苦痛な遅延が発生します。

新しいバッファを開くときのディレクトリ/ファイル名のタブ補完と同様に、ファイルの読み取り/書き込みが遅くなります。ただし、ワードパッドを使用している場合、この遅れには気づきません。

私が試したこと:

  • クリーム(どうやら彼らはディレクトリの命名スキームの修正を持っていた)
  • ネットワークドライブをz:または他の何かにマッピングする
  • さまざまな設定
    • ffs=dosを設定します
    • set complete =。、w、b、u、t
    • noshellslashを設定する

cygwinを試しましたが、同じ顕著なラグがそこにも表示されます。すでにすべてのスワップ/バックアップファイルをオフにしています。助けていただければ幸いです...参考のためにvimrcをダンプしました

if v:progname =~? "evim"
  finish
endif

set nocompatible

:runtime! ftplugin/man.vim

set backspace=indent,eol,start

colorscheme torte " murphy
syn on

set ffs=unix,dos

" portable friendly
set nobackup
set nowritebackup
set noswapfile
set viminfo=
" gui options (http://steveno.wordpress.com/2007/10/08/vim-for-windows/)
set guioptions-=T  " No toolbar
set gfn=Consolas:h9:cANSI

set history=50
set ruler
set showcmd
set incsearch
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set wrap
set wildmode=longest,list,full  " Complete longest string, list alternatives
                                " then completed next full match, cycling back

function! ToggleHLSearch()
    if &hls
        set nohls
    else
        set hls
    endif
endfunction

function! InsertTabWrapper()
    let col = col('.') - 1
    if !col || getline('.')[col - 1] !~ '\k'
        return "\<tab>"
    else
        return "\<c-p>"
    endif
endfunction


inoremap <tab> <c-r>=InsertTabWrapper()<CR>
nmap <silent> <C-n> <Esc>:call ToggleHLSearch()<CR>
nmap ,s :source ~/.vimrc<Return>
" change current directory to that of open buffer
nmap ,c :cd %:p:h<Return>
nmap <c-h> <c-w>h<c-w><bar>
nmap <c-l> <c-w>l<c-w><bar>
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map Q gq

" Commenting blocks of text
" ,<    <!-- --> html style comments
map ,< :s/^\(.*\)$/<!-- \1 -->/<CR><Esc>:nohlsearch<CR>
" ,/     // comments
map ,/ :s/^/\/\//<CR>
" ,#    # comments
map ,# :s/^/#/<CR>
" uncommenting all of the above
"map ,- :s/^\(\/\/|<!-- |#\)\(.*\)\(-->\)*/\1/<CR>

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

if has("autocmd")
    "&& !exists("autocommands_loaded")
  let autocommands_loaded = 1
  filetype plugin indent on
  augroup vimrcEx
  au!
  " Remove ALL autocommands for the current group.
  autocmd!
  autocmd FileType text setlocal textwidth=78
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif
  au BufRead *.html set filetype=html4
  augroup END

  " allow editing Word Docs sanely
  autocmd BufReadPre *.doc set ro
  autocmd BufReadPre *.doc set hlsearch!
  autocmd BufReadPost *.doc %!antiword "%"

  " uncomment the following to remember the view of the file edited between
  " sessions
  " au BufWinLeave * mkview
  " au BufWinEnter * silent loadview

  " run file with PHP CLI (CTRL-M)
  autocmd FileType php noremap <C-M> :w!<CR>:!/usr/bin/php %<CR>
  " parser check (CTRL-L)
  autocmd FileType php noremap <C-L> :!/usr/bin/php -l %<CR>

  " highlight current line only for current buffer
  "autocmd BufLeave * setlocal nocursorline
  "autocmd BufEnter * setlocal cursorline

  au BufRead,BufNewFile *.tea set filetype=tea
  "au! Syntax newlang source $VIM/newlanguage.vim

else
  set autoindent

endif
4

3 に答える 3

1

見る

:he swap-file

:se noswapfile(注意!)でスワップファイルを無効にするか、`directory`設定を使用してローカルディスクにスワップファイルを保持できます。

オプションを指定して vim を起動すると、-nスワップファイルも無効になります。-Rそれを読み取り専用モードと組み合わせることができます

于 2011-04-12T00:27:46.003 に答える
1

私が見つけた別の解決策は、UNC パスをローカル ドライブ文字としてマウントし、Vim にドライブ文字ベースのパスのみを使用させることです。
例: \\some-server\path\to\workdir=>Z:\path\to\workdir

これにより、接続に問題がない限り、遅延が完全に解消されます。

于 2012-12-10T10:17:38.683 に答える
1

同じことが私を狂わせていましたが、私が見つけた修正があります。理由はまだわかりませんが、plugin/matchparen.vim プラグインを無効にすると問題は解決します (vim 拡張子を変更すると問題が解決します)。括弧のマッチングを多用しているので、ぜひ検討してみます。

于 2011-04-08T16:07:08.890 に答える