AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 515173
Accepted
Michael Durrant
Michael Durrant
Asked: 2014-08-24 09:52:51 +0800 CST2014-08-24 09:52:51 +0800 CST 2014-08-24 09:52:51 +0800 CST

为什么我从 Ubuntu 13 升级后在 Ubuntu 14 中会出现这些 .vimrc 错误?

  • 772

当我尝试使用 vim 时,我收到所有这些命令的错误(尽管 vim 然后工作):

autocmd BufWritePre *.rb :%s/\s\+$//e
set filetype off
filetype plugin on
filetype indent on
syntax on " Turn on syntax highlighting
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
let mapleader = ","
set foldmethod=indent   "fold based on indent
set foldnestmax=10      "deepest fold is 10 levels
set nofoldenable        "dont fold by default
set foldlevel=1         "what I use
let loaded_matchparen = 1 " MDD Turn off matching bracket " Ubuntu14 filetype plugin indent on    " required

如果我在我的 .vimrc 中注释掉这些行,我不会收到任何错误。

但我怀疑我现在可能已经“丢失”了这些设置。

在 Ubuntu 13 中,它们或 vim 中是否有不同的形式?

错误:

三类:

  • 抱歉,该命令在此版本中不可用
  • 不支持的选项
  • 未知选项

细节:

$ vi .vimrc
Error detected while processing /home/durrantm/.vimrc:
line   20:
E319: Sorry, the command is not available in this version: autocmd BufWritePre *.rb :%s/\s\+$//e
line   24:
E519: Option not supported: filetype 
line   25:
E319: Sorry, the command is not available in this version: filetype plugin on
line   26:
E319: Sorry, the command is not available in this version: filetype indent on
line   27:
E319: Sorry, the command is not available in this version: syntax on " Turn on syntax highlighting
line   37:
E319: Sorry, the command is not available in this version: match ExtraWhitespace /\s\+$/
line   38:
E319: Sorry, the command is not available in this version: autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
line   39:
E319: Sorry, the command is not available in this version: autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@
<!$/
line   40:
E319: Sorry, the command is not available in this version: autocmd InsertLeave * match ExtraWhitespace /\s\+$/
line   41:
E319: Sorry, the command is not available in this version: autocmd BufWinLeave * call clearmatches()
line   48:
E319: Sorry, the command is not available in this version: let mapleader = ","
line   52:
E518: Unknown option: foldmethod=indent
line   53:
E518: Unknown option: foldnestmax=10
line   54:
E518: Unknown option: nofoldenable
line   55:
E518: Unknown option: foldlevel=1
line   57:
E319: Sorry, the command is not available in this version: let loaded_matchparen = 1 " MDD Turn off matching brac
ket highlighting.
line   58:
E319: Sorry, the command is not available in this version: filetype plugin indent on
14.04
  • 1 1 个回答
  • 7361 Views

1 个回答

  • Voted
  1. Best Answer
    Michael Durrant
    2014-08-25T04:20:43+08:002014-08-25T04:20:43+08:00

    原来我没有vim,只有vi,由于升级后的依赖问题。

    TL;博士; - 需要旧版本的依赖项。固定于:

    $ sudo apt-get remove vim-common 
    $ sudo apt-get remove vim-runtime
    $ sudo apt-get update && sudo apt-get install vim  
    Change .vimrc setting "set filetype off" => "filetype off"
    

    完整版本...

    修复是:

    试图做:

    apt-get install vim
    

    但是收到消息

    ...
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     vim : Depends: vim-common (= 2:7.4.052-1ubuntu3) but 2:7.4.335-1~ppa1~s is to be installed
           Depends: vim-runtime (= 2:7.4.052-1ubuntu3) but 2:7.4.335-1~ppa1~s is to be installed
    E: Unable to correct problems, you have held broken packages.
    $
    

    然后我尝试了:

    $ sudo apt-get install vim-common
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    vim-common is already the newest version.
    

    最后,意识到消息说依赖关系是2:7.4.052但我有2:7.4.335vim-common 和 vim-runtime,换句话说我有更新的版本。意识到这一点,最终的解决办法是:

    $ sudo apt-get remove vim-common 
    ...
    $ sudo apt-get remove vim-runtime
    

    然后我就能做到;

    $ sudo apt-get update && sudo apt-get install vim  
    

    这解决了除一行之外的所有问题

    set filetype off
    

    我改为

    filetype off
    
    • 5

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve