I'm using the Solarized theme for vim (which is amazing), but the color defaults for EasyMotion are, well, downright unreadable.
When I activate EasyMotion, the leader letters are clearly visible (bright red, with Solarized Dark), but the words they key to are barely a shade different from the background (dark blue against slightly darker blue background).
How can I change this to be more readable?
SOLUTION: Edit your .vimrc file like so:
" change the default EasyMotion shading to something more readable with Solarized
hi link EasyMotionTarget ErrorMsg
hi link EasyMotionShade Comment
A la section 4.5 in the docs for the plugin.
The author of EasyMotion has written excellent documentation on what is possible with EasyMotion. The helptags that stand out to me are EasyMotion_do_shade and easymotion-custom-hl. These define whether or not to highlight the shaded text and how to hilight the shaded and target text.
I tend to use the same highlighting as when searching.
There are also two more settings available, refering to the source code (https://github.com/Lokaltog/vim-easymotion/blob/master/t/easymotion_spec.vim#L507) :
" easymotion highlight colors
hi link EasyMotionTarget Search
hi link EasyMotionTarget2First Search
hi link EasyMotionTarget2Second Search
hi link EasyMotionShade Comment
Related
In latex files I have the on-fly spelling switched so you can imagine that together with the syntax highlighting there is already a lot of colors in the terminal screen. When in such environment I am running a string replacement, say with :%s/x/y/gc I need a lot of time to identify where the string-to-be-replaced is located in all this color mess. Is it possible to make vim's current selection blink?
You change the highlighting of the to-be-replaced text with highlight IncSearch.
For example,
:highlight IncSearch ctermfg=Red guifg=Red
highlights the text with a red background (despite it being fg not bg).
However, I don't think there's any way to make it blink (and are you sure you really want that?). You might be able to use italics or underlines instead. See :h highlight for the options that are available.
In the theme I'm using for vim, the strings are shown in red color but the problem is I have spellcheck on and the misspelled words are also shown in red color.
This makes it hard to see what is the mistake until you go to that word and delete any character.
I want to make the highlightation of the misspelled word in somewhat lighter then it currently. Say #ff2929.
You can use the hi (short for :help highlight) command in your ~/.vimrc. The general structure is:
hi SpellBad ctermfg=015 ctermbg=000 cterm=none guifg=#FFFFFF guibg=#000000 gui=none
The cterm is for terminal vim and the gui is for gVim. The fg stands for foreground and is the color of the letters and the bg stands for background and is the color behind the letters.
Terminal colors can be 0-15 for standard terminal colors (8 normal and 8 bright) or 0-255 for terms supporting 256 colors, like xterm-256colors. The gui colors are in hexadecimal format. xterm-color-table is a useful reference for both 256 and hexadecimal colors. The final option can be used to specify bold, italic, or none (neither).
In your case, it might be simplest to set the foreground to black to make the letters stand out. First, find a word that's mispelled with :set spell and then typing asdflkjasldf or something. Then type :hi SpellBad ctermfg=000 guifg=#000 and see if that's a solution you like. If not, use the xterm-color-table or another color reference to find a color you do like.
Try this:
:hi SpellBad guibg=#ff2929 ctermbg=224
guibg is for GUI
ctermbg is for TERM
I found the following to halfway work for a more complex example involving colorscheme, but it is sensitive to the order of .vimrc commands. I tested with Cygwin/mintty and Git Bash, vim 8.0, with similar results. I edited a markdown file with "misspelled" words in headings and paragraphs, so an additional factor is the auto-formatting that vim is doing for markdown. If the .vimrc order is spell, colorscheme, and then hi (trying to use white text on red background), the result for misspelled words is white foreground on black background (image below), regardless of whether in markdown heading or paragraph. This is OK but I'd prefer to have the background for misspelled words be more eye-catching, which is why I specified red background.
However, if the order is spell, hi, and colorscheme, the result is OK in paragraphs but undesired pink on red in headers (image below). This is actually the original behavior without hi, which makes sense because the colorscheme is probably stepping on the hi settings. Based on other testing, the relative position of hi and colorscheme is what is important.
I think I'm going to go with the first option because at least the highlights seem to be in all content, but it would be nice if the red background is used. The following is my .vimrc lines for the first case. Any guidance to fix this would be appreciated.
" Turn on spell-checker
set spell
" Color scheme
" To pick from available list do:
" :colorscheme _space_ Tab
" Reasonable options seem to be: koehler, murphy, elford
colorscheme koehler
" Using the colorscheme with spellchecking results in highlights with
" pink text on red background, which is hard to read, so change the highlight color.
" Color table: https://github.com/guns/xterm-color-table.vim
" Use white text on red background for misspelled words.
hi SpellBad ctermfg=015 ctermbg=009 cterm=bold guibg=#ff0000 guifg=#000000 gui=bold
I'm on pretty old RedHat distribution with VIM-6.3 installed, and whenever I do search with "/" it highlights the text found in a very bright yellow color, so I'm unable to see the text under it. Is there a way to change the brightness to something more appropriate?
With Vim, try::hi Search ctermbg=Green
With gVim: :hi Search guibg=Green
to set the background color to green, for example.
You could try to use some different colorscheme, just type :colorscheme and then press TAB to go trough the various schemes.
I don't want to learn how to create a new scheme. I just want to replace some color with another color everywhere in default color scheme.
This is how default.vim (default color scheme by Bram Moolenaar) looks like with comments removed:
hi clear Normal
set bg&
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "default"
As you see it doesn't define any colrs it uses whatever the colors used to be (in C code, I guess).
So, how can I replace some color with another color everywhere?
Example: default color scheme highlights some groups of text with color 'ugly' and I want it to highlight it with colour 'neutral'.
Is question clear enough now?
*:hi-default* *:highlight-default*
The [default] argument is used for setting the default highlighting for a
group. If highlighting has already been specified for the group the command
will be ignored. Also when there is an existing link.
Using [default] is especially useful to overrule the highlighting of a
specific syntax file. For example, the C syntax file contains: >
:highlight default link cComment Comment
If you like Question highlighting for C comments, put this in your vimrc file: >
:highlight link cComment Question
Without the "default" in the C syntax file, the highlighting would be
overruled when the syntax file is loaded.
Here is how to replace a color everywhere in Vim. First, use the :highlight command in vim to view a sample of all the predefined color groups. You should also read the output of :help highlight to see the definitions of all the color highlighting groups.
Once you have identified the group you want to change the a candidate replacement group (with a better color), use a command like this:
" Fix the difficult-to-read default setting for search/replace text
" highlighting. The bang (!) is required since we are overwriting the
" DiffText setting. Use the ":highlight" command in vim to see
" alternate color choices if you don't like "Todo" or "StatusLine"
highlight! link IncSearch Todo " Yellow
highlight! link Search StatusLine " Light tan
" Fix the difficult-to-read default setting for diff text highlighting.
" The bang (!) is required since we are overwriting the DiffText
" setting. The highlighting for "Todo" also looks nice (yellow) if you
" don't like the "MatchParen" (Aqua) diff color.
highlight! link DiffText MatchParen " Aqua
" highlight! link DiffText Todo " Yellow
The vim help for highlight shows you can also specify colors as hex RGB like:
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
There is also a lot of good information to be found by using :help syntax.
As always, once you have found the colors you like, you should save them in your ~/.vimrc file (saved in Git, of course!) so they are applied automatically every time you fire up GVim.
How can I change between different color schemes in vi?
you could try different color schemes like this:
https://kb.mediatemple.net/questions/1565/Enabling+vi+syntax+colors#gs
My problem was only deep blue comment color in default color scheme, so I changed just that:
cd ~
vi .vimrc
highlight comment ctermfg=lightblue
or change lightblue to cyan or whatever
As far as I know, plain ol' vi doesn't provide different colorschemes. If you are using vim however, you can type :colorscheme <newcolorscheme>. You can use tab to cycle through the installed colorschemes.
See http://vim.wikia.com/wiki/Switch_color_schemes for more information