Restoring VIM to default state - vim

I'm really frustrated with getting going using VIM. I'm just trying to do some minor customizations to the vimrc file. I made some minor changes, but they didn't do what I had hoped. So, I went back in and removed the lines that I had added, reverting back to my original file. Now, I can't even get into VIM! When I type "vim filename.xxx" from the terminal, I just go right back to a command prompt. No error message, no file opens, nothing. It's as if I just hit the enter key.
I tried uninstalling and reinstalling VIM, but same results. Does anyone know what I can do to get VIM back to its original state? I'm using Ubuntu 11.

I would suggest first uninstalling but purging, reinstalling, and making sure your local user edits are removed.
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.

Try removing the ~/.vimrc and ~/.viminfo files and the ~/.vim directory. These usually contain configuration information so getting rid of them should give you a fresh start

Related

"Unknown function: <SNR>37_repo_dir" when opening a new file in vim

I recently updated oh-my-zsh, vim and ran rcup to update dotfiles and vim plugins.
When opening a new file in vim I get an error, part of which contains:
Unknown function: <SNR>37_repo_dir
This seems to be related to the fugitive plugin that I have installed as it is mentioned above the error.
The vim syntax in one of the previously existing fugitive.vim configuration files is invalid for in the latest version of vim. fugitive.vim was removed from the latest version of thoughtbot/dotfiles. Since rcup only replaces files dotfiles and doesn't delete them if they were removed from the dotfiles folder the fugitive.vim file needs to be manually removed.
The most straightforward thing to do is:
rm -rf ~/.vim && rcup

Failing to install Sublime Text 3 in Ubuntu 16.04 using apt-get command

I had downloaded sublime previously directly from the browser as tarball and saved it in a folder (and of course extracted it).But this way I wasn't able to make Sublime my default editor and it didn't feature as an application when I tried to open a text file with a right-click.I read somewhere installing sublime text 3 using commands:
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer
will solve my problem. So I directly deleted the Sublime_text3 folder saved in my Downloads directory and then used the given commands. But when I entered the 3rd command line I got the following error(just writing the error part):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:/var/cache/apt/archives/sublime-text-installer_3126-2~webupd8~1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Can anyone explain why this error is coming and suggest a way to solve this problem? Also if anyone can tell how I can set Sublime as my default text editor from the tarball downloaded from the sublime text 3 website. Thanks in advance!
you can try this command to install Sublime Text using Snap Store..
sudo snap install sublime-text --classic
I'm not sure overall how to fix that error or what's going on (I use Slackware and not Ubuntu/Debian), but for a long while there have been official Sublime repositories several different Linux distributions, including Ubuntu/Debian.
It's highly recommended that you use those if you want to go the package route and not use existing solutions such as the one referenced in your question or in the other response here, if for no other reason than only the official repository is guaranteed to contain an unmodified version of Sublime. Additionally the official repositories are always updated on release, which may or may not happen in a timely manner in other repositories.
The links referenced above contain instructions on how to set up and use Sublime from those repositories, and if you have any issues a good place to ask is the forum.
One thing to note which isn't mentioned explicitly in the above pages is that to use the official repositories, you should:
Choose only one of them (stable or dev, noting that you need a license to run a dev version) and not add both repositories or things will not work as expected
Ensure that other repositories that you've added (such as the one in your question) are removed to make sure that the package system definitely pulls the correct package
There are a couple of ways to go if you want to install Sublime from the tarball version. The easiest way would be to extract it, then manually set up launcher shortcuts and so on based on what falls out. How exactly you would register it as a text editor in that case, I'm not entirely sure since I don't use the same distribution as you.
Presuming that the process would be easier if Sublime was installed in a way similar to how the package manager would do it, the tarball comes with a desktop file and icons, so the following steps can be used to (presumably) do what the package installer would do.
The proviso here is that although these steps work on my non-Ubuntu machine, I don't know if all of the referenced tools are installed by default on an Ubuntu system, so so more setup work may be involved.
Note also that the files in the tarball are not entirely self-consistent, which makes this a little bit more work.
First, you need to extract the tarball (replace tarball filename as appropriate for location and build):
cd /opt
sudo tar xvf ~/Downloads/sublime_text_3_build_3176_x64.tar.bz2
This creates the folder /opt/sublime_text_3/ and fills it with the contents of the tarball.
Next, you want to install the icons contained in the tarball. As far as I have been able to tell, the icons in the tarball aren't in the correct directory structure, requiring each to be copied into place individually. We also need to update the icon cache to ensure that the new icon is noticed by the system:
cd /usr/share/icons/hicolor/
sudo cp /opt/sublime_text_3/Icon/16x16/sublime-text.png 16x16/apps/
sudo cp /opt/sublime_text_3/Icon/32x32/sublime-text.png 32x32/apps/
sudo cp /opt/sublime_text_3/Icon/48x48/sublime-text.png 48x48/apps/
sudo cp /opt/sublime_text_3/Icon/128x128/sublime-text.png 128x128/apps/
sudo cp /opt/sublime_text_3/Icon/256x256/sublime-text.png 256x256/apps/
sudo gtk-update-icon-cache -f -t .
Now we want to install the sublime_text.desktop file that is in the tarball. Note however that like the icons, it seems kind of broken; the tarball extracts to sublime_text_3 but the desktop file assumes that the application is actually in /opt/sublime_text instead.
As such, you either need to rename the folder that was extracted to sublime_text to match what is in the desktop file, or edit the desktop file to make the path correct.
The following steps assume that we want to keep the folder the same and rewrite the desktop file. These commands will generate a new file named sublime_text_3.desktop with the changes.
cd /opt/sublime_text_3/
sed -e "s^/sublime_text/^/sublime_text_3/^" sublime_text.desktop | sudo tee sublime_text_3.desktop
Now you can install the desktop file. You do that with desktop-file-install, passing it the name of the desktop file. For accessing Sublime from the command line, you also want to set up a subl link to the installed copy of Sublime.
Adjust the paths as appropriate here if you decided to rename the folder instead of editing the desktop file:
sudo desktop-file-install sublime_text_3.desktop --rebuild-mime-info-cache
sudo ln -s /opt/sublime_text_3/sublime_text /usr/bin/subl
At this point Sublime should show up as an installed application, or at least it does in my Window Manager; if not, executing sudo update-desktop-database may help refresh it.
You can try this once. i hope it will help
wget https://download.sublimetext.com/files/sublime-text_build-4126_amd64.deb
sudo dpkg -i sublime-text_build-4126_amd64.deb

Fresh Vim install, Vim permission errors, Vundle not functional

I have the following vim packages installed on Linux Mint Debian Edition:
vim
vim-common
vim-tiny
vim-runtime
vim-doc
I had the above packages installed before, and after installing Vundle (it was functional via instructions on http://github.com/gmarik/vundle) decided, to avoid plugin conflicts, to completely remove and reinstall all of the above vim packages/.vim folder, in order to fully utilize Vundle as a means to manage my plugins. In my file explorer, I can see that the folder created from git cloning ~/.vim and all inherited folders/files belong to root. This causes the following problems with Vundle:
First of all when I executed :BundleSearch query:
To further diagnose my problem, I tried adding a bundle manually into my vimrc:
Bundle 'scrooloose/nerdtree'
Using the exact same vimrc setup in the Vundle GitHub, it worked on the previous installation.
Now when I attempt to :BundleInstall I get the following permission-based errors:
[140112 13:48:10]
[140112 13:48:10] Bundle scrooloose/nerdtree
[140112 13:48:10] $ git clone --recursive 'https://github.com/scrooloose/nerdtree.git' '/home/ahqiao/.vim/bundle/nerdtree'
[140112 13:48:10] > fatal: could not create work tree dir '/home/ahqiao/.vim/bundle/nerdtree'.: Permission denied\00
[140112 13:48:11]
[140112 13:48:11] Helptags:
[140112 13:48:11] :helptags /home/ahqiao/.vim/bundle/vundle/doc/
[140112 13:48:11] > Error running :helptags /home/ahqiao/.vim/bundle/vundle/doc/
[140112 13:48:11] Helptags: 1 bundles processed
Furthermore, my vimrc also contains the standard two lines for plugins:
filetype plugin on
set nocp
In the past, I have also had problems with :helptags not being able to access ~/.vim/doc because of permission so I have had to manually copy the help files into a non-root folder and point to that with :helptags.
How can I overcome these root problems? Vundle is really essential for me to manage the amount of plugins I require to code and keep track of.
It's unclear to me how the owner of ~/.vim got set to root but Vundle will definitely have trouble updating packages if that is the case.
If I understand correctly, in that you now have Vim installed how you want it, I suggest redoing the customization process.
Move ~/.vim (for reference) and create the bundle directory where Vundle will be installed:
$ sudo mv ~/.vim ~/OLDvim
$ mkdir -p ~/.vim/bundle
This should now be an empty dir owned by your user.
Reinstall Vundle
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Make sure you have the required lines in your ~/.vimrc,
open vim and
run :BundleInstall
Once you got it working and you're happy with everything, you can rm -rf ~/OLDvim.
Changing the ownership of the .vim files to my username instead of root worked for me (did for all files recursively):
chown -R <username>:<username> .vim
Here's more info about chown.
Note: It seems like the reinstall answer would work too (though didn't end up trying it), but with the chown approach you don't have to do the reinstall steps.
It's very late to answer, but this problem still occuring. I run into this problem and Here is how I solved it.
First run the ( get the error while installing the Plugin)
:helptags /home/ahqiao/.vim/bundle/vundle/doc/
It will show the Exact Error. In my Case it was Duplicate Entries found in two ale doc file ale-cpp.txt and ale-cpp.txt.
Error: Duplicate Entries Found g:ale_cpp_flawfinder_executable
Error: Duplicate Entries Found g:ale_c_flawfinder_executable
Just remove these entries or comment out and Install agin. Now it works fine.
Also very late to answer, but in my case, changing the line:
call vundle#begin('$USERPROFILE/.vim/bundle')
to
call vundle#begin('$HOME/.vim/bundle')
corrected the problem. Apparently, $USERPROFILE was not defined, and so evaluated to root (/).
This may help someone....
Uninstalling/Installing the offending plugin (vim-fugitive) fixed the error for me.
I was getting this error:
> Error running :helptags /Users/gigo6000/.vim/bundle/vim-fugitive/doc
So I deleted the line:
Plugin 'tpope/vim-fugitive'
Run
:so %
:PluginClean
:PluginInstall
And that did the work.

VIM: Unable to uninstall Latex-Box plugin with Vimball

According to documentation, vimball uninstall should be a very simple process of typing in :RmVimball LatexBox
However, I get the error message
vimball (RmVimball) unable to find in .VimballRecord
I'm pretty sure I'm typing in the right prompt because LatexBox.vmb is the file I ran :so % on to install the plugin.
The Vimball documentation (http://www.cs.csubak.edu/docs/vim/pi_vimball.html) states:
:RmVimball removes all files generated by the specified vimball
(but not any directories it may have made). One may choose a path
for de-installation, too (see |'runtimepath'|); otherwise, the
default is the first existing directory on the |'runtimepath'|.
And indeed my .VimballRecord exists in the first existing directory of the output when I type in :echo &runtimepath . I opened up the .VimballRecord and it says
LatexBox.vmb: call delete('C:\Program Files (x86)\Vim\vimfiles/ftplugin/tex_LatexBox.vim')| ...
which seems to confirm that LatexBox is the correct plugin name. I'm very confused where the error is coming from. Otherwise -- How can I remove this plugin manually? (I'm concerned that going through and deleting files in the ftplugin folder is not thorough)
To uninstall a vim plugin is really easy, because there're no hidden stuff.
Go into C:\Program Files\vim\vimfiles(depending on your system)
Find out all files about LatexBox
Delete them.
Make a backup of vimfiles folder before deleting files.
If something goes wrong, you have a change to recover.
Update:
Answer you question about :helptags command:
When you install a plugin, it may contains help files(for example latexbox.txt).
It was often install in C:\Program Files\vim\vimfiles\doc directory (I will call it doc from now).
This direcotry may contains other help files for other plugins.
Notice there's a tags file in this doc directory. The tags file is used for jumping to location when you press Ctrl-] on a word.
Don't worry if doc\tags not exist.
You can use :helptags C:\Program Files\vim\vimfiles\doc to generate it.
When you install a plugin via vimball (which is just a vimscript to help you creating files/directories),
The vimball will create latexbox.txt in doc directory,
and run :helptags command to update the tags file automatically.
So, when you manually delete doc\latexbox.txt,
the tags file still contains infomatation about latexbox.txt.
Just run :helptags path\you\want\to\sync command again to get doc\tags synchronised.
Been there. The problem is that Vimball version (v31) that comes packaged with Vim is obsolete and does not support .vmb files. Check 1 for the latest Vimball version and you will be alright.

RabbitVCS GUI does not appear

I installed RabbitVCS on my linux box which went without a hitch. Now I'm having trouble running the thing, I want to bring up the GUI. Naturally I tried rabbitvcs from the command line, then rabbitvcs SVN but no luck ( see output below ). I get usage info, but that didn't seem to help me much. How can I run it in GUI mode ?
--------------------------------------
flipper#matrix ~ $ rabbitvcs
Usage: rabbitvcs module [path1] [path2] ...
Available Modules
SVN:
about, add, annotate, applypatch, branch, browser, changes, checkmods,
checkout, cleanup, commit, createpatch, create, delete, diff, editconflicts,
export, ignore, import, lock, log, merge, properties, open, relocate, rename,
markresolved, revert, settings, switch, unlock, update, updateto
Git:
about, add, annotate, applybranch, branches, changes, checkout, clean,
clone, commit, createpatch, create, delete, diff, editconflicts, export,
ignore, log, merge, open, push, rename, remotes, reset, revert, settings,
tags, update
For module specific help type: rabbitvcs -h
flipper#matrix ~ $ rabbitvcs SVN
flipper#matrix ~ $ rabbitvcs SVN -h
flipper#matrix ~ $
As you can see here, RabbitVCS is actually a Nautilus plugin. Try taking a look at your working copy through Nautilus.
It has no separate GUI.
By the way, I actually tried using it for a while, but I found it somewhat slow and clumsy. I switched to using the SVN and git console commands.
I later found that meld actually provides me with a very nice visual diff. It understands SVN and git, but you'll need the very latest version to make the git diff work just right.
To me
nautilus -q
after installation was enough to show up in Ubuntu.
I am currently using Opensuse 13.1
My problem was that there was no RABBITVCS menu on nautilus.
When starting Nautilus, I discovered that nautilus clomplaims of not having the "python3-simplejson python-simplejson" libraries.
Unfortunately i don't know why the zypper didn't install it when installing rabbitVCS package.
Uninstall rabbitvcs using sudo apt-get purge rabbitvcs* and reinstall it using below command lines on Ubuntu.
sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install rabbitvcs-nautilus
nautilus -q
and close the already opened window and reopen and right click. You will get RabbitVCS SVN, Git and Hg option on the screen. It's tested on Ubuntu 18.04 and 16.04.

Resources