Color a file type with VIM

I am using gVim 8.0 for Windows. You can copy log.vim to C:\Program Files (x86)\Vim\vim80\syntax folder. You can add following lines to C:\Program Files (x86)\Vim\vim80\filetype.vim file (usually in alphabetical order listing):

” Log
au BufNewFile,BufRead *.log setf log

———- content of log.vim —————–
” Vim syntax file
” Language: Log file
” Maintainer: Chirag Patel
” Latest Revision: 08 August 2017

if exists(“b:current_syntax”)

:syn keyword logError CRI Error Exception FAILED Failed failed error aborted
:syn keyword logWarning WRN warning Warning Stopped
:syn keyword logInfo INF
:syn keyword logDebug DBG

hi def logError guibg=red guifg=white
hi def logWarning guibg=yellow guifg=black


પ્રતિસાદ આપો

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  બદલો )

Google+ photo

You are commenting using your Google+ account. Log Out /  બદલો )

Twitter picture

You are commenting using your Twitter account. Log Out /  બદલો )

Facebook photo

You are commenting using your Facebook account. Log Out /  બદલો )


Connecting to %s