mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-02-21 12:14:47 +01:00
nvim: moved viper highlighting to separate repository and imported it
This commit is contained in:
8
.config/nvim/lua/plugins/viper-nvim.lua
Normal file
8
.config/nvim/lua/plugins/viper-nvim.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
-- highlighting for the viper verification language
|
||||
"tiyn/viper.nvim",
|
||||
event = { "BufReadPre *.vpr", "FileType viper" },
|
||||
config = function()
|
||||
require("viper").setup()
|
||||
end,
|
||||
}
|
||||
@@ -129,27 +129,3 @@ vim.opt_local.colorcolumn = "+" .. vim.fn.join(vim.fn.range(0, 254), ",+")
|
||||
vim.o.list = true
|
||||
vim.opt.listchars:append("space:" .. Space_sign)
|
||||
vim.opt.listchars:append("eol:" .. Return_sign)
|
||||
|
||||
-- custom viper-highlighting
|
||||
local viper_group = vim.api.nvim_create_augroup("ViperSyntax", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = viper_group,
|
||||
pattern = "viper",
|
||||
callback = function()
|
||||
vim.cmd("syntax enable")
|
||||
vim.cmd([[
|
||||
syntax keyword viperKeyword method function returns requires ensures invariant
|
||||
syntax keyword viperKeyword if else while var field predicate
|
||||
syntax keyword viperKeyword assert
|
||||
|
||||
syntax keyword viperType Int Bool Ref
|
||||
|
||||
syntax match viperComment "//.*$"
|
||||
syntax match viperNumber "\v\d+"
|
||||
]])
|
||||
vim.api.nvim_set_hl(0, "viperKeyword", { link = "Keyword" })
|
||||
vim.api.nvim_set_hl(0, "viperType", { link = "Type" })
|
||||
vim.api.nvim_set_hl(0, "viperComment", { link = "Comment" })
|
||||
vim.api.nvim_set_hl(0, "viperNumber", { link = "Number" })
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user