Vim syntax highlighting for common and slow mysql query logs

I looked at Github and vim.org to highlight the syntax for MySQL log files. In particular, for magazines with slow request, but I came empty-handed. I used the mysqldumpslow command to make these logs less painful, but syntax highlighting in Vim would be ideal.

The syntax highlighting for mysqldumpslow will also work. I decided to create my own syntax file, maybe this will be a good project to learn.

I do not know if this matters, but OSX Lon and mvim are running on my workstation.

+4
source share
1 answer

I usually just force the problem locally by releasing

 :se ft=sql 

(add :syntax on if you don't have it in .vimrc)

Now, see :help modeline for ways to install this from the log file itself or :he autocmd for this to happen when downloading files with specific extensions (or names)

+4
source

Source: https://habr.com/ru/post/1392807/


All Articles