Skip to content
Discussion options

You must be logged in to vote

'mini.surround' allows buffer-local configuration by setting a vim.b.minisurround_config variable. Its common usage is to customize surroundings per filetype.

My suggestion would be to put the following code (which is an adjusted version of builtin f surrounding) in the '~/.config/nvim/after/ftplugin/plaintex.lua' (and/or other LaTeX adjacent filetype):

if _G.MiniSurround ~= nil then
  vim.b.minisurround_config = {
    custom_surroundings = {
      f = {
        input = { '\\%f[%w_%.][%w_%.]+%b{}', '^.-{().*()}$' },
        output = function()
          local fun_name = MiniSurround.user_input('Function name')
          if fun_name == nil then return nil end
          return { left = '\\' ..

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.surround
2 participants