Skip to content
Discussion options

You must be logged in to vote

In languages with templates (Rust, C++), the same functionality would be very useful whenever removing a template e.g. doing sdf on Vec<SomeType> should just keep SomeType.

Is there a way to customize sdf for that, or maybe introduce another shortcut?

Of course. You can pretty much reuse how f itself is defined. Here is an example of how to do it for t surrounding (will override "tag" surrounding). Here is how to do it globally:

require('mini.surround').setup({
  custom_surroundings = {
    t = {
      input = { '%f[%w_%.][%w_%.]+%b<>', '^.-<().*()>$' },
      output = function()
        local fun_name = MiniSurround.user_input('Template name')
        if fun_name == nil then return nil e…

Replies: 1 comment

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