gcmt / wildfire.vim

Smart selection of the closest text object
MIT License
611 stars 19 forks source link

how to disable wildfire in specific filetype #33

Closed AndreGeng closed 1 month ago

AndreGeng commented 11 months ago

how to disable wildfire key <CR> mapping temporarily in specific filetype.
In my case, I am using oil.nvm, it use <CR> to open file under cursor, I want to disable wildfire <CR> mapping for buffers with filetype "oil"

gcmt commented 11 months ago

Something like this should do the work I think

let g:wildfire_objects = {
    \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip", "it"],
    \ "oil" : [],
\}
AndreGeng commented 11 months ago

tried it, <CR> still not working as expected in oil buffer. :map <CR> shows following result image

gcmt commented 11 months ago

Unfortunately I can't really try wildfire.vim on neovim right now but let's see..

From your screenshot (first line) it seems that <CR> is working neither as wildfire.vim or oil.vim mapping. Am I correct? Wildfire.vim disable itself when the &buftype is not empty by doing a non-recursive mapping of g:wildfire_fuel_map to itself (see https://github.com/gcmt/wildfire.vim/blob/master/plugin/wildfire.vim#L76). Try removing that line to see if that's the culprit