logo
down
shadow

Double match highlighting for specific identifiers or filetypes


Double match highlighting for specific identifiers or filetypes

By : Hiren Patel
Date : November 21 2020, 11:01 PM
hop of those help? If you want to adapt the colors, you need to find out which syntax group causes the highlighting. It's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. Or just try which :highlight command changes the colors.
Many syntax scripts are hierarchical, i.e. a text is matched by multiple syntax rules. Without looking deeply into this particular Markdown syntax, I'd guess mkdNonListItemBlock is a generic block, and htmlH2 comes from the original HTML syntax.
code :


Share : facebook icon twitter icon
extend/modify vim highlighting for all filetypes at once?

extend/modify vim highlighting for all filetypes at once?


By : Aleksandr Sergeevich
Date : March 29 2020, 07:55 AM
I wish this help you You could try putting those two lines in ~/.vim/after/filetype.vim. That should get sourced after any of the top level syntax files. It's possibly not the 'correct' place to put it, but it should work.
filetype.vim seems to be sourced BEFORE the syntax files, so it gets overwritten by the default syntax file. Therefore, I'd recommend you create a new file called something like:
code :
~/.vim/after/common_syntax.vim
if !exists("after_autocmds_loaded")
    let after_autocmds_loaded = 1
    au BufNewFile,BufRead * source ~/.vim/after/common_syntax.vim
endif
Enable syntax highlighting for various filetypes in vim

Enable syntax highlighting for various filetypes in vim


By : Debbie Lairson
Date : March 29 2020, 07:55 AM
will be helpful for those in need I can enable syntax highlighting for a file that has an extension that is unknown to vim by doing the following , With autocommand. E.g.
code :
au BufNewFile,BufRead *.xyz setf c
vim - how to add doxygen highlighting to other filetypes, such as CUDA

vim - how to add doxygen highlighting to other filetypes, such as CUDA


By : gordonseto
Date : March 29 2020, 07:55 AM
Hope this helps I am programming in CUDA and whereas my C and C++ files automatically get doxygen highlighting by setting , Add the following to your ~/.vimrc:
code :
au Syntax cuda
        \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
        \       || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
        \   | runtime! syntax/doxygen.vim
        \ | endif
How do I create Vim syntax highlighting rules that are common to all filetypes?

How do I create Vim syntax highlighting rules that are common to all filetypes?


By : Alvin Sebastian
Date : March 29 2020, 07:55 AM
To fix this issue I'm trying to highlight trailing whitespace in vim, regardless of filetype. , Here is my own solution to the exact same issue:
code :
autocmd BufEnter,WinEnter * call matchadd("Error", "\\s\\+$", -1)
Syntax highlighting not looking at shebang line on known filetypes

Syntax highlighting not looking at shebang line on known filetypes


By : user2634693
Date : March 29 2020, 07:55 AM
This might help you Usually, the static file pattern comparison (in filetype.vim) is run before the detection based on contents (in scripts.vim), but since it's all Vimscript, nothing prevents you from messing with that order.
If this is just about the .cfg extension and Perl scripts, put the following into ~/.vim/filetype.vim:
code :
if exists('did_load_filetypes')
    finish
endif

augroup filetypedetect
autocmd BufNewFile,BufRead *.cfg        if getline(1) =~# '^#!/usr/bin/perl\>' | setf perl | endif
augroup END
shadow
Privacy Policy - Terms - Contact Us © soohba.com