vim freezes when changing colorscheme - vim

I start vim without custom config
vim -u NONE
Then, I call the colorscheme command to change the colorscheme, and vim simply freezes.
:colorscheme desert
It does not matter what colorscheme I specify, vim always freezes.
This happens on Mac OS only. I upgraded my macvim from 8.1 to 8.2, and I still see the freeze.
I don't think anything is wrong with my vim config since I am launching vim without custom config.
Any suggestions on how to either fix or debug the hang?

The issue is with Mac Terminal Itself. It used to freeze for me too but now I've switched from bash to zsh and everything works fine even for my Macbook Air 2017(8 GB) and on top of that I am using over 20 plugins which include a lot of linters and fixers.
Difference from bash to zsh is the reason that I am back to Vim again.
Also, if you have Catalina on your system, zsh is in there ,you'll just have to set it as default

Related

How to make the gx command work for URLs in Vim on XFCE4 Desktop?

With GVim on my Windows 7 system, if I press gx while the cursor is on an URL, it launches the URL in Firefox (my default browser on Windows).
However, when I do the same on my XFCE4 Desktop on Debian 8.3 Linux system, pressing gx does nothing at all.
I am using GVim (Vim 7.4) on both systems.
The :let g:netrw_browsex_viewer command returns E121: Undefined variable: g:netrw_browsex_viewer on both systems.
I tried entering the :let g:netrw_browsex_viewer= "xdg-open" command on the Linux system, but it didn't help at all.
I have two questions:
Why does the gx command work for URLs on the Windows system but not on XFCE4 desktop on the Debian Linux system even though g:netrw_browsex_viewer is undefined in both?
How can I make the gx command work for URLs on XFCE4 desktop on the Debian Linux system?
Normally, the following command should work, and it does work when executing Vim 7.4.576 within Xfce terminal (xfce4-terminal 0.6.3).
:let g:netrw_browsex_viewer="xdg-open"
But the above command does not work in GVim 7.4.576 in Xfce 4.10 due to Bug 12251 - exo-open URL does nothing from gvim.
A workaround suggested by Christian Brabandt that works for me is the following.
:let g:netrw_browsex_viewer="setsid xdg-open"
I should read more carefully!!
You are using GVim. There is an open bug issue with the gx command with GVim using Xfce4. It doesn't look like it's been fixed. But from some discussions, it appears you can circumvent the issue by using:
let g:netrw_browsex_viewer="setsid xdg-open"

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.

GVim does not launch after installing plugins (Windows)

I installed Vim 7.4 in a Windows 8 machine and it was working fine. After installing all plugins in my .vimrc, GVIM crashed and it wouldn't open again. I could manage to use VIM from cmd but not without some errors. My first try was to reeinstall GVIM completely. After reinstalling, it worked fine but if I also reinstall my plugins it would crash and not open again. What should I do?
I removed all plugins and installed one by one until I got the error, which was with the Ultisnips plugin. I happen to know that this plugin requires VIM with Python support, which my VIM probably wouldn't have. To test this, run vim --version and look for a +python (or run echo has("python") from inside GVIM and look for a output of 1). In my case, it was -python, which was confusing, since I have Python installed. According to this answer, you need to install Python after installing VIM, so I did it and it worked.

Using the correct version of vim

I installed vim with:
brew install vim --override-system-vi
I also installed macvim using:
brew install macvim
However, terminal vim uses 7.4.52 and macvim uses 7.4.22. Any way around this?
I've uninstalled and reinstalled many times, but I must be doing it wrong...
which vim returns /usr/local/bin/vim
which mvim returns /usr/local/bin/mvim
Any help would be greatly appreciated.
Thnx!
You only need to install macvim: it runs both as a GUI and in the terminal.
I don't know where the confusion comes from but neither gvim nor macvim are frontends for a separate vim. They are vim.
you can rename your system vim, then vim will be the mac vim
You've installed two different pieces of software..but you only want to use one? If so, then just alias your macvim in your shell; for example:
alias vim="/Applications/MacVim.app/Contents/MacOS/Vim"

Get colors using Mac OS X terminal when editing source code in remote linux machines

I use terminal from Mac OS X Leopard to connect to remote Linux machines and edit C++ code there using VI.
What determines that in some machines, using the same MACOSX terminal settings, the source code gets colorized and in other not?
Thanks
Have you used :syntax enable in vim on the remote machine? Just asking, since on the ones that are working it could be in .vimrc or similar.
Usually, the $TERM environment variable determines whether the terminal is capable of color.
$TERM is set upon connection to the remote terminal. From there, you can try export TERM='xterm-color' and see what happens.
Setting the .vimrc with
set term=xterm-color
worked for me in OS X tiger server. I put this at the top of the .vimrc. I also set the term app on OS X El capitan host to xterm in the preferences. I have syntax highlighting over ssh. Thanks again
In my case, these "remote linux machines" usually have a 'small' or 'tiny' version of vim installed which does not have syntax highlighting. When in vim, enter the command :version, and see if you have +syntax or -syntax in the feature list. If you don't have +syntax, then vim has been compiled without syntax support and you need to recompile vim on that machine.

Resources