Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

FIX: visrc

+41 -27
+41 -27
vis/visrc.lua
··· 1 1 require('vis') 2 - 3 - local plug = require('plugins/vis-plug') 4 - 2 + local plugin_manager = 'plugins/vis-plug' 5 3 local plugins = { 6 4 { 'timoha/vis-acme', theme = true, file = 'acme' }, 7 5 { 'milhnl/vis-format' }, ··· 10 8 { url = 'https://repo.or.cz/vis-parkour.git', alias = 'vis-parkour' } 11 9 } 12 10 13 - plug.init(plugins, true) 14 - 15 - 16 - 11 + function setup_plug() 12 + if not pcall(require, 'plugins/vis-plug') then 13 + os.execute('git clone --quiet https://github.com/erf/vis-plug ' .. 14 + (os.getenv('XDG_CONFIG_HOME') or os.getenv('HOME') .. '/.config') 15 + .. '/vis/plugins/vis-plug') 16 + end 17 + return require('plugins/vis-plug') 18 + end 19 + local plug = setup_plug() 17 20 21 + plug.init(plugins, true) 18 22 23 + function configure_plugin(name, config) 24 + if vis:module_exist(name) then 25 + local module = require(name) 26 + config(module) 27 + end 28 + end 19 29 20 30 vis.events.subscribe(vis.events.INIT, function() 21 - local format = require('plugins/vis-format') 22 - vis:map(vis.modes.NORMAL, '<C-p>', ':fzf<Enter>') 23 - vis:map(vis.modes.NORMAL, '=', format.apply) 24 - local lspc = require('plugins/vis-lspc') 25 - if next(lspc) then 26 - lspc.logging = true 27 - lspc.log_file = "/tmp/lspc.log" 31 + configure_plugin('plugins/vis-format', function(format) 32 + vis:map(vis.modes.NORMAL, '<C-p>', ':fzf<Enter>') 33 + vis:map(vis.modes.NORMAL, '=', format.apply) 34 + end) 35 + configure_plugin('plugins/vis-lspc', function(lspc) 36 + if next(lspc) then 37 + lspc.logging = true 38 + lspc.log_file = "/tmp/lspc.log" 28 39 29 - lspc.ls_map.rust = { 30 - name = "rust", 31 - cmd = "rust-analyzer", 32 - formatting_options = {tabSize = 4, insertSpaces = true} 33 - } 34 - end 40 + lspc.ls_map.rust = { 41 + name = "rust", 42 + cmd = "rust-analyzer", 43 + formatting_options = {tabSize = 4, insertSpaces = true} 44 + } 45 + lspc.ls_map.lua = { 46 + name = "lua", 47 + cmd = "lua-language-server", 48 + formatting_options = { insertSpaces = false } 49 + } 50 + end 51 + end) 35 52 end) 36 53 37 54 38 - vis.events.subscribe(vis.events.WIN_OPEN, function(win) 55 + vis.events.subscribe(vis.events.WIN_OPEN, function() 39 56 --per-window configuration-- 40 57 --vis:command('set number') 41 - vis:command('set showtab on') 42 - vis:command('set showspace on') 58 + --vis:command('set showtab on') 59 + vis:command('set showspace off') 43 60 vis:command('set autoindent on') 44 61 vis:command('set cursorline on') 45 62 vis:command('set tabwidth 4') 46 63 end) 47 - 48 - 49 - 50 - 64 + return nil