如何在 Debian 中恢复 VIM

如何在 Debian 中恢复 VIM

在我尝试从系统中删除 VIM 之后,简单的apt-get remove --purge vim方法不起作用,并且仍然有一些 vim 文件,例如/usr/share/vim/。所以我决定手动删除它们

sudo rm -r `whereis vim`

之后 apt-get install vim 返回此内容:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/953 kB of archives.
After this operation, 2,287 kB of additional disk space will be used.
Selecting previously unselected package vim.
(Reading database ... 93025 files and directories currently installed.)
Preparing to unpack .../vim_2%3a7.4.488-7+deb8u2_amd64.deb ...
Unpacking vim (2:7.4.488-7+deb8u2) ...
Setting up vim (2:7.4.488-7+deb8u2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/vi.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/view.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/ex.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group ex) doesn't exist

不止如此。Vi 现在是 Vim(运行 vi => 实际上运行 vim)

我无法完全删除并重新安装 vim,就像以前一样。该怎么办呢,从头开始安装 vim,并填充/usr/share/vim, /etc/vim其他路径。因为它们实际上是空的

~ vim
Error detected while processing /home/kaldown/.vim/vimrc:
line   19:
E484: Can't open file /usr/share/vim/syntax/syntax.vim
Press ENTER or type command to continue

PS 将尝试从另一个角度提问。

如何在执行后恢复VIM

sudo rm -rf `whereis vim`

因为apt-get install vim,无法恢复/usr/share/vim/包含类似文件的文件syntax.vim

答案1

您可能需要使用以下命令手动删除该包:

sudo dpkg --purge --force-all vim

请在您的系统中再次安装 vim 包。

sudo apt-get update; sudo apt-get install vim

答案2

sudo apt-get remove `sudo dpkg-query -l | grep vim`

在那之后

sudo apt-get update; sudo apt-get install vim vim-python

解决了我的问题

相关内容