我的vimrc配置有什么问题?

时间:2014-03-16 07:46:03

标签: vim

我已经安装了插件 - pydiction,如果我编辑一个没有名字的新文件,我就不能使用自动完成功能,但是我可以在命名文件中使用自动完成功能,我的_vimrc配置有什么问题? 这是我在_vimrc文件中的所有行。

set nocompatible
behave mswin
set langmenu=en_US
let $LANG = 'en_US'
set diffexpr=MyDiff()
source $VIMRUNTIME/mswin.vim
source $VIMRUNTIME/vimrc_example.vim
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
set expandtab
set shiftwidth=4
map <F4> :w<cr>:!python %<cr>
imap <F5> <Esc>:w <cr>:!python %<cr>
set number
filetype plugin on
let g:pydiction_location = 'D:/Vim/vimfiles/ftplugin/pydiction/complete-dict'
let g:pydiction_menu_height = 20

1 个答案:

答案 0 :(得分:3)

该插件的链接可能会有用,但我要说这个插件仅在filetype设置为python的缓冲区中起作用。

如果您希望它在未命名的缓冲区上工作,请使用以下命令:

:set filetype=python