vi, getting multiple "Sorry, the command is not available in this version..." after reinstall
Try from within vim
...
:version
and if your get ...
Small version without GUI.
You are missing package vim-gui-common
. It is probably also advisable to install vim-runtime
. Commands to install:
sudo apt-get install vim-gui-common
sudo apt-get install vim-runtime
Another cause might be that alternatives is pointing to the wrong one:
update-alternatives --display vim
to show what is used and ...
update-alternatives --config vim
to change to another vim. It could be that /usr/bin/vim.gnome
is used and you need /usr/bin/vim
edit: Michael Durrant fixed it with #1 in case anyone wonders.
You probably don't have the full version of VIM installed. To check, try executing vim
or:
readlink -f `which vi`
For example, Ubuntu 16.04 LTS only came with /usr/bin/vim.tiny
Install the full VIM:
sudo apt update
sudo apt install vim
Now you should have /usr/bin/vim.basic
, and the .vimrc
commands should succeed.
If this started after you've updated to 16.04, it might be b/c of the change to python 3 as the default interpreter as @luka5z pointed out.
To resolve, I updated to the latest clang-format.py file from https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format.py
and edited .vimrc lines from:
" Add hook for clang-format
map <C-K> ggVG :pyf /usr/local/bin/clang-format.py<cr>
imap <C-K> <c-o>:pyf /usr/local/bin/clang-format.py<cr>
to:
" Add hook for clang-format
map <C-K> ggVG :py3f /usr/local/bin/clang-format.py<cr>
imap <C-K> <c-o>:py3f /usr/local/bin/clang-format.py<cr>