Skip to content

Neovim plugin that provides keymaps for putting certain characters at end of the line

License

Notifications You must be signed in to change notification settings

rareitems/put_at_end.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

put_at_end.nvim

Small Neovim plugin that provides keymaps for putting certain characters (or strings) at the end of the current line (but before the comment if the line has one) without moving your cursor.

Useful for languages that require semicolons at the end of the line.

Usage

  local m = require("put_at_end")
  vim.keymap.set("n", "<C-;>", m.put_semicolon)
  -- This keymap will put a semicolon at the end of the current line

  vim.keymap.set("n", "<C-.>", m.put_period) --This a period
  vim.keymap.set("n", "<C-,>", m.put_comma) --This a commna
  vim.keymap.set("n", "<C-/>", m.put_questionmark) --This a question mark
  vim.keymap.set("n", "<C-A>", function() m.put("STRING") end) --This 'STRING'

Installation and Example Configuration

{
  "rareitems/put_at_end",
  keys = { -- Basic lazy loading
    -- Plugin doesn't set any keymaps you have to set your own 
    {
      "<C-;>",
      function()
        require("put_at_end").put_semicolon()
      end,
      desc = "Put a semicolon at the end of the line",
    },
    {
      "<C-.>",
      function()
        require("put_at_end").put_period()
      end,
      desc = "Put a period at the end of the line",
    },
    {
      "<C-,>",
      function()
        require("put_at_end").put_comma()
      end,
      desc = "Put a comma at the end of the line",
    },
  },
}
use { 'rareitems/put_at_end.nvim' }

About

Neovim plugin that provides keymaps for putting certain characters at end of the line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages