Skip to content

comfysage/keymaps.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Installation

using lazy.nvim:

return {
    'crispybaccoon/keymaps.nvim',
    priority = 2000, -- load before setting keymaps
    opts = {
      -- default options given to `vim.keymap.set()`
      default_opts = {
        silent = true,
        noremap = true,
      },
    },
}

usage

first run:

require 'keymaps'.setup {}

at the beggining of your config.

or using a protected call:

local ok, keymaps = pcall(require, 'keymaps')
if ok then keymaps.setup {} end

then your can use the 'keymaps' global like this:

-- keymaps <mode> [<key>]        { <keymap>         <description>  }
keymaps.normal['<space><TAB>'] = { ":$tabedit<CR>", 'Open New Tab' }

-- possible modes are: normal, visual and insert

-- the keymap can also be a lua function, like this:
keymaps.normal["<C-t>"] = {
  function() require 'telescope.builtin'.colorscheme() end,
  'Find Colorscheme'
}
-- uses [@telescope](https://github.com/nvim-telescope/telescope.nvim)

-- you can also pass additional options to the keymaps
keymaps.normal["gg"] = { '<cmd>call smoothie#do("gg") <CR>', 'Scroll to top of file', { overwrite = true } }
keymaps.normal["G"] = { '<cmd>call smoothie#do("G") <CR>', 'Scroll to bottom of file', { overwrite = true } }
-- uses [@vim-smoothie](https://github.com/psliwka/vim-smoothie)

-- keymaps can also be grouped by passing a name to the `group` property:
keymaps.normal[',hp'] = { require 'gitsigns'.preview_hunk, '[Git] Preview Hunk', group = 'Git' }
keymaps.normal[',hs'] = { require 'gitsigns'.stage_hunk, '[Git] stage current hunk', group = 'Git' }
-- uses [@gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)

Telescope Integration

Add the following to your nvim config to load the telescope extension

require 'telescope'.load_extension 'keymaps_nvim'

to view your keymaps using telescope run the following

require 'telescope'.extensions.keymaps_nvim.keymaps_nvim()

About

🍊 a keymap manager for Neovim, simplifying keybinding management and customization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages