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 -35
+41 -35
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 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() 20 + 13 21 plug.init(plugins, true) 14 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 29 + 15 30 vis.events.subscribe(vis.events.INIT, function() 16 - vis:command('set theme zenburn') 17 - local format = require('plugins/vis-format') 18 - vis:map(vis.modes.NORMAL, '<C-p>', ':fzf<Enter>') 19 - vis:map(vis.modes.NORMAL, '=', format.apply) 20 - local lspc = require('plugins/vis-lspc') 21 - if next(lspc) then 22 - lspc.logging = true 23 - 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" 24 39 25 - lspc.ls_map.rust = { 26 - name = "rust", 27 - cmd = "rust-analyzer", 28 - formatting_options = {tabSize = 4, insertSpaces = true} 29 - } 30 - lspc.ls_map.nix = { 31 - name = "nix", 32 - cmd = "nil", 33 - formatting_options = {tabSize = 2, insertSpace = true} 34 - } 35 - lspc.ls_map.python = { 36 - name = "python", 37 - cmd = "python-lsp-server", 38 - formatting_options = {tabSize = 4, insertSpaces = true}, 39 - roots = {"pyproject.toml", "requirements.txt", "setup.py"} 40 - } 41 - 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) 42 52 end) 43 53 44 54 45 - vis.events.subscribe(vis.events.WIN_OPEN, function(win) 55 + vis.events.subscribe(vis.events.WIN_OPEN, function() 46 56 --per-window configuration-- 47 57 --vis:command('set number') 48 - vis:command('set showtab off') 58 + --vis:command('set showtab on') 49 59 vis:command('set showspace off') 50 60 vis:command('set autoindent on') 51 61 vis:command('set cursorline on') 52 62 vis:command('set tabwidth 4') 53 - vis:command('set expandtab on') 54 63 end) 55 - 56 - 57 - 58 - 64 + return nil