diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index 20d929b..dd03148 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -5,17 +5,16 @@ require('plugins/myfiletype') vis.events.subscribe(vis.events.INIT, function() -- Your global configuration options + vis:command('set escdelay 0') + vis:command('set tabwidth 4') + vis:command('set autoindent on') + vis:command('set theme dark-16') end) vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- Your per window configuration options - vis:command('set tabwidth 4') - vis:command('set autoindent on') - vis:command('set expandtab on') vis:command('set show-tabs on') vis:command('set number') - vis:command('set theme dark-16') - vis:command('set escdelay 0') end) vis:command_register("fzf", function(argv, force, cur_win, selection, range) @@ -23,11 +22,11 @@ vis:command_register("fzf", function(argv, force, cur_win, selection, range) --local out = io.popen("fzf " .. table.concat(argv, " ")):read() if out then if argv[1] then - vis:command(string.format('e %s', out)) + vis:command(string.format('e "%s"', out)) -- or vis:command(string.format('open %s', out)) -- should e return false when failed else - vis:command(string.format('open %s', out)) + vis:command(string.format('open "%s"', out)) end vis:feedkeys("") end @@ -42,3 +41,7 @@ vis:map(vis.modes.NORMAL, ";o", function() end) vis:map(vis.modes.NORMAL, ";;", "") + +vis:map(vis.modes.NORMAL, ";i", function() + vis:command("!python -i $vis_filename") +end)