add visrc and lithaskell lexer
This commit is contained in:
parent
80ad92eb58
commit
d5c8feba9a
18
config/vis/lexers/lithaskell.lua
Normal file
18
config/vis/lexers/lithaskell.lua
Normal file
@ -0,0 +1,18 @@
|
||||
local l = require('lexer')
|
||||
local token = l.token
|
||||
local S = lpeg.S
|
||||
|
||||
local M = {_NAME = 'lithaskell'}
|
||||
|
||||
local haskell = l.load('haskell')
|
||||
local start_rule = token(l.STYLE_EMBEDDED, l.starts_line(S('><')))
|
||||
local end_rule = token(l.STYLE_EMBEDDED, l.newline)
|
||||
|
||||
local line = token(l.COMMENT, l.nonnewline^1)
|
||||
M._rules = {
|
||||
{ 'comment', line }
|
||||
}
|
||||
|
||||
l.embed_lexer(M, haskell, start_rule, end_rule)
|
||||
|
||||
return M
|
5
config/vis/plugins/myfiletype.lua
Normal file
5
config/vis/plugins/myfiletype.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require("plugins/filetype")
|
||||
|
||||
vis.ftdetect.filetypes["lithaskell"] = {
|
||||
ext = { "%.lhs$" },
|
||||
}
|
27
config/vis/visrc.lua
Normal file
27
config/vis/visrc.lua
Normal file
@ -0,0 +1,27 @@
|
||||
-- load standard vis module, providing parts of the Lua API
|
||||
require('vis')
|
||||
require('plugins/complete-word')
|
||||
require('plugins/myfiletype')
|
||||
|
||||
vis.events.subscribe(vis.events.INIT, function()
|
||||
-- Your global configuration options
|
||||
end)
|
||||
|
||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||
-- Your per window configuration options e.g.
|
||||
-- vis:command('set number')
|
||||
vis:command('set tabwidth 4')
|
||||
vis:command('set autoindent on')
|
||||
vis:command('set expandtab on')
|
||||
vis:command('set show-tabs on')
|
||||
vis:command('set number')
|
||||
vis:command('set theme dark-16')
|
||||
end)
|
||||
|
||||
vis:map(vis.modes.NORMAL, ";l", function()
|
||||
local out = io.popen("fzf"):read()
|
||||
if out then
|
||||
vis:command(string.format('open %s', out))
|
||||
end
|
||||
vis:feedkeys("")
|
||||
end)
|
Loading…
Reference in New Issue
Block a user