Getting hilighting in a vim color file - vim

I'm trying to edit my colour scheme in vim, and I remember when I was using Fedora I could get an easy preview of the colour when I changed it.
If I had a line like:
let ColourAssignment['String'] = {"GUIFG": 'LightYellow', "CTERMFG": '118'}
The word ColourAssignment would get hilighted as the colour I set 'string' to.
I'm using a mac now, but I have the same plugins and .vimrc as I had when using fedora.
Does anyone know what I need to set, or what plugin I could use to get this behavior again?

It's not exactly what you ask for (it highlights the colors themselves, not the highlight group name), but I can highly recommend the Colorizer plugin.

Maybe you want :hi String guifg=LightYellow ctermfg=118 and :syn match String /ColourAssignment/?

Alternatively, there are online Vim colorscheme editors, such as:
http://bytefluent.com/vivify/
http://www.vimtax.com/

I found the exact solution I was looking for, it turns out there is a syntax file included with the bandit colour scheme that allows for this functionality.
The repository is:
https://github.com/vim-scripts/bandit.vim

Related

How to change the color of Vim's (straight) underline?

I've tried everything changing the color of this:
call s:h("Underlined", {"fg": s:norm, "gui": "underline", "cterm": "underline"})
As well as all the colors of the link texts.
Does anybody know how to change it?
Here's a picture:
For anyone finding that in 2021, you can use guisp=red in neovim at least.
For example I use
:hi CocErrorHighlight gui=undercurl guisp=red
to have red curly lines.
I am using NeoVim in the Xfce-Terminal.
For a long time, you couldn't; the underline color always equaled the text color. AFAICT, in terminals this wasn't supported, and for consistency, Vim also didn't offer this in GVIM.
With Vim 8.2.0863, the ctermul attribute allows setting a separate color for underline / undercurl now. Apparently, this still isn't supported in GVIM, though (which I find odd, because Vim usually values consistency in features over fancy stuff (as explained by :help design-not)).
In GVIM, you could switch to the (GUI-only) undercurl attribute (mostly used for spell checking), which supports a separate "special color", set via guisp={color-name}; see :help highlight-guisp.
You can colorize underline only with ctermul(independent with ctermfg).
See this commit enabling that.

Mac OSX Terminal Vim displays javascript code with weird and horrid shade

I develop javascript and just recently I found that I still love to use Terminal Vim instead of MacVim. Then I was totally annoyed when I opened my usual javascript file in the Terminal Vim: the statements of the code are irregularly highlighted with a mysterious color.
Just to clarify that other file types I have opened (e.g. c, html etc.) do not have the problem. I have scoured website but I could not find an answer. This is just so unacceptable, could someone help me out. A million thanks!
My .vimrc screen shot:
You appear to be using Syntastic.
The first line with the red background seems to be marked as an error.
The Error highlight group is very often set to use a red background.
My conclusion is that what you see is exactly what you should see. It is ugly on purpose and designed to look like that: you don't want to miss errors, do you?
However, Syntastic can be set to not use the Error highlighting to mark errors but the "signs" feature instead which is a lot less ugly.
You should have read the Syntastic documentation as it is all explained in plain english:
:help syntastic-error-signs
Also, set background=dark is not very useful (it doesn't change the background color, if that's what you want) and can be removed safely from your ~/.vimrc.
I found out that it was this plugin jslint.vim that caused the text to be highlighted. The problem is that this plugin could not be disabled properly which I thought I did. Thanks to the hint of #romaini, syntactic is a better plugin to check code errors and make proper configuration.
As a side note, for those who would like to use vim solarized color scheme, please use the solarized terminal color scheme first. Otherwise the color scheme won't be displayed properly.
Thank you for all of your comments and answers! Really appreciated.
Try changing your colorscheme. Open the file in Vim, then do
:colorscheme blink
To cycle through all possible colourschemes, type :colorscheme, then a space, then press Tab. When you reach a colorscheme that sounds promising, press Enter, and see if the text looks OK. Keep doing this until you find a colorscheme that you like.
Once you have found a colorscheme that you like, copy its name, and put the following in your .vimrc:
colorscheme name
(name is the name of the colorscheme you like.)
My favourite colorscheme is blink, but there are many good ones. You can even go online and download new ones if the defaults are not good enough.
Seems the syntax are not recognized correctly. Could you try:
:set filetype=javascript
One other thing to look at to make things look better (will change colors not highlighting). Make sure that your terminal reports itself as xterm-256colors. You can check this by typing echo $TERM.
If it doesn't return xterm-256colors go to Preferences -> Settings -> Advanced (tab) on the profile you are using.
Change the drop down at the top to xterm-256colors.

vim editor error color

I am using Vim 7.3 on Ubuntu. Problem is - whenever I got some error in my code, that error is marked with white color. I can't see anything underneath that color. So if I have typo error (missing one brace) it will mark that brace with white, but I wont be able to see that mistake ( it is covered with color ). Sometimes it marks all line. I am using Molokai color scheme.
I tried to change color scheme, but nothing happens. I suppose that error color is coming from the vim native settings.
Any ideas how to fix this?
The
:hi
command lists all defined highlightings. Find the one with the white color (for errors, this should be Error), and change it (see :help :highlight) in your ~/.vimrc, e.g.:
:hi Error ctermfg=Red guifg=Red
If highlighting is the issue, then you can easily and quickly turn off all highlighting by typing ":noh" (without the quotes) from command mode. This will temporarily turn off highlighting. This also works for getting rid of highlighting after a search (which really annoys me because like your problem here, I can't read the text when it's highlighted).
If you haven't already, you should create a file in your home directory named ".vimrc", so pathing it out would be "~/.vimrc". This is the what #mtk is referring to (just in case you don't know that already. Some people at work use Vim but don't know about the .vimrc file).

How to set manualy color of params[] and redirect_to in Vim?

This is my colorscheme -> https://gist.github.com/1973544
But in example screenshot of sexy-railscasts: https://github.com/oguzbilgic/sexy-railscasts-theme
params[] and redirect_to are colored.
How to achieve this?
EDIT: Problem is with filetypes. Releated -> Ultisnips break rails syntax. How to setup correctly?
This colorscheme is, as specified in its header, "A GUI Only port of the RailsCasts TextMate theme to Vim.".
GUI colorschemes (for GVim or MacVim) can make use of thousands of colors. If you want to make Vim look like in the official screenshot you'll need to use GVim.
But you appear to be using it in a terminal emulator which can only display a maximum of 256 colors. For this "GUI Only" colorscheme to even work in your terminal, you probably have a color conversion plugin like CSApprox, do you? Such plugins will do their best to match your GUI colors to their closest equivalent in the X11 set but this task is obviously not foolproof. Some colors may be frankly off and I'm almost certain that's what's happening here.
EDIT
First, I don't do Ruby, even on Rails.
Second, the syntax group of params in params[:comment] depends on the filetype:
if I have :set ft=ruby.rails:
rubyBlock, rubyMethodBlock, rubyLocalVariableOrMethod
if I have :set ft=ruby:
rubyBlock, rubyMethodBlock, rubyRailsMethod
The problem is that rubyLocalVariableOrMethod, as defined in the default ruby syntax file appears to not being linked to Function unlike rubyRailsMethod, from the rails plugin.
So I think that it's the rubyLocalVariableOrMethod that is causing problems. I've been looking around on my machine and can't seem to find how, why and by whom it is set instead of rubyRailsMethod when ft=ruby.rails.
While waiting for a real solution, there is a global setting for using rails completion when :set ft=ruby, I think it should help: let g:rubycomplete_rails = 1.
I believe that is from the rails.vim plugin.

Weird VIM colorscheme, I don't know what's going wrong in my configuration

I got a weird vim interface, please take a look at the following image:
How can I remove those red blocks? It's not highlighted search.
What I did is switch from Gentoo to Arch, my ~/.vimrc remain unchanged.
Many thanks!
Looks like you've got spell-checking enabled.
:set nospell
If you want to find who set 'spell' (it's off by default), use:
:verbose set spell?
There's a syntax file that has those strings in it, telling the colorscheme to color them in some special way. The colorscheme defines that special way to be utterly hideous. :)
If you want that text highlighted, just differently, you'll need to edit your colorscheme. If you don't want that text highlighted, you need to remove them from the syntax definition.
Unfortunately I don't know much about that stuff as I'm mostly happy with the defaults on Windows...

Resources