{"id":17223153,"url":"https://github.com/daboross/kak-recent-files","last_synced_at":"2025-03-25T16:23:06.050Z","repository":{"id":150517859,"uuid":"195608002","full_name":"daboross/kak-recent-files","owner":"daboross","description":"WIP kakoune plugin for managing recent files","archived":false,"fork":false,"pushed_at":"2019-07-28T19:09:47.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T14:27:09.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daboross.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-07T04:02:39.000Z","updated_at":"2019-07-28T19:09:49.000Z","dependencies_parsed_at":"2023-06-09T02:45:47.564Z","dependency_job_id":null,"html_url":"https://github.com/daboross/kak-recent-files","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fkak-recent-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fkak-recent-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fkak-recent-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fkak-recent-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daboross","download_url":"https://codeload.github.com/daboross/kak-recent-files/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245496970,"owners_count":20624930,"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":[],"created_at":"2024-10-15T04:07:30.412Z","updated_at":"2025-03-25T16:23:06.018Z","avatar_url":"https://github.com/daboross.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kak-recent-files\nWIP kakoune plugin for managing recent files\n\nThis plugin is sort of session management, sort of easy buffer switching. I've written most of the\ncode in Rust, since that's what I'm most comfortable with.\n\nIf you want to use this plugin, file an issue! It's currently fairly specialized to my work flow,\nand could use with some good generalization if anyone else is interested in using it.\n\n### Overview\n\nFor each session, kak-recent-files keeps a sorted set of files in the current directory, ordered by\nmost recently used. The \"using\" here is switching to a kakoune buffer with the file open.\n\nWhen enabling permenant storage, this set is kept as a newline-delimited list in\n`~/.local/share/kak-recent-files/$session_name`. It will be initially populated with all\nnon-gitignored files in the directory kakoune was first opened in.\n\nWhen enabling temp storage, this set is kept in a kakoune option for the session. Temp storage also\ndisables initial population.\n\nWhen you load `recent-files.kak`, you enable:\n\n- a hook to add files on WinDisplay (any change of what file is displayed)\n- the following commands:\n  - `krf-open-initial` opens the last file opened with this session\n  - `krf-open-menu` opens `rofi` (or configured command) selecting from the recent file set\n  - `krf-delete-file` removes a particular file from the set\n  - `krf-reset` resets the set of known files\n\n### Recommended Configuration\n\nSince switching buffers is an often used operation when using `kakoune` is an IDE, I recommend\ngiving `krf-open-menu` it's own keybinding. I personally map the unmodified `'` key to this,\nsince it's not already used:\n\n```\nmap -docstring \"open buffer\" global normal '''' ': krf-open-menu\u003cret\u003e'\n```\n\nI also recommend setting up whether or not krf will use permanent storage on kakoune startup. This\nhook sets this based off of whether kakoune is in a named session, or an anonymous one, and then\nalso runs `krf-open-intial` for named sessions.\n\n```\nhook global KakBegin .* -group krf-global-hooks %{\n    evaluate-commands %sh{\n        if echo \"$kak_session\" | grep -qE '^[0-9]+$'; then\n            echo \"set-option global krf_use_temp_storage true\"\n        else\n            echo \"set-option global krf_use_temp_storage false\"\n            echo \"krf-open-initial\"\n        fi\n    }\n}\n```\n\n### Options\n\n- `krf_use_temp_storage`\n\n  true if using temp storage, false if storing on disk\n\n- `krf_menu_command`\n\n  this is the command that will be executed in `krf-open-menu`. the recent file list will be passed\n  in via stdin, with the most recent first. the command should output either no lines, or one line\n  containing one of the input filenames.\n\n### Menu / Example\n\nThis is intended for use with `rofi`, but any command can be set as the `krf_menu_command`.\n\nIf you do use rofi, I recommend configuring it further. There's a good guide for configuration at\nhttps://github.com/davatorium/rofi/wiki/themes.\n\nMy personal configuration includes the default menu command for this repository,\n`rofi -dmenu -i -matching fuzzy`, and the configuration in the file `rofi-config.rasi`. With this\nconfiguration, `kak-recent-files` looks like the following:\n\n![example configuration picture](./example.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaboross%2Fkak-recent-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaboross%2Fkak-recent-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaboross%2Fkak-recent-files/lists"}