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

AutolistNewBulletBefore adds sub-bullets before a line ending in a colon #81

Open
j-w-e opened this issue Nov 1, 2023 · 0 comments
Open

Comments

@j-w-e
Copy link

j-w-e commented Nov 1, 2023

Ending a line with a colon, and using o in normal mode (or <cr> in insert mode), automatically makes the next line start an indented, bulleted list. This is a great feature and one I use frequently for my note-taking and nested to-do lists.

If I am in normal mode on a line ending in a colon, and use O – mapped to O<cmd>AutolistNewBulletBefore<cr> – it creates an indented, bulleted list above the new line, regardless of what is above the line.

This is reproducible using autolist.nvim (and lazy.nvim) as the only plugin. My config is

require("lazy").setup({
  {
    "gaoDean/autolist.nvim",
    ft = {
      "markdown",
      "text",
    },
    config = function()
      require("autolist").setup()
      vim.keymap.set("i", "<tab>", "<cmd>AutolistTab<cr>")
      vim.keymap.set("i", "<s-tab>", "<cmd>AutolistShiftTab<cr>")
      vim.keymap.set("i", "<CR>", "<CR><cmd>AutolistNewBullet<cr>")
      vim.keymap.set("n", "o", "o<cmd>AutolistNewBullet<cr>")
      vim.keymap.set("n", "O", "O<cmd>AutolistNewBulletBefore<cr>")
    end,
  },
}

With the cursor on the first line, typing O from this:

This is a test:
    - Test bullet

Results in this:

    - 
This is a test:
    - Test bullet

Ideally, I'd want just a plain new line, or a line bulleted to match the current indent, rather than adding an extra layer of indent. Is that feasible?

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