Is there any way to change the syntax highlighting in vimwiki in windows. I could not properly see the line enclosed between [[some word]]. The same works well in Linux.
I think this is because Windows' cmd.exe has very limited support for colours; you can only use 16, and those 16 are different from what Unix terminals use (which mostly support at least 256 colours nowadays).
The easiest solution is to just use Gvim. Windows is not designed to be used from the commandline, and doesn't really support it very well.
You can change the colours with the
First figure out which syntax highlight group is being used by going to the highlighted word with the cursor and:
:echo synIDattr(synID(line("."), col("."), 1), "name")`
This should give you a name such as
:highlight pythonConditionalyou can see the attributes set for this as well as a short preview. In the case of
pythonConditionalit links to another highlight group:
Conditional, which links to
Statement, which looks like:
Statement xxx term=bold ctermfg=3 gui=bold guifg=Brown
:highlight pythonConditional <attributes>we can set attributes. For example
:highlight pythonConditional ctermfg=redwould make the text red.
To make these changes permanent you need to add them to your vimrc file; but to make sure that it's not override by a filetype or colorscheme command, you'll typically want to do this in an
autocmd FileType python highlight pythonConditional ctermbg=green guibg=green
I have found a way to work 256 colors in windows using ConEmu, link available here for download.
After setting up ConEmu, check for these conditions -
Vim’s executable must be named ‘vim.exe’;
Check options ‘Inject ConEmuHk’ and ‘ANSI X3.64 / xterm 256 colors’ on Features page
Check option ‘TrueMod (24bit color) support’ on Colors page
Edit your ‘vimrc’ file, sample lines are here.
The following code is to be added to
if !has("gui_running") set term=xterm set t_Co=256 let &t_AB="\e[48;5;%dm" let &t_AF="\e[38;5;%dm" colorscheme zenburn endif
Of course, you need some 256-color vim scheme, it is ‘zenburn’ in the last line of this example.
Now I have no syntax highlighting issues when using vim in ConEmu. Check the link for the official documentation.