Created
April 21, 2020 23:50
-
-
Save sobrinho/ce4f95a07f3f090b8c9e68386be4d3d7 to your computer and use it in GitHub Desktop.
Highlight SQL and GraphQL in Ruby files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Add this file to ~/.vim/after/syntax/ruby.vim | |
" | |
" https://thegreata.pe/articles/2018/01/01/vim-syntax-highlighting-for-sql-strings-inside-ruby-code/ | |
unlet b:current_syntax | |
syn include @SQL syntax/sql.vim | |
syn region sqlHeredoc start=/\v\<\<[-~]SQL/ end=/\vSQL/ keepend contains=@SQL | |
let b:current_syntax = "ruby" | |
unlet b:current_syntax | |
syn include @GRAPHQL syntax/graphql.vim | |
syn region sqlHeredoc start=/\v\<\<[-~]GRAPHQL/ end=/\vGRAPHQL/ keepend contains=@GRAPHQL | |
let b:current_syntax = "graphql" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment