Skip to content

filetype specific additional rules? #531

@mcepl

Description

@mcepl

Is your feature request related to a problem? Please describe.

I had this in my Vim configuration (configuration for vim-textobj-quote):

" for vim-textobj-quote
function! TextObjSettings()
  if exists(":Educate")
      if &spelllang =~ 'cs'
         call textobj#quote#init({ 'double':'„“', 'single':'‚‘', 'educate': 1 })
         set spell
      elseif &spelllang =~ 'en'
         call textobj#quote#init({ 'double':'“”', 'single':'‘’', 'educate': 1 })
         set spell
      endif
  endif
endfunction

autocmd OptionSet spelllang call TextObjSettings()
autocmd FileType rst,fountain,markdown call TextObjSettings()

Now, I wonder whether something like that can be replicated with nvim-autopairs. Specifically, could I have additional filetype-specific rules? So, when I would press inch character (") in normal-writing-friendly-filetypes I would get pair of double-quotes? Of course, being locale-specific, would be even better improvement, but not required.

I know you can remove some rules for the specific filetypes, but I haven’t found an advice how to add some filetype-specific rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions