How would I do it? I've been reading around and I cannot figure it out. Let's say I want to enable syntax checking for C++. How would I do that?
After Installing Syntastic using pathogen or your favorite plugin manager,
By default it will give you highlight the line numbers about error messages.
If not, may be the file might not be detected as correct file type.
Please set the file type to CPP. using the following ex command.
:set ft=cpp
General behaviour is that the error messages will show up after we save the buffer using :w
If you want to manually view the error message suggestions later at any point of time, Use the following command
:SyntasticCheck
More about the global commands of syntastic can be found in help documentation using the following command.
:h syntastic
Hope it helps.
Related
It seems like almost every time I open a file in Vim anymore, I'll get an error like this:
Error detected while processing /Users/me/.vim/view/=+something=+something=+something...
E518: Unknown option: nomacmeta
The option is usually something different depending on the file. I've done :help view but the results weren't very helpful. Is there some way I can disable this view feature so I can stop getting these errors? I don't have time to run down every one of them.
:help 'macmeta' is an option specific to MacVim. You are having this error because you are sourcing a view script that contains the command set nomacmeta in a Vim that is not MacVim and thus doesn't support that option.
Either…
you are on a Mac but you are using the built-in Vim at /usr/bin/vim, which is not MacVim,
or you are on a Mac but you are using a manually built Vim, which is very likely to not be MacVim,
or you are on some other system where Vim is pretty much guaranteed to not be MacVim.
To prevent those errors, remove any non-cross-platform option from your view scripts and consider reading :help :mkview carefully, specially the part about :help 'viewoptions'.
Also, &macmeta is disabled by default so disabling it doesn't make much sense to begin with.
I recently installed the plugin vim-javacomplete2 via vim-plug into Vim 7.4. Overall, I am happy with it but there is one thing that bugs me. When i initiate it with <C-x><C-o> it writes the first suggestion to the line like so.
Is there anyway to have it list the suggestions without writing the first one to the line like this?
I see it done on the plugin's GitHub page but i am unable to figure out how.
Since it says it uses the vim omnicompletion, i bet it works with the normal completopt settings: :set completeopt+=noinsert see :help completeopt for more information
Today I installed vim on my new computer and installed a couple of plugins.
When I start vim (with no arguments and with files to edit) I get a lot of verbose output in my console which I never encountered before.
This seems to be something from the vim sourcecode or from a plugin but I couldn't encounter where it comes from and especially why.
I'm interested in tracking down this issue. How can I do that?
I tried searching for some of these lines in my plugin folder but got no results and starting with the -D flag also gave me no hint. Google and SO search also yielded no results for me.
Additionally I tried to disable each plugin seperately but this also failed.
Thanks.
PS: I would like to provide a picture but since the output is more than 150 lines long this is not a good idea since it doesn't seem to be related with a plugin and I don't have enough reputation.
Maybe a very small part of it:
syntaxset FileType
*exe "set syntax=" . expand("<amatch>")
filetypedetect StdinReadPost
...
svn-commit*.tmp
setf svn
Xresources*
call s:StarSetf('xdefaults')
*/app-defaults/*
Remark: This is not representative since it is randomly chosen from the terminal output, I just wanted to give an impression what is going on.
EDIT: This is NOT an error, its just printing out some kind of source code. Everything is working fine otherwise.
SOLUTION: Removing the autocmd line without any further text did the job. Thanks to FDinoff. Debugging with finish is really pleasant.
Some Vim commands, when argument(s) are left off, print all existing such artifacts. This is useful during interactive use, but if you forget to specify the argument in your (plugin / ~/.vimrc) configuration, this has the effect of "printing cryptic code" (an error would be more useful here).
Your output is likely from an :autocmd without arguments. Check your ~/.vimrc and other files read during startup (see :scriptnames).
So I am programming in C with VIM by using the make command to compile my code.
I would like to use the quickfix plugin to quickly move to the different compile errors but the only error that quickfix shows is the failed command in the make file.
I have failed to find any clues on google for this problem, is there something I could be missing to make this work?
The quickfix list (it's built in, not a plugin) parses the output of :make according to the rules in the 'errorformat' option, in order to extract file names, line numbers, and error messages.
Usually, you don't write those yourself, but you simply choose the appropriate compiler plugin. If your build uses GCC, you can set the compiler by
:compiler gcc
See :help compiler for details and a list of compiler plugins that ship with Vim.
I have finally solved the problem.
It turns out that if your shell is set to use FISH the output of the make command displays correctly but for some reason quickfix is unable to pick up any errors except for the failed part in the make file.
I solved the problem by switching vim to use bash instead by adding set shell=/usr/bin/bash to my .vimrc file.
I want to be able to have errors from cljsbuild appear in my Vim quickfix window. More detail below.
I'm enjoying ClojureScript while using Vim as my editor but I want to improve my work flow.
Currently I edit in Vim and have a watcher task in another terminal that will auto build whenever I change any source. My leinengein file is configured to spawn this with
lein cljsbuild autobuild
This is great as I don't have to spin up the JVM for every compile and it's pretty quick. So the work flow is:
Edit
Save
Auto compile
Switch to the browser
Refresh and run
Nice :) The only issue is when I get an error or warning. I have to keep an eye on the other terminal window to see if there's any error spew and then work out where the error line is by trawling through it. I'm a bit of a newb so I get a lot of errors :D
What I'd prefer is having any errors appear in Vim in my quickfix window so I can jump to them quickly while not giving up the benefits of having the cljsbuild run as a file watcher.
Is this possible? Any help gratefully received :)
gaz
As long as the errors are shown in stdout, Vim can show these errors and respective line numbers from the quickfix window.
Since I don't use clojurescript, you'll have to read Vim's documentation about makeprg and errorformat. This is rather straight forward.
I've used makeprg with autocmd before, but now I let Syntastic do the work for me. Unfortunately, it doesn't support clojurescript at the moment, you could do a pull request if you get it to work.
As long as you can capture the build output into a file (by appending > build.log or | tee build.log), you can then load this into Vim's quickfix list via:
:cfile build.log
Of course, you need to set an appropriate 'errorformat' first so that Vim is able to correctly parse it.