Shougo / context_filetype.vim

Context filetype library for Vim script
Other
160 stars 20 forks source link

Setting up #53

Closed OlegPQ closed 2 years ago

OlegPQ commented 2 years ago

Hello; I am trying to figure out how to configure and use this library/plugin. I am using https://github.com/preservim/nerdcommenter plugin for comments, and would like to comment CSS block in HTML document correctly as well, for that I have the following configuration in vimrc:

if !exists('g:context_filetype#filetypes')
  let g:context_filetype#filetypes = {}
endif

let g:context_filetype#filetypes.vim =
\ [
\   {'filetype' : 'css', 'start' : '<style>', 'end' : '</style>'},
\ ]

But it does not work, because apparently I need somehow else to connect nerdcommenter, but do not understand how. Can you point to a solution/mistakes? Thx!

Shougo commented 2 years ago

context_filetype.vim is not magic. It is just helper plugin for plugin authors instead of users.

But it does not work, because apparently I need somehow else to connect nerdcommenter, but do not understand how. Can you point to a solution/mistakes? Thx!

If you use context_filetype.vim in nerdcommenter, nerdcommenter use context_fileytpe plugin methods instead of &filetype.

You can see plugins implementation. https://github.com/Shougo/deoplete.nvim/blob/ce318f573c2c304536ddc954b4afc894c4cb57b2/rplugin/python3/deoplete/context.py#L126

Shougo commented 2 years ago

You need to modify nerdcommenter implementation. You cannot connect plugins without modification.