-
Notifications
You must be signed in to change notification settings - Fork 263
Tips and Tricks
jgart edited this page Nov 13, 2021
·
19 revisions
Add this to your ~/.configure/vis/visrc.lua
require('vis')
local fennel = require("fennel")
table.insert(package.loaders or package.searchers, fennel.searcher)
local config = require("config")
Create an example config called ~/.configure/vis/config.fnl
(vis.events.subscribe vis.events.WIN_OPEN
(fn [win]
(vis:command "set number on")
(vis:command "set autoindent on")
(vis:command "set tabwidth 4")
(vis:command "set expandtab on")
(vis:command "set ignorecase on")))
(vis:map vis.modes.NORMAL ";;" :<vis-window-next>)
Make sure that the path to fennel.lua is ~/.config/vis/fennel.lua
:!aspell -t -c $vis_filepath
Lua:
:!lua -i $vis_filename
Python:
:!python -i $vis_filename
Guile Scheme:
:!guile -l $vis_filename
Javascript:
!node -i -e "$(< $vis_filename)"
Using command mode, pipe selected text into fold or wrap:
:|fold -w 80 -s
:|wrap -w 80
From the README:
There exist plans to use a client/server architecture, delegating window management to your windowing system or favorite terminal multiplexer.
See also issue #130.
That said, there are some workarounds:
vis:command_register('xsp', function(argv)
local file = vis.win.file
local path = argv[1] or file.path
if not os.getenv("DISPLAY") then
vis:info("Error: $DISPLAY doesn't exist")
return
end
local cmd = string.format('st -e vis "%s" &', path)
os.execute(cmd)
end, "Open file in a new X11 window")
vis:command_register('tsp', function(argv)
local file = vis.win.file
local path = argv[1] or file.path
local fifo = os.getenv("DVTM_CMD_FIFO")
if not fifo then
vis:info("Error: $DVTM_CMD_FIFO doesn't exist")
return
end
local cmd = string.format([[echo 'create "vis %s"' >> %s]],
path:gsub(" ", "\\ "), fifo)
os.execute(cmd)
end, "Open file in a new dvtm(1) window")