{"id":27615393,"url":"https://github.com/kremovtort/caskey.nvim","last_synced_at":"2026-02-23T06:01:42.645Z","repository":{"id":215189155,"uuid":"583317727","full_name":"kremovtort/caskey.nvim","owner":"kremovtort","description":"Declarative keymappings configuration using cascading trees","archived":true,"fork":false,"pushed_at":"2023-01-06T09:32:45.000Z","size":37,"stargazers_count":67,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-21T04:06:11.785Z","etag":null,"topics":["keybindings","keymap","neovim","neovim-plugin","which-key"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kremovtort.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-12-29T12:19:44.000Z","updated_at":"2026-02-02T18:44:43.000Z","dependencies_parsed_at":"2024-01-07T11:54:29.780Z","dependency_job_id":null,"html_url":"https://github.com/kremovtort/caskey.nvim","commit_stats":null,"previous_names":["nexmean/caskey.nvim","kremovtort/caskey.nvim"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kremovtort/caskey.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kremovtort%2Fcaskey.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kremovtort%2Fcaskey.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kremovtort%2Fcaskey.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kremovtort%2Fcaskey.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kremovtort","download_url":"https://codeload.github.com/kremovtort/caskey.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kremovtort%2Fcaskey.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29681468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T12:30:22.644Z","status":"ssl_error","status_checked_at":"2026-02-21T12:29:55.402Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keybindings","keymap","neovim","neovim-plugin","which-key"],"created_at":"2025-04-23T03:02:57.864Z","updated_at":"2026-02-21T13:01:13.233Z","avatar_url":"https://github.com/kremovtort.png","language":"Lua","readme":"# caskey.nvim\nDeclarative **cas**cade **key** mappings configuration\n\n## ✨ Features\n- Define all your keymaps as simple lua tables\n- Group keymaps the way you think about them\n- Modular, declarative way to define keymaps\n- Automatically registers autocommands to setup buffer local keymappings\n- [Which-key](https://github.com/folke/which-key.nvim) integration out of the box\n\n## 📦 Installation\n\n[lazy.nvim](https://github.com/folke/lazy.nvim):\n```lua\n{\n  \"Nexmean/caskey.nvim\",\n  dependencies = {\n    \"folke/which-key.nvim\", -- optional, only if you want which-key integration\n  },\n}\n```\n\n[packer.nvim](https://github.com/wbthomason/packer.nvim)\n```lua\nuse {\n  \"Nexmean/caskey.nvim\",\n  requires = {\n    \"folke/which-key.nvim\", -- optional, only if you want which-key integration\n  },\n}\n```\n\n## ⚙️ Configuration\n\nDefine your keymaps:\n```lua\n-- user/mappings.lua\nlocal ck = require(\"caskey\")\n\nreturn {\n  -- options are inherits so you can define most regular at the top of keymaps config\n  mode = {\"n\", \"v\"},\n\n  -- Simple keymap with `caskey.cmd` helper and mode override\n  [\"\u003cEsc\u003e\"] = {act = ck.cmd \"noh\", desc = \"no highlight\", mode = \"n\"},\n\n  -- group keymaps to reuse options or just for config structuring\n  {\n    mode = {\"i\", \"t\", \"c\"},\n\n    [\"\u003cC-a\u003e\"] = {act = \"\u003cHome\u003e\"  , desc = \"Beginning of line\"},\n    [\"\u003cC-e\u003e\"] = {act = \"\u003cEnd\u003e\"   , desc = \"End of line\"},\n    [\"\u003cC-f\u003e\"] = {act = \"\u003cRight\u003e\" , desc = \"Move forward\"},\n    [\"\u003cC-b\u003e\"] = {act = \"\u003cLeft\u003e\"  , desc = \"Move back\"},\n    -- override options\n    [\"\u003cC-d\u003e\"] = {act = \"\u003cDelete\u003e\", desc = \"Delete next character\", mode = {\"i\", \"c\"}},\n  },\n\n  -- structure your keymaps as a tree and define which-key prefixes\n  [\"\u003cleader\u003et\"] = {\n    name = \"tabs\",\n\n    n = {act = ck.cmd \"tabnew\"                            , desc = \"new tab\"},\n    x = {act = ck.cmd \"tabclose\"                          , desc = \"close tab\"},\n    t = {act = ck.cmd \"Telescope telescope-tabs list_tabs\", desc = \"list tabs\"},\n  },\n\n  -- define buffer local keymaps\n  [\"q\"] = {\n    act = ck.cmd \"close\",\n    desc = \"close window\",\n    when = {\n      ck.ft \"Outline\",\n      ck.bt {\"quickfix\", \"help\"},\n      -- that is equivalent to:\n      {\n        event = \"FileType\",\n        pattern = \"Outline\",\n      },\n      {\n        event = \"BufWinEnter\",\n        condition = function ()\n          return vim.tbl_contains({\"quickfix\", \"help\"}, vim.o.buftype)\n        end\n      }\n    },\n  },\n\n  -- use functions as config bodies\n  [\"\u003cleader\u003eh\"] = function ()\n    local gs = require(\"gitsigns\")\n\n    return {\n      name = \"hunk\",\n\n      mode = \"n\",\n\n      -- Sometimes there aren't events which describe that you need to setup buffer local mappings.\n      -- For such cases you can use custom events.\n      -- Caskey provides api for emitting them:\n      --   -- nvim/lua/user/plugins/gitsigns.lua\n      --   ...\n      --   on_attach = function (bufnr)\n      --     require(\"caskey\").emit(\"Gitsigns\", bufnr)\n      --   end\n      --   ...\n      -- \n      -- And then you can use `ck.emit` to describe when to setup mappings\n      when = ck.emitted \"Gitsigns\",\n\n      s = {act = gs.stage_hunk     , desc = \"stage hunk\"},\n      r = {act = gs.reset_hunk     , desc = \"rest hunk\"},\n      S = {act = gs.stage_buffer   , desc = \"stage buffer\"},\n      u = {act = gs.undo_stage_hunk, desc = \"unstage hunk\"},\n      d = {act = gs.preview_hunk   , desc = \"preview hunk\"} ,\n      b = {act = gs.blame_line     , desc = \"blame line\"},\n    }\n  end,\n\n  {\n    mode = \"n\",\n    when = \"LspAttach\",\n    [\"gd\"] = {act = ck.cmd \"Telescope lsp_definitions\", desc = \"lsp definition\"},\n    [\"\u003cC-s\u003e\"] = {\n      act = ck.cmd \"SymbolsOutline\",\n      desc = \"toggle outline\",\n      -- extend mode or buffer local configuration\n      mode_extend = \"v\",\n      when_extend = ck.ft \"Outline\",\n    },\n  },\n}\n```\n\nAnd then setup them with caskey:\n```lua\nrequire(\"caskey\").setup(require(\"user.mappings\"))\n```\nOr if you want which-key integration:\n```lua\nrequire(\"caskey.wk\").setup(require(\"user.mappings\"))\n```\n\nConfig structure description could be found [here](https://github.com/Nexmean/caskey.nvim/wiki/Config-structure)\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkremovtort%2Fcaskey.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkremovtort%2Fcaskey.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkremovtort%2Fcaskey.nvim/lists"}