vim strange behavior on Ubuntu 16.04.1 LTS - vim

My installation of vim is behaving strangely (which I suspect started happening after I upgraded the distribution to 16.04 from 14.04).
The issue is that whenever I open a file vim edits it and replaces the first character with a g. For example if I have a file foo.txt with content:
stack
over
flow
And if I open the file with $ vim foo.txt, vim opens it with content:
gtack
over
flow
Note that I already reinstalled vim and it didn't help.

Thanks to the tips from Ingo Karkat I was able to figure out that this was a problem with the version of ssh client (MobaXterm) I was using.
As I updated the client to 9.4, the normal behavior has been restored.

Related

error when switching to insert mode of vim after installing a github config

I am currently installing a vim config by the name of vimcake. Once the installation is done when I try to write to a file by switching to insert mode this error is displayed permanently. Would you have any information on this? I'm on macOS and using the native version of vim and it looks like Python 3.7.3 is on the machine.
Thank you

Cygwin not displaying Vi editor content over ssh

I am pretty new to Cygwin configuration and would need some help.
I have installed Cygwin successfully on a windows 2019 server and is able to ssh to a centos server.
However, while on the centos server there is nothing displayed when I issue the command “vi test.txt”. It shows a blank screen as I type and save the file with the usual vi commands. When I do a “more test.txt” , it is displaying what I have typed though.
The same happens for existing file when I do a vi, but since I can’t see the content , what I typed has corrupted the file. Would need advice on how to display the vi editor correctly.
I was able to launch vi editor locally on the Cygwin window though (without ssh into remote server, on local machine).
Make sure OpenSSH package is installed with Cygwin.
Source: I am the coworker who helped the original poster figure out the issue irl.
We used the cygwin installer to look through the list of existing packages and noticed that OpenSSH showed as "skip". After installing that package, the issue was resolved.

vim command for cscope does not under file

Previously I was on Ubuntu with vim/cscope.
Now I changed to CentOS due to team requirement, which also has vim and cscope:
vim version: 8.0
cscope version: 15.6
Then I went to c project, and cscope -R. I was in the cursed-based GUI, the search is ok with that GUI.
The issue is when I was in one file, and tried to use vim command like :cs find g xxxx.
It seems no reaction at all, the cursor just went back to where it was and no search result came up. That works good in previous Ubuntu
Anyone can help? Thanks

How to add python support for vim without destroying up all the plugins?

I started using vim earlier this summer and have recently started to add plugins. Todays challenge is to install YouCompleteMe.
Problem: During the installation process I noticed that my vim version (7.4) doesn't have support for python/python3.
Question: How can I fix this without messing up all my plugins/.vimrc file?
Will a clean install even affect my plugins/.vimrc?
I read some where that I should install 'vim-nox'.. Should I?
My setup: Ubuntu 16.04. Vim 7.4. Plugins are installed via Pathogen.
Thanks in advance for your replies!
Kind regards, Edvin
As long as your plugins are installed in $HOME/.vim (or MsWindows equivalent), and not into /etc/vim or /usr/share/vim, there should be no problem: you can upgrade your vim version without impacting what you have already installed.
See :h 'rtp' and :h startup.
Plugins and vimrc are just files. They can't be executed stand alone. Further, they come into power, only when vim is running.
So, your uninstallation/installation of vim doesn't change/affect plugins or vimrc. However, if the plugin or vimrc has code related to specific environment (like OS, terminal, etc,.) or needs specific features of vim and if your new version doesnt support them, you may have problems. Plugins in default folder(where vim is installed) will get deleted when you uninstall. The plugins in HOME directory aren't affected anyway.

Lack of file explorer in Linux vim

In vim 7.3 on OSX, if I type
vim ~/myfiles
vim will put me into the Vim File Explorer for that directory, and I can open or rename files.
In vim 7.4 on Ubuntu, I get the unhelpful error message
"~/myfiles" is a directory
Looking through the compiled options (vim --version) and online documentation, I see no obvious way to activate this functionality through, say, a command-line or compile-time option. It is such a great feature of vim that I'm surprised it is not enabled on the version of vim available in the Linux package.
Use the :E command for the explorer mode.
The ability to edit a directory like this depends on a plugin. Most of the time, that plugin is the "netrw" plugin provided with Vim in the official runtime files. In Ubuntu (and Debian) you install that runtime separately so that every Vim package can use it rather than duplicating functionality. Try installing the vim-runtime package, and maybe a more feature-full Vim while you are at it, if you have not already done so.
To summarize and answer my own question...
File explorer functionality is actually provided by a plug-in, "netrw", which seems not to be installed by default in the two or three versions of vim I tried via apt-get.
Installing NERDTree solved the problem brilliantly - it can do so much more than the default explorer. I have not yet figured out how to rename a file using NERDTree - something that is easy with 'netrw', but that is a minor irritant and there is probably a way to do it.

Resources