Giter Club home page Giter Club logo

keymaps.nvim's Introduction

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()

keymaps.nvim's People

Contributors

comfysage avatar

Stargazers

IogaMaster avatar  avatar yukimemi avatar ryoppippi avatar Dario avatar Ratheesh(ರತೀಶ್) avatar kohane27 avatar vadim avatar Yuto Tanaka(Work) avatar  avatar Yuta Katayama avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.