24 lines
610 B
Lua
24 lines
610 B
Lua
local plug = require("plugins/vis-plug")
|
|
local n = vis.modes.NORMAL
|
|
local leader = " "
|
|
|
|
local format = plug.plugins.format
|
|
|
|
-- configured formatter if the syntax has one, else the language server
|
|
local function format_file(keys)
|
|
if format.pick(vis.win) then
|
|
return format.apply(keys)
|
|
end
|
|
vis:command("lspc-format")
|
|
return 0
|
|
end
|
|
|
|
vis:map(n, "=", format_file)
|
|
|
|
vis:map(n, "<C-p>", ":fzf<Enter>")
|
|
vis:map(n, leader .. "pf", ":fzf<Enter>")
|
|
vis:map(n, leader .. "ps", ":grep ")
|
|
vis:map(n, leader .. "pv", ":e .<Enter>")
|
|
vis:map(n, leader .. "f", format_file)
|
|
vis:map(n, leader .. "rn", ":lspc-rename ")
|