Skip to content

how can I autopair < and > only for C header files? #96

@4rtemis-4rrow

Description

@4rtemis-4rrow

I searched high and low, went over all the docs, and though I don't know lua (I know, I have to learn it, my config is 1225 lines of lua, it's getting hard to maintain), I tried my best

internal_pairs={-- *ultimate-autopair-pairs-default-pairs*
    {'[',']',fly=true,dosuround=true,newline=true,space=true},
    {'(',')',fly=true,dosuround=true,newline=true,space=true},
    {'{','}',fly=true,dosuround=true,newline=true,space=true},
    {'"','"',suround=true,multiline=false},
    {"'","'",suround=true,cond=function(fn) return not fn.in_lisp() or fn.in_string() end,alpha=true,nft={'tex'},multiline=false},
    {'`','`',cond=function(fn) return not fn.in_lisp() or fn.in_string() end,nft={'tex'},multiline=false},
    {'``',"''",ft={'tex'}},
    {'```','```',newline=true,ft={'markdown'}},
    {'<!--','-->',ft={'markdown','html'},space=true},
    {'"""','"""',newline=true,ft={'python'}},
    {"'''","'''",newline=true,ft={'python'}},
    {'<','>',-- Condition for #include
    cond=function()
        local line = vim.api.nvim_get_current_line()
        return line:match("#include%s*$") ~= nil
    end,
    ft={'c','cpp'}
    },
},

I failed, if anyone can help me, that'd be greatly appreciated, I submit this here, for I don't know where else to ask

thank you for taking the time to read this, and have a great day, whoever you may be, wherever you may be

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions