I'm using this Vim configuration. I save and restore Vim sessions using these 2 commands:
:mksession! ~/.vim_session
:source ~/.vim_session
There's no syntax highlighting after I restore a session. How can I fix this?
My Vim version:
VIM - Vi IMproved 7.3.462 (2010 Aug 15, compiled Mar 26 2012 21:45:48)
MacOS X (unix) version
Included patches: 1-462
There is a note at the end of the "Views and Sessions" chapter of the documentation (see the last paragraph of this section). In particular, :syntax on is not restored by the session file.
Does it work if you enter :syntax on manually after loading the session?
Related
I noticed this fact trying to use Yggdroot/indentLine plugin, which requires conceal feature.
$ /usr/bin/vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 29 2017 18:37:46)
Included patches: 1-503, 505-680, 682-1283
Compiled by root#apple.com
Normal version without GUI. Features included (+) or not (-):
...
-conceal +libcall -profile +visualextra
...
Vim > 7.3 usually supports +conceal feature.
Does anybody know why apple explicitly excluded conceal feature when compile?
Thanks in advance.
It's hard to tell why exactly that's the choice they took. Only an Apple
employee would be able to help us in explaining this. However, I don't
think it's an explicit exclusion of conceal by itself.
When you compile Vim, the configure script accepts an option called
--with-features which controls a set of features to be enabled or
disabled.
--with-features=TYPE. tiny, small, normal, big or huge (default: huge)
from src/auto/configure L1532
The conceal feature is only enabled with big or huge, and
dependent on +syntax:
/*
* +conceal 'conceal' option. Needs syntax highlighting
* as this is how the concealed text is defined.
*/
#if defined(FEAT_BIG) && defined(FEAT_SYN_HL)
# define FEAT_CONCEAL
#endif
from src/feature.h L496-502
You can see a handy list of what is included in each feature set by
checking :h +feature-list. Thus, judging by the other features, I'd
say conceal is disabled just because they are compiling with the
feature set option --with-features=normal.
It's highly recommended to install a newer and more complete Vim.
Replacing the system program might not be optimal, but that's exactly
why there are plenty of alternatives which take care of doing it right
and keeping Vim updated and complete. If you have Homebrew
installed, a simple command will do:
$ brew install vim
Alternatively, if you have MacVim you can also use its internal
executable by making an alias on your shell or something similar.
When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.
What can I do as this behaviour is very annoying.
As I had git for Windows installed anyway I just replaced the terminal used by IntelliJ from cmd.exe (which is the default on windows) to bash.exe supplied by git for Windows (which is cygwin btw)
To change it for all projects go to File >> Other Settings >> Default Settings and then Tools >> Terminal. (see screenshot)
In the shell path field set the following line:
"C:\Program Files\Git\bin\bash.exe" --login -i
Please make sure git is installed at the proper localtion or adjust the path (for example if you have the 32bit version of git installed)
Using bash instead of cmd, the problem does not occour for me. Plus the bash supports some commands that cmd does not support, which is kinda nice when been used to a linux environment.
EDIT 2020-09-30: In latest Intellij versions the Terminal is a project-level setting and can be changed here:
Sometimes it could be because of vim emulator just turn it off
Go to Tools
Deselect Vim Emulator
Because Vim mode is checked,
Tools, Vim Emulator, there will be a √ in front of it, just cancel it, as shown in the figure:picture
I hope i can help u.
I tried to upgrade my system Vim from 7.3 to a high version so I used macport to do that. This newer version is located in /opt/local/bin/. Later I decided to uninstall it due to some reason.
Now I can't open my system Vim in the terminal, the error message is -bash: /opt/local/bin/vim: No such file or directory. Somehow the machine still thinks the vim is located in /opt/local/bin/.
Then weird thing happens, when I type which vim, it shows my vim located at /usr/local/bin, and there is indeed a vim folder in that directory, but I can't open it by typing vim in the terminal.
So here is the situation: I have two working versions of Vim in my machine, a 7.3 version in /usr/bin and a 7.4 version in /usr/local/bin(I don't know how I got this one). Both working (I have to type the whole directory /urs/bin/vim or /urs/local/bin/vim), but can't be opened in the terminal by simply typing vim.
Updates:
now I can use vi or vim, but the problem is, the former opens 7.3 whereas the latter opens 7.4
At the current command window, type:
$ hash -r
then try running vim again. Or create a new window and try in that.
Bash remembered where vim was found, and expects to find it there again. When you removed vim, it got upset and complained (rather than try to find it again before complaining). Using hash -r vim forgets all previously hashed commands and then finds vim explicitly. Run hash with no options to see what it knows.
See the Bash manual on hash for more information.
The default Vim is /usr/bin/vim. There is absolutely no reason whatsoever to change it.
If you want a more up-to-date Vim, install MacVim and use the bundled mvim script instead of vim.
I've recently upgraded to OSX 10.9 (Mavericks) and upgrade everything on Homebrew and even reinstalling vim making sure I have the latest stable version that works with Mavericks. (Vim 7.4)
But I start having this annoying warning every time I tried to editing anything with vim:
"~/.vimrc" 497L, 12210C^[[>0;95;c
Command terminated
Press ENTER or type command to continue
I know my vimrc might not be correct, but is there a way to debug this? I think it's some system command that I called on vimrc that mess it up, but is there a way to get more debugging info on which commands fail ?
Thanks,
Alright, I think I find the answer.
You can always start vim with some debugging info output to a log file:
vim -V9vim.log ~/.zshrc
That helped me!
I'm SSH'ing in from my mac OSX (10.6.8) to a school server running centOS5 and when I attempt to use VIM, it won't stop flashing inside the mac terminal. Any idea's on how to fix this? Keep in my mind I do not have the authority to modify any /etc files or /bin files on the server, although I believe I can locally on my user. Also I would love to see anyone's really cool .vimrc config file they want to share.
Try these out:
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
Though the link may go stale in the future, for the time being this is the source: http://phuzz.org/vimrc.html
I also know that you can set this via terminal options on the MAC, though this is not likely the issue if you are ssh-ing. Anyway, I hope it helps. Good luck! :)
I´ve just had the same issue.
I solved it by disabling the setting "Allow blinking text" in the terminal text settings as shown in this
screenshot.
Regarding .vimrc config there are tons of versions to be found on google, especially github is a good place to go.
to stop beeping & flashing in both the console & the GUI versions of Vim try:
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
I was pretty frustrated with macvim installed via brew.
First, on installation, it had an issue with the python version.
I did upgrade brew and python. Then I started macvim but it was flashing really bad, to eliminate, I had to ***disable core text renderin***g under preferences -> advanced options.
Finally, it got stable but couldn't open files or tabs.
objc[80401]: Class FIFinderSyncExtensionHost is implemented in both
/System/Library/PrivateFrameworks/FinderKit.framework/FinderKit
(0x10d099200) and
/System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride
(0x115309c00). One of the two will be used. Which one is undefined.
So I decided to get rid off it altogether.
brew uninstall --force macvim
Installed it manually from here.
Once installed, I used the following command to create an alias. Add the following line to your .bashrc or .zshrc (for iTerm users).
alias mvim=/Applications/MacVim.app/Contents/MacOS/MacVim -g
Now reload your terminal session and type mvim. Enjoy!!