Je reçois des erreurs pour toutes ces commandes lorsque j'essaie d'utiliser vim (bien que vim fonctionne ensuite):
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
Si je commente ces lignes dans mon fichier .vimrc, je ne reçois aucune erreur.
Mais je suppose que j'ai peut-être maintenant "perdu" ces paramètres.
Existe-t-il une forme différente pour eux ou quelque chose dans vim dans Ubuntu 13?
Les erreurs:
Trois catégories:
Détails:
$ 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
Il s'avère que je n'avais pas vim, je n'avais que vi, en raison de problèmes de dépendance après la mise à niveau.
$ 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"
Le correctif était:
A tenté de faire:
apt-get install vim
Mais j'ai un message
...
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.
$
Alors j'ai essayé:
$ Sudo apt-get install vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
vim-common is already the newest version.
Enfin, réalisant que les messages indiquent que la dépendance est 2:7.4.052
, mais que j’ai 2:7.4.335
pour vim-common et vim-runtime, c’est-à-dire que j’avais plusieurs versions récentes. Réalisant cela, le correctif final était:
$ Sudo apt-get remove vim-common
...
$ Sudo apt-get remove vim-runtime
Alors j'ai pu faire;
$ Sudo apt-get update && Sudo apt-get install vim
Cela a résolu tous les problèmes sauf une ligne.
set filetype off
que j'ai changé pour
filetype off