DanilaMihailov / beacon.nvim

Whenever cursor jumps some distance or moves between windows, it will flash so you can see where it is
339 stars 9 forks source link

toggleterm windows are not ignored with `beacon_ignore_filetypes` #26

Open NotAShelf opened 1 year ago

NotAShelf commented 1 year ago

Despite having toggleterm in the ignored filetypes, toggleterm is not actually ignored.

srgsanky commented 1 month ago

+1, since the rewrite in lua https://github.com/DanilaMihailov/beacon.nvim/commit/5f30e24 the ignored filetypes are no longer configurable. It is currently hardcoded to only 'oil' https://github.com/DanilaMihailov/beacon.nvim/blob/master/lua/beacon.lua#L26. This needs to be user configurable instead.

beacon_ignore_filetypes was first introduced by https://github.com/DanilaMihailov/beacon.nvim/commit/ce6fddc

srgsanky commented 1 month ago

My current workaround is to enable this plugin only on non-aux filetypes

  {
    'danilamihailov/beacon.nvim',
    ft = function()
      -- beacon doesn't provide a way to disable this plugin for specific filetypes
      -- <https://github.com/DanilaMihailov/beacon.nvim/issues/26>
      -- ft doesn't provide a way to specify file types to ignore. A workaround is to list all
      -- common filetypes
      return {
        'c',
        'cpp',
        'rust',
        'go',
        'python',
        'javascript',
        'typescript',
        'lua',
        'vim',
        'bash',
        'html',
        'css',
        'scss',
        'json',
        'yaml',
        'toml',
        'xml',
        'markdown',
        'txt',
        'sh',
        'zsh',
        'make',
        'cmake',
        'dockerfile',
        'gitcommit',
        'gitrebase',
        'sql',
        'perl',
        'ruby',
        'php',
        'java',
        'scala',
        'haskell',
        'elixir',
        'erlang',
        'r',
        'latex',
        'tex',
        'perl',
        'kotlin',
        'dart',
        'swift',
        'racket',
        'clojure',
        'scheme',
        'fsharp',
        'ocaml',
        'fortran',
        'vim',
        'help',
        -- aux windows where I want this feature
        'neo-tree',
        'Outline',
        'neotest-summary',
        -- Add any other relevant filetypes here
      }
    end,
    config = function(opts)
      opts = opts or {}
      opts.width = 120

      -- Highlight groups have to be reinitialized after setting the color scheme
      vim.api.nvim_create_autocmd('ColorScheme', {
        callback = function()
          vim.api.nvim_set_hl(0, 'Beacon', { bg = 'white' })
        end,
      })
      require('beacon').setup()
    end,
  },