require('vis') local plugin_manager = 'plugins/vis-plug' local plugins = { { 'timoha/vis-acme', theme = true, file = 'acme' }, { 'milhnl/vis-format' }, { url = 'https://git.cepl.eu/cgit/vis/vis-fzf-open' }, { url = 'https://gitlab.com/muhq/vis-lspc.git' }, { url = 'https://repo.or.cz/vis-parkour.git', alias = 'vis-parkour' } } function setup_plug() if not pcall(require, 'plugins/vis-plug') then os.execute('git clone --quiet https://github.com/erf/vis-plug ' .. (os.getenv('XDG_CONFIG_HOME') or os.getenv('HOME') .. '/.config') .. '/vis/plugins/vis-plug') end return require('plugins/vis-plug') end local plug = setup_plug() plug.init(plugins, true) function configure_plugin(name, config) if vis:module_exist(name) then local module = require(name) config(module) end end vis.events.subscribe(vis.events.INIT, function() configure_plugin('plugins/vis-format', function(format) vis:map(vis.modes.NORMAL, '', ':fzf') vis:map(vis.modes.NORMAL, '=', format.apply) end) configure_plugin('plugins/vis-lspc', function(lspc) if next(lspc) then lspc.logging = true lspc.log_file = "/tmp/lspc.log" lspc.ls_map.rust = { name = "rust", cmd = "rust-analyzer", formatting_options = {tabSize = 4, insertSpaces = true} } lspc.ls_map.lua = { name = "lua", cmd = "lua-language-server", formatting_options = { insertSpaces = false } } end end) end) vis.events.subscribe(vis.events.WIN_OPEN, function() --per-window configuration-- --vis:command('set number') --vis:command('set showtab on') vis:command('set showspace off') vis:command('set autoindent on') vis:command('set cursorline on') vis:command('set tabwidth 4') end) return nil