How to get back vim files after deleting them / completely reinstall vim? - linux

Vim on terminal, Ubuntu 14.04.
While messing with vim syntax files and color files, I accidentally deleted all vim file from /usr/share/
I originally installed vim with sudo apt-get install vim
To get back the files, I tried:
sudo apt-get remove, install, update, upgrade, and hg clone https://vim.googlecode.com/hg/ vim and make. The files I got with make doesn't seem to do much for me and are not identical to what I had before with get install vim in usr/share/ folder
with apt-get install, normal vim works but no syntax, color or other available things that was in vim file are all missing.
How do I completely reinstall vim / get back the default files?
Thanks

Just found it,
sudo apt-get purge vim
sudo apt-get install vim
seems to fix it for me. I spent unnecessarily too long on this to find a solution. Oh, well.

Related

Vim syntax highlighting didn't work in Ubuntu 16.04

Recently I reinstall ubuntu. When I install vim in new ubuntu 16.04 OS syntax highlighting of PHP, JS has gone.
I install vim by using this command
sudo apt-get install vim
When syntax highlighting hasn't work, I reinstall vim by using this command.
sudo apt-get purge vim; sudo apt-get install vim
But still didn't work. Screenshot of PHP file which is opened by vim is given below.

Vim youcompleteme not working in Debian Jessie

According to this article code completion should work for any language with youcompleteme plugin. I set it up as follows in Debian Jessie:
installed vim from repository
installed youcompleteme from repository
issued 'vam install youcompleteme' in cli
After the last step vim start significantly slower, which means that it is loading the plugin. However, completion does not work.
The output of
$ vam status
Name User Status System Status
editexisting removed removed
justify installed removed
matchit removed removed
youcompleteme installed removed
Is there anything else I have to do to get youcompleteme working?
I contacted the maintainer and finally got the missing hint. As it turns out, all I had left to do was to enable filetype recognition.
In case someone else struggles with this, here are some instructions on how to setup Vim with the Debian package vim-youcompleteme.
Install vim and vim-youcompleteme packages
$ sudo apt-get install vim vim-youcompleteme
This will also install any required dependencies automatically. Afterwards you will have to issue the following command
$ vam install youcompleteme
The last command will create ~/.vim folder in your home folder. However, code completion does not work yet. Some further modifications are required. First copy the default ycm_extra_conf.py file to the newly created ~/.vim/ folder
$ cp /usr/share/doc/vim-youcompleteme/examples/ycm_extra_conf.py ~/.vim/.ycm_extra_conf.py
Then we need to tell vim to use this file for code completion in our .vim.rc and to turn on filetype recognition. The following two lines should be added to ~/.vimrc:
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
filetype on
Now vim should be able to use code completion, e.g., with C++ files.
You should follow the installation instructions for YCM, including how to compile it:
Install development tools and CMake: sudo apt-get install
build-essential cmake
Make sure you have Python headers installed: sudo apt-get install
python-dev.
Compiling YCM with semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe ./install.py --clang-completer
Compiling YCM without semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe ./install.py
Also, I would give you the tip to use vim-plug for handling plugins.

apt-get dist-upgrade, without overwriting my self compiled vim

I'm using Ubuntu-14.04
I compiled vim myself (to add support for YouCompleteMe), and now when I execute apt-get dist-upgrade it overwrites my version of vim (and other dependent packages) and causes vim to stop working.
How can I upgrade everything, without ruining what I have compiled myself?
It's generally a good idea to keep things which you've compiled yourself in /usr/local/. Nothing from apt will be installed there so the stuff you've put in the directory will be safe from upgrades.
The other option is to pin the vim package so that the upgrade will not install it (or any dependecies). This might work better if you apt-get source the vim, build the .deb, install it and then pin it rather than just overwriting /usr/bin/vim with your own compile.

Vim: Space bar in insert mode creates integers

I'm using MINGW on a Windows 7 machine to ssh to an EC2 instance (Ubuntu) on which I would like to use vim as my text editor. If I run vim test.txt, enter Insert mode, and type this is a test, however, vim interprets each of the spaces in that sequence as an integer:
Does anyone know what could possible cause this? I tried updating vim with sudo apt-get install vim and was told I already had the most up to date vim. Any suggestions others can offer would be greatly appreciated.
I ended up purging and then reinstalling vim:
Purge to remove the package config files: sudo apt-get purge vim
Clean out any personalizations: rm -Rf ~/.vim ~/.vimrc ~/.viminfo
Reinstall Vim again: sudo apt-get install vim
That solved the problem, but I'm still interested to know what could possibly have created the issue. (Why would the space bar create increasing integer runs on a fresh EC2 instance? Is this some strange key mapping issue?)

Gvim installation on vim-7.4

I want vim-gtk to use vim 7.4 which I installed from source, but gvim is opening with 7.3 itself.
On A fresh linuxmint, after updating system, I removed already existing vim, than installed vim 7.4 from source and it is perfect installation, everything went fine, and than installed ,
sudo apt-get install vim-gtk
than when I enter gvim, gvim is 7.3 not already existing 7.4!!! and if I enter vim from terminal than its vim-7.4.
I will be thankful if anyone helped me to run gvim on vim 7.4
Two thingsā€¦
First, $ sudo apt-get install vim-gtk only uses your repositories (which are certainly frozen at 7.3.something), it doesn't care at all about what you installed manually.
Second, GVim is not a separate frontend that you add to an existing Vim: it is Vim, built with GUI support and either launched as gvim or as vim -g.
You could:
uninstall vim-gtk and re-compile Vim manually following these instructions (note the --enable-gui=gtk2)
or find an up-to-date ppa on LaunchPad.net, add it to your software sources and redo $ sudo apt-get install vim-gtk.
just install vim-gnome and vim-gui and reboot.It worked for me.
Maybe this post will help you install gvim 7.4. There are few steps:
Install the needed dependencies:
$ sudo apt-get install ncurses-dev build-essential mercurial
Clone the sources of Vim 7.4:
$ hg clone https://vim.googlecode.com/hg/ vim
Build Vim from sources:
$ cd vim/src
$ make distclean
$ ./configure --with-features=huge --enable-pythoninterp --enable-rubyinterp
$ make
$ sudo make install
Adjust the PATH:
$ export PATH=/usr/local/bin:$PATH
I used this guide and get gvim 7.4.54.

Resources