gpt4 book ai didi

python - Vim 更新插件时出现错误

转载 作者:行者123 更新时间:2023-12-01 09:33:03 25 4
gpt4 key购买 nike

现在我在 Mac Osx 中更新了我的 .vimrc,但出现了以下错误:

Error detected while processing /Users/dmuino/.vimrc: line 59: E319: Sorry, the command is not available in this version: py << EOF line
60: E492: Not an editor command: import os line 61: E492: Not an editor command: import sys line 62: E15: Invalid expression: 'VIRTUAL_ENV' in os.environ: line 117: E171: Missing :endif

但是我检查了我的 .vimrc,但没有发现任何错误,你能帮我吗?我的 .vimrc 是下一个:

set nocompatible              " required
filetype off " required
set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
set rtp+=~/.vim/bundle/Vundle.vim
set splitbelow
set splitright
call vundle#begin()
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tmhedberg/SimpylFold'
Helptags

let g:SimplyFold_docstring_preview=1
" PEP8 indetantion
au BufNewFile,BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
" HTML, JS, CSS indentation
au BufNewfile,BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
"Fix problem indentation PEP8
Plugin 'vim-scripts/indentpython.vim'
"Uneccesary whitespace
au BufRead,BufNewfile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" UTF8 support
set encoding=utf-8
"Autocomplete
Bundle 'Valloric/YouCompleteMe'

let g:ymc_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>

" python with virtualenv support

py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF

" Syntax Checkin/Highlighting
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
let python_highlight_all=1
syntax on

"Color Shemes
Plugin 'jnurmin/Zenburn'
Plugin 'altercation/vim-colors-solarized'
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
call togglebg#map("<F5>")
"File Browsing
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
let NERDTreeIgnore=['\.pyc$','\~$'] "Ignore files in NERDTree

"SuperSearching
Plugin 'kien/ctrlp.vim'
"Line numering
set nu
"Git integration
Plugin 'tpope/vim-fugitive'

"Powerline
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}

"System clipboard
set clipboard=unnamed
"VIM in the shell
set editing-mode vi

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" ...

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required

try
source ~/.vim_runtime/my_configs.vim
catch
endtry

最佳答案

改变

 " python with virtualenv support

py << EOF

" python with virtualenv support
py3 3
py3 << EOF

关于python - Vim 更新插件时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49786117/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com