Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip: Setup with Lazy.nvim #6

Open
SirWrexes opened this issue Jul 23, 2023 · 0 comments
Open

Tip: Setup with Lazy.nvim #6

SirWrexes opened this issue Jul 23, 2023 · 0 comments

Comments

@SirWrexes
Copy link

I've struggled a little bit to get the plugin properly working with Lazy.nvim, but I do have a solution now !

Since the repo doesn't get much activity, I figured I'd take the initiative to post this issue as an example of working Lazy config for those who might need it and wanna avoid scratching their head for an hour fiddling around.

  {
    'kennykaye/vim-relativity',

    -- Only load the plugin when leaving a buffer
    event = 'BufLeave',

    -- Initial configuration
    -- Since this plugin uses Vim globals and will be loaded most of the times, it is ideal that
    -- this is done on opening NeoVim, to ensure everything is ready when the plugin's actually loaded.
    init = function()
      local ignored_fts = { -- Assigning directly to vim.g.relativity_filetype_ignore doesn't work. See `:h lua-vim-variables`
        -- Add your ignores here.
      }

      vim.o.number = true
      vim.o.relativenumber = true
      vim.g.relativity_filetype_ignore = ignored_fts
    end,

    config = function()
      -- Force the plugin to be activated when loaded
      vim.cmd.Relativity()
    end,
  }

Hope this can help some people!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant