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

Switched from Vim to LazyVim (NeoVim) and am now at a loss on how to configure and utilize this plugin. #24

Open
starkovv opened this issue Feb 21, 2024 · 3 comments

Comments

@starkovv
Copy link

I wanted to point out that the documentation is unclear and lacks adequate instructions for beginners with Lua and LazyVim (NeoVim) on how to start using the plugin.

As a result, I'm unsure where to insert these bindings.

@eeriemyxi
Copy link

This plugin has a very beginner friendly implementation. If you are having trouble with this level of simplicity, then you should drop whatever this additional layer of abstraction called "LazyVim" is and start from the basics.

@nyngwang
Copy link

nyngwang commented Mar 7, 2024

I'm using this:

use {
  'Vonr/align.nvim',
  commit = '2004d26',
  config = function ()
    vim.keymap.set('x', '<C-a>', function()
      require'align'.align_to_string(true, true, true)
    end, { noremap = true, silent = true, nowait = true })
  end
}

You just need to change <C-a> to anything else. I encountered some bugs so I stayed in the old version 2004d26.

@dpezto
Copy link

dpezto commented Mar 14, 2024

I have this in my plugins directory

return {
  "Vonr/align.nvim",
   keys = {
    {
      mode = "x",
      "<leader>aa",
      function()
        require("align").align_to_char({
          length = 1,
        })
      end,
      desc = "Aligns to 1 char",
    },
    {
      mode = "x",
      "<leader>ad",
      function()
        require("align").align_to_char({
          preview = true,
          length = 2,
        })
      end,
      desc = "Aligns to 2 chars",
    },
    {
      mode = "x",
      "<leader>aw",
      function()
        require("align").align_to_string({
          preview = true,
          regex = false,
        })
      end,
      desc = "Aligns to string",
    },
    {
      mode = "x",
      "<leader>ar",
      function()
        require("align").align_to_string({
          preview = true,
          regex = true,
        })
      end,
      desc = "Aligns to Vim regex",
    },
  },
}

I also added this to my which-key config file

defaults = {
        ["<leader>a"] = { name = "+align", mode = "x" },
      },

hope it helps :)

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

4 participants