visrc.lua (1060B)
1 -- initializing vis' lua runtime 2 require('vis') 3 4 -- functions to be ran on INIT event 5 vis.events.subscribe(vis.events.INIT, function() 6 end) 7 8 -- functions to be ran in every window 9 vis.events.subscribe(vis.events.WIN_OPEN, function(win) 10 vis:command('set number') 11 vis:command('set autoindent on') 12 vis:command('set tabwidth 2') 13 end) 14 15 -- vis-plug -- 16 -- this automatically installs vis-plug if it is not found 17 --local plug = (function() if not pcall(require, 'plugins/vis-plug') then 18 -- os.execute('git clone --quiet https://github.com/erf/vis-plug ' .. 19 -- (os.getenv('XDG_CONFIG_HOME') or os.getenv('HOME') .. '/.config') 20 -- .. '/vis/plugins/vis-plug') 21 --end return require('plugins/vis-plug') end)() 22 local plug = require('plugins/vis-plug') 23 24 local plugins = { 25 { 'thimc/vis-colorizer' }, 26 { 'git://repo.or.cz/vis-pairs' }, 27 { 'e-zk/vis-shebang'}, 28 { 'Nomarian/vis-remove-trailing-whitespace', alias='rtw' }, 29 } 30 31 -- initialize vis-plug and all of its plugins 32 plug.init(plugins, true) 33 34 -- initialize remove-trailing-whitespace plugin 35 plug.plugins.rtw.Subscribe()