{"id":13500400,"url":"https://github.com/kkga/kks","last_synced_at":"2025-04-09T16:40:46.539Z","repository":{"id":38842405,"uuid":"403342360","full_name":"kkga/kks","owner":"kkga","description":"Handy Kakoune companion.","archived":false,"fork":false,"pushed_at":"2023-09-28T22:02:18.000Z","size":173,"stargazers_count":29,"open_issues_count":6,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T16:50:00.497Z","etag":null,"topics":["kakoune","plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kkga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-05T15:21:49.000Z","updated_at":"2025-01-28T21:32:13.000Z","dependencies_parsed_at":"2024-01-13T19:19:06.585Z","dependency_job_id":"e18f89a2-9b27-4d93-8a99-0214b2620475","html_url":"https://github.com/kkga/kks","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkga%2Fkks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkga%2Fkks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkga%2Fkks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkga%2Fkks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkga","download_url":"https://codeload.github.com/kkga/kks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248068900,"owners_count":21042576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["kakoune","plugin"],"created_at":"2024-07-31T22:00:58.872Z","updated_at":"2025-04-09T16:40:46.518Z","avatar_url":"https://github.com/kkga.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# kks\n\nHandy Kakoune companion.\n\n## Installation\n\n### From release binaries\n\nDownload the compiled binary for your system from\n[Releases](https://github.com/kkga/kks/releases) page and put it somewhere in\nyour `$PATH`.\n\n### From source\n\nRequires [Go](https://golang.org/) installed on your system.\n\nClone the repository and run `go build`, then copy the compiled binary somewhere\nin your `$PATH`.\n\nIf Go is [configured](https://golang.org/ref/mod#go-install) to install packages\nin `$PATH`, it's also possible to install without cloning the repository: run\n`go install github.com/kkga/kks@latest`.\n\n### AUR\n\n`kks` is packaged in the Arch User Repository:\nhttps://aur.archlinux.org/packages/kks/\n\n## Kakoune and shell integration\n\n### Kakoune configuration\n\nSource `kks init` to add `kks-connect` command to Kakoune...\n\n```kak\neval %sh{ kks init }\n```\n\n... and use your terminal integration to connect\n[provided scripts](#provided-scripts), for example:\n`kks-connect terminal kks-files`.\n\n### Kakoune mappings example\n\n```kak\nmap global normal -docstring 'terminal'         \u003cc-t\u003e ': kks-connect terminal\u003cret\u003e'\nmap global normal -docstring 'files'            \u003cc-f\u003e ': kks-connect terminal-popup kks-files\u003cret\u003e'\nmap global normal -docstring 'buffers'          \u003cc-b\u003e ': kks-connect terminal-popup kks-buffers\u003cret\u003e'\nmap global normal -docstring 'live grep'        \u003cc-g\u003e ': kks-connect terminal-popup kks-grep\u003cret\u003e'\nmap global normal -docstring 'lines in buffer'  \u003cc-l\u003e ': kks-connect terminal-popup kks-lines\u003cret\u003e'\nmap global normal -docstring 'recent files'     \u003cc-r\u003e ': kks-connect terminal-popup kks-mru\u003cret\u003e'\nmap global normal -docstring 'vcs client'       \u003cc-v\u003e ': kks-connect terminal-popup lazygit\u003cret\u003e'\nmap global normal -docstring 'file browser'     \u003cc-h\u003e ': kks-connect terminal-panel kks-lf\u003cret\u003e'\n```\n\nOr, if you prefer having a dedicated user mode:\n\n```kak\ndeclare-user-mode pick\nmap global normal \u003cc-p\u003e -docstring 'pick mode'        ': enter-user-mode pick\u003cret\u003e'\nmap global pick f       -docstring 'files'            ': kks-connect terminal-popup kks-files\u003cret\u003e'\nmap global pick F       -docstring 'files (all)'      ': kks-connect terminal-popup kks-files -HI\u003cret\u003e'\nmap global pick g       -docstring 'git files'        ': kks-connect terminal-popup kks-git-files\u003cret\u003e'\nmap global pick b       -docstring 'buffers'          ': kks-connect terminal-popup kks-buffers\u003cret\u003e'\nmap global pick /       -docstring 'live grep'        ': kks-connect terminal-popup kks-grep\u003cret\u003e'\nmap global pick l       -docstring 'lines in buffer'  ': kks-connect terminal-popup kks-lines\u003cret\u003e'\nmap global pick r       -docstring 'recent files'     ': kks-connect terminal-popup kks-mru\u003cret\u003e'\nmap global pick \u003ca-f\u003e   -docstring 'filetypes'        ': kks-connect terminal-popup kks-filetypes\u003cret\u003e'\n```\n\nFor more terminal integrations and for the (quite handy) `popup` command, see:\n\n- [alacritty.kak](https://github.com/alexherbo2/alacritty.kak)\n- [foot.kak](https://github.com/kkga/foot.kak)\n\n### Shell configuration\n\nYou may want to set the `EDITOR` variable to `kks edit` so that connected\nprograms work as intended:\n\n```sh\nexport EDITOR='kks edit'\n```\n\nPossibly useful aliases:\n\n```sh\nalias k='kks edit'\nalias ks='eval $(kks-select)'\nalias ka='kks attach'\nalias kkd='kks kill; unset KKS_SESSION KKS_CLIENT' # kill+detach\nalias kcd='cd $(kks get %sh{pwd})'\n```\n\n## Commands\n\nThis is the output of `kks -h`. Certain commands take additional flags, see\n`kks \u003ccommand\u003e -h` to learn more.\n\n```\nUSAGE\n  kks \u003ccommand\u003e [-s \u003csession\u003e] [-c \u003cclient\u003e] [\u003cargs\u003e]\n\nCOMMANDS\n  new, n         create new session\n  edit, e        edit file\n  send, s        send command\n  attach, a      attach to session\n  kill           kill session\n  ls             list sessions and clients\n  get            get %val{..}, %opt{..} and friends\n  cat            print buffer content\n  env            print env\n  init           print Kakoune definitions\n\nENVIRONMENT VARIABLES\n  KKS_SESSION\n      Kakoune session\n  KKS_CLIENT\n      Kakoune client\n  KKS_DEFAULT_SESSION\n      Session to try when KKS_SESSION is empty\n  KKS_USE_GITDIR_SESSIONS\n      If set, use git root dir name for creating/connecting to session\n\nUse \"kks \u003ccommand\u003e -h\" for command usage.\n```\n\n### Unknown command\n\nWhen unknown command is run, `kks` will try to find an executable named\n`kks-\u003ccommand\u003e` in `$PATH`. If the executable is found, `kks` will run it with\nall arguments that were provided to the unknown command.\n\n## Configuration\n\n`kks` can be configured through environment variables.\n\n### Automatic sessions based on git directory\n\n```\nexport KKS_USE_GITDIR_SESSIONS=1\n```\n\nWhen `KKS_USE_GITDIR_SESSIONS` is set to any value and `KKS_SESSION` is empty,\nrunning `kks edit` will do the following:\n\n- if file is inside a git directory, `kks` will search for an existing session\n  based on top-level git directory name and connect to it;\n- if a session for the directory doesn't exist, `kks` will start a new session\n  and connect to it.\n\n### Default session\n\n```\nexport KKS_DEFAULT_SESSION='mysession'\n```\n\nWhen context is not set (`KKS_SESSION` is empty), running `kks edit` will check\nfor a session defined by `KKS_DEFAULT_SESSION` variable. If the session is\nrunning, `kks` will connect to it instead of starting a new session.\n\n`kks` will not start the default session if it's not running. You can use the\nautostarting mechanism of your desktop to start it with `kak -d -s mysession`.\n\n## Provided scripts\n\n| script                                       | function                                                |\n| -------------------------------------------- | ------------------------------------------------------- |\n| [`kks-buffers`](./scripts/kks-buffers)       | pick buffers                                            |\n| [`kks-fifo`](./scripts/kks-fifo)             | pipe stdin to Kakoune fifo buffer                       |\n| [`kks-files`](./scripts/kks-files)           | pick files                                              |\n| [`kks-filetypes`](./scripts/kks-filetypes)   | pick and set filetype in current buffer                 |\n| [`kks-git-files`](./scripts/kks-git-files)   | pick files from `git ls-files`                          |\n| [`kks-grep`](./scripts/kks-grep)             | search for pattern in working directory                 |\n| [`kks-lf`](./scripts/kks-lf)                 | open [lf] with current buffer file selected             |\n| [`kks-lines`](./scripts/kks-lines)           | jump to line in buffer                                  |\n| [`kks-md-heading`](./scripts/kks-md-heading) | jump to markdown heading                                |\n| [`kks-mru`](./scripts/kks-mru)               | pick recently opened file                               |\n| [`kks-select`](./scripts/kks-select)         | select Kakoune session and client to set up environment |\n\n[lf]: https://github.com/gokcehan/lf\n\n## Similar projects\n\n- [kakoune.cr](https://github.com/alexherbo2/kakoune.cr)\n- [kakoune-remote-control](https://github.com/danr/kakoune-remote-control)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkga%2Fkks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkga%2Fkks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkga%2Fkks/lists"}