Skip to content

Instantly share code, notes, and snippets.

local U = require "Comment.utils"
local VISUAL_LINE = U.cmotion["V"]
local min, max = math.min, math.max
require("Comment").setup {
opleader = {
-- line = "gc", -- TODO: had to switch these to achieve the ft-lua behaviour wanted, but messes up everything else
line = "gb",
-- block = "gb",
block = "gc",
function! RosConvert(str)
return substitute(a:str, '^$(\(find.\{-}\))', '$(rospack \1)', '')
endfunction
let test_gf = "$(find px4_fast_planner)/foo/bar.launch"
echo RosConvert(test_gf)