commit f6a893c0b2efb5f2fde28521f694eed2e54be4b7
parent ef0f21c6ea224ce56bb6b18f8a756973731d5c4c
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 25 Jun 2019 13:37:44 +0200
Add rudimentary autocomplete from current file
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua
@@ -72,7 +72,7 @@ vis.events.subscribe(vis.events.INIT, function()
vis:map(vis.modes.NORMAL, leader..'CS', ':e ~/.config/vis/plugins/snippetsv.lua<Enter>')
vis:map(vis.modes.NORMAL, leader..'d', ':< date')
vis:map(vis.modes.NORMAL, leader..'e', ':fzf true<Enter>')
- vis:map(vis.modes.NORMAL, leader..'ga', ':!git add $vis_filepath<Enter>')
+ vis:map(vis.modes.NORMAL, leader..'ga', ':!git add "$vis_filepath"<Enter>')
vis:map(vis.modes.NORMAL, leader..'gc', ':!git commit -v -S<Enter>')
vis:map(vis.modes.NORMAL, leader..'gp', ':!git push<Enter>')
vis:map(vis.modes.NORMAL, leader..'l', ':set show-newline!<Enter>')
@@ -99,6 +99,11 @@ vis.events.subscribe(vis.events.INIT, function()
function() vis:feedkeys('o<Escape><Up>') end)
vis:map(vis.modes.NORMAL, '[ ',
function() vis:feedkeys('O<Escape><Down>') end)
+
+ -- complete from words in current file
+ vis:map(vis.modes.INSERT, '<C-x><C-n>',
+ '<Escape>:< cat "$vis_filepath" | vis-complete --word<Enter>')
+
end)
vis.events.subscribe(vis.events.WIN_OPEN, function(win)