visrc.lua (1196B)
1 -- initializing vis' lua runtime 2 require("vis") 3 4 vis.events.subscribe(vis.events.INIT, function() 5 -- functions to be ran on INIT event 6 background = "dark" 7 vis:command("set theme base16-vis/themes/base16-summerfruit-dark") 8 end) 9 10 -- functions ran on window opening 11 vis.events.subscribe(vis.events.WIN_OPEN, function(win) 12 vis:command("set number") 13 vis:command("set autoindent on") 14 vis:command("set tabwidth 2") 15 vis:command("set autoindent true") 16 vis:command("set shell /bin/sh") 17 end) 18 19 -- initializing plugin manager 20 local plug = require("plugins/vis-plug") 21 22 -- configure plugins in an array of tables with git urls and options 23 local plugins = { 24 { "thimc/vis-colorizer" }, 25 { "e-zk/vis-shebang" }, 26 { "nomarian/vis-remove-trailing-whitespace", alias = "rtw" }, 27 { "https://codeberg.org/luxanna/vis-autoclose" }, 28 { "https://git.symlinx.net/vis-modal" }, 29 { "milhnl/vis-format", alias = "fmt" }, 30 } 31 32 -- initialize vis-plug and plugins 33 plug.init(plugins, true) 34 35 -- initialize remove-trailing-whitespace plugin 36 plug.plugins.rtw.Subscribe() 37 38 -- formatter 39 vis:map(vis.modes.NORMAL, "=", plug.plugins.fmt.apply) 40 plug.plugins.fmt.formatters.ansi_c = plug.plugins.fmt.stdio_formatter("clang-format")