glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.65k stars 143 forks source link

Question about how to use `vim.g.firenvim_config` #1523

Closed farzadmf closed 1 year ago

farzadmf commented 1 year ago

What I tried to do

I'm using the configuration from the Wiki for vim.g.firenvim_config, but it doesn't seem to work and when I go to, say, Google Docs, the extension is not disabled and prevents me from entering anything.

I'm using lazy.nvim, and I've tried putting the config in the init function and also outside, even before loading my plugins, but nothing seems to work.

The configuration I'm using:

vim.g.firenvim_config = {
  localSettings = {
    [ [[.*]] ] = {
      cmdline = 'firenvim',
      priority = 0,
      selector = 'textarea:not([readonly]):not([class="handsontableInput"]), div[role="textbox"]',
      takeover = 'always',
    },
    [ [[.*notion\.so.*]] ] = {
      priority = 9,
      takeover = 'never',
    },
    [ [[.*docs\.google\.com.*]] ] = {
      priority = 9,
      takeover = 'never',
    },
  },
}

If I do vim.pretty_print(vim.g.firenvim_config), I can see it in the firenvim extension popup, but I'm not exactly sure what I need to do to make it work.

What happened

Basically, what I mentioned above 🙂

glacambre commented 1 year ago

I can't reproduce the behavior you're describing. I installed Firenvim in a fresh Chrome profile, went to docs.google.com, created a new document, typed a few lines (this did not trigger Firenvim) then tried to add a comment and Firenvim indeed got triggered.

Afterwards, I copy/pasted your snippet in my init.vim, clicked the "reaload config" button in the Firenvim extension menu next to the urlbar, reloaded the page, typed a few things in the document and tried to add a comment and neither of these actions triggered Firenvim.

Are you sure the domain name you're using matches the rule you've created? (e.g. could you be on drive.google.com or forms.google.com instead of docs.google.com?) Have you tried disabling all your other browser extensions?

farzadmf commented 1 year ago

Oh no, that's sad 🙁, I was hoping you tell me I'm doing it wrong.

When I go to Google Docs, if I only disable Firenvim and reload the page, things work normally. Do you think it could be another extension interfering with it? I do have Vimium installed, but I don't think that would be responsible since Firenvim is working properly in other sites.

Asking to hopefully see if I can figure out what exactly is preventing the config to work because I have a lot of Chrome and Neovim plugins, and I'm trying to avoid going down the rabbit hole of spotting a plugin that's interfering with Firenvim.

glacambre commented 1 year ago

Do you think it could be another extension interfering with it?

Yes, that is my main suspicion at the moment.

github-actions[bot] commented 1 year ago

Closing this issue because it has been awaiting a response from its author for more than a month. Please provide the requested information and this issue will be re-opened.