global settings and allow spaces in filenames and interactive python

This commit is contained in:
Felix Van der Jeugt 2018-02-26 11:56:19 +01:00
parent dabdc41389
commit 057873981b
No known key found for this signature in database
GPG Key ID: 58B209295023754D

View File

@ -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("<vis-redraw>")
end
@ -42,3 +41,7 @@ vis:map(vis.modes.NORMAL, ";o", function()
end)
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
vis:map(vis.modes.NORMAL, ";i", function()
vis:command("!python -i $vis_filename")
end)