global settings and allow spaces in filenames and interactive python
This commit is contained in:
parent
dabdc41389
commit
057873981b
@ -5,17 +5,16 @@ require('plugins/myfiletype')
|
|||||||
|
|
||||||
vis.events.subscribe(vis.events.INIT, function()
|
vis.events.subscribe(vis.events.INIT, function()
|
||||||
-- Your global configuration options
|
-- 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)
|
end)
|
||||||
|
|
||||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||||
-- Your per window configuration options
|
-- 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 show-tabs on')
|
||||||
vis:command('set number')
|
vis:command('set number')
|
||||||
vis:command('set theme dark-16')
|
|
||||||
vis:command('set escdelay 0')
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vis:command_register("fzf", function(argv, force, cur_win, selection, range)
|
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()
|
--local out = io.popen("fzf " .. table.concat(argv, " ")):read()
|
||||||
if out then
|
if out then
|
||||||
if argv[1] 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))
|
-- or vis:command(string.format('open %s', out))
|
||||||
-- should e return false when failed
|
-- should e return false when failed
|
||||||
else
|
else
|
||||||
vis:command(string.format('open %s', out))
|
vis:command(string.format('open "%s"', out))
|
||||||
end
|
end
|
||||||
vis:feedkeys("<vis-redraw>")
|
vis:feedkeys("<vis-redraw>")
|
||||||
end
|
end
|
||||||
@ -42,3 +41,7 @@ vis:map(vis.modes.NORMAL, ";o", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
|
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ";i", function()
|
||||||
|
vis:command("!python -i $vis_filename")
|
||||||
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user