Note
Only the on-premises / data-center Jira is supported (Jira Cloud only supports WYSIWYG editing, which renders this Vim syntax highlighting useless).
A Vim syntax-highlighting file for issues in the Jira issue-tracking system. Based on the official text-formatting help page.
Note: Some highlighting rules are simplified or might be missing. Feel free to contribute by opening an issue or a pull request.
The installation depends on the plugin manager you use (if any). Here are some of the options:
If you use vim-pathogen, go into the bundle directory and clone the repository in there:
cd ~/.vim/bundle
git clone https://github.com/s3rvac/vim-syntax-jira.gitIf you use lazy.nvim, add the following piece of code into your plugin configuration:
-- Vim syntax highlighting for Jira issues
-- https://github.com/s3rvac/vim-syntax-jira
{
"s3rvac/vim-syntax-jira",
}You can also install the plugin manually by copying the syntax/jira.vim file to your ~/.vim/syntax directory.
I use the Firefox web browser together with the textern extension to write and edit Jira issues in Vim. To automatically apply the syntax highlighting upon editing an issue, I use the following configuration (you will need to replace jira.mycompany.com with the URL of your Jira instance):
let s:opened_file_path = expand('%:p')
if s:opened_file_path =~ 'textern-.*jira.mycompany.com'
augroup firefox_textern_plugin
autocmd!
" Enable Jira syntax highlighting.
autocmd BufRead,BufNewFile *.txt setl ft=jira
" (Optional) Enable English spell checking.
autocmd BufRead,BufNewFile *.txt setl spell spelllang=en
augroup end
endifIf you want to edit descriptions of Jira issues in Vim, check out this blog post.
Use the test/test.jira file to test the syntax highlighting:
vim +'setl ft=jira' +'source syntax/jira.vim' test/test.jiraIf you use the syntax file in your Vim configuration and are unable to override it with the local syntax file, disable the syntax file in your Vim configuration while developing the plugin.
Copyright (c) 2024 Petr Zemek (s3rvac@petrzemek.net) and contributors.
Distributed under the MIT license. See the LICENSE file for more details.
