showkey
showkey

Reputation: 348

what is wrong with my vimrc configuration?

I have installed the plugin--pydiction,if i edit a new file which has no name,i can not use the auto-complete function,but i can use the auto-complete function in a named file,what is wrong with my _vimrc configuration? Here is all my lines in the _vimrc file.

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

Upvotes: 0

Views: 121

Answers (1)

romainl
romainl

Reputation: 196466

A link to that plugin would probably be useful but I'd say that this plugin does its job only in buffers with filetype set to python.

If you want it to work on unnamed buffers, use the following command:

:set filetype=python

Upvotes: 3

Related Questions