{"id":13898478,"url":"https://github.com/habamax/vim-select","last_synced_at":"2025-10-27T21:05:06.381Z","repository":{"id":55942056,"uuid":"303416533","full_name":"habamax/vim-select","owner":"habamax","description":"Vim fuzzy file/buffer/mru selector plugin","archived":false,"fork":false,"pushed_at":"2025-01-06T22:26:01.000Z","size":135,"stargazers_count":41,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T02:36:08.286Z","etag":null,"topics":["files","fuzzy","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/habamax.png","metadata":{"files":{"readme":"README.adoc","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,"zenodo":null}},"created_at":"2020-10-12T14:24:54.000Z","updated_at":"2025-03-12T00:30:13.000Z","dependencies_parsed_at":"2025-05-05T02:34:15.276Z","dependency_job_id":"d7ea55e8-2da4-45c3-b3b8-3668dd44bda6","html_url":"https://github.com/habamax/vim-select","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/habamax/vim-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habamax%2Fvim-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habamax%2Fvim-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habamax%2Fvim-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habamax%2Fvim-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/habamax","download_url":"https://codeload.github.com/habamax/vim-select/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habamax%2Fvim-select/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281341162,"owners_count":26484537,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["files","fuzzy","vim"],"created_at":"2024-08-06T18:04:18.918Z","updated_at":"2025-10-27T21:05:06.376Z","avatar_url":"https://github.com/habamax.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"= vim-select: fuzzy select file/buffer/MRU/etc\n\n\nNOTE: Plugin works with recent (nightly) vim having `matchfuzzypos()` function and\n`prompt-buffer` feature implemented.\n\nFor project files, buffers and MRU it lets you narrow down the list with fuzzy\nmatching and select with `\u003cCR\u003e` or `\u003cTab\u003e` if only 1 candidate is in the list.\n\nFor files it will let you go to parent directory with `\u003cBS\u003e` and to selected\ndirectory with `\u003cCR\u003e`.\n\nProject file search uses either `fd` or `ripgrep` (with fallback to `find`\non non-windows) tool so be sure you have one of them installed on your system.\nBy default it uses vim current working directory as a project root.\n\n\nimage::https://user-images.githubusercontent.com/234774/99876845-bac99400-2c0a-11eb-87cf-e881690b20c7.gif[]\n\n\nlink:showcase.adoc[More animated gifs]\n\n\nNOTE: Extensions are available: https://github.com/habamax/vim-select-more\n\n\n== Installation\n\nIf you use package/plugin manager, consult their documentation.\n\nFor manual installation clone this repository to your\n`~/.vim/pack/plugins/start/` path, where `plugins` subdirectory is arbitrary.\n\nNOTE: for windows users replace `~/.vim` to `~/vimfiles`.\n\n\n== Mappings\n\nThere are no default global mappings -- create your own.\n\n.Safe (will not create mappings if plugin was not loaded)\n[source,vim]\n------------------------------------------------------------------------------\n\" add it to ~/.vim/after/plugin/select.vim\nif exists(\"g:loaded_select\")\n    nmap \u003cleader\u003efe \u003cPlug\u003e(SelectFile)\n    nmap \u003cleader\u003eff \u003cPlug\u003e(SelectProjectFile)\n    nmap \u003cleader\u003efp \u003cPlug\u003e(SelectProject)\n    nmap \u003cleader\u003eb \u003cPlug\u003e(SelectBuffer)\n    nmap \u003cleader\u003em \u003cPlug\u003e(SelectMRU)\nendif\n------------------------------------------------------------------------------\n\nor\n\n.Regular\n[source,vim]\n------------------------------------------------------------------------------\n\" add it to your vimrc\nnmap \u003cleader\u003efe \u003cPlug\u003e(SelectFile)\nnmap \u003cleader\u003eff \u003cPlug\u003e(SelectProjectFile)\nnmap \u003cleader\u003efp \u003cPlug\u003e(SelectProject)\nnmap \u003cleader\u003eb \u003cPlug\u003e(SelectBuffer)\nnmap \u003cleader\u003em \u003cPlug\u003e(SelectMRU)\n------------------------------------------------------------------------------\n\nSelect window has default mappings:\n\n* `\u003cCR\u003e` to open/execute current item.\n* `\u003cS-CR\u003e` or `\u003cC-s\u003e` to open current item in split.\n* `\u003cC-v\u003e` to open current item in vertical split.\n* `\u003cC-t\u003e` to open current item in a tab.\n* `\u003cC-j\u003e` to create a new file out of prompt value. Only available for `:Select file`.\n* `\u003cESC\u003e` to close the select window.\n* `\u003cTAB\u003e` select next item in the list, for a single item it will open/execute\n  it.\n* `\u003cBS\u003e` open parent directory. Only for `Select file`.\n* `\u003cC-n\u003e` or `\u003cDown\u003e` select next item.\n* `\u003cC-p\u003e` or `\u003cUp\u003e` select previous item.\n* `\u003cPageUp\u003e` scroll up select window.\n* `\u003cPageDown\u003e` scroll down select window.\n\n\n== Commands\n\n* `:Select` file from current file directory.\n\n* `:Select file` from current file directory. Or from directory passed as an\n  argument.\n\n* `:Select projectfile` from current working directory(and sub-directories). Or\n  from directory passed as an argument.\n+\nNOTE: External tool `fd` or `ripgrep` is required. On non-windows `find` would\nbe used if none is installed.\n\n* `:Select project` from the list of projects and run `:Select projectfile` on\n  it. Each project is a current working directory where `:Select projectfile`\n  was run and a file was selected. The list is persisted in\n  `~/.vim/.selectprojects` or `~/.selectprojects` file.\n\n* `:Select buffer` from buffer list.\n\n* `:Select mru` from `v:oldfiles`.\n\n\n== Extending\n\nFirst of all create an \"extension point\":\n\n[source,vim]\n------------------------------------------------------------------------------\nlet g:select_info = get(g:, \"select_info\", {})\n------------------------------------------------------------------------------\n\nAnd then...\n\n\n=== Basic example\n\nLet's select something from the list and echo it in vim:\n\n[source,vim]\n------------------------------------------------------------------------------\nlet g:select_info.test = {}\nlet g:select_info.test.data = {-\u003e ['hello', 'from', 'vim-select', 'plugin']}\nlet g:select_info.test.sink = \"echomsg '%s'\"\n------------------------------------------------------------------------------\n\nThen with the command `:Select test` you can select a value from the list and\nsee it was echoed as a vim message.\n\n`%s` would be substituted with the selected value in the `sink` string\nparameter.\n\nYou can also provide a dict with action there, like:\n\n[source,vim]\n------------------------------------------------------------------------------\nfunc! ShowMessage(msg) abort\n    echom a:msg\nendfunc\n\nlet g:select_info.test = {}\nlet g:select_info.test.data = {-\u003e ['hello', 'from', 'vim-select', 'plugin']}\nlet g:select_info.test.sink = {\"action\": {v -\u003e ShowMessage(v)}}\n------------------------------------------------------------------------------\n\n\n=== Show highlight group\n\n[source,vim]\n------------------------------------------------------------------------------\nlet g:select_info.highlight = {}\nlet g:select_info.highlight.data = {-\u003e getcompletion('', 'highlight')}\nlet g:select_info.highlight.sink = {\"action\": {v -\u003e feedkeys(':hi '..v..\"\\\u003cCR\u003e\", \"nt\")}}\n------------------------------------------------------------------------------\n\nThen use `:Select highlight` to select and show syntax highlight group\nparameters.\n\n\n=== Loading sessions\n\nImagine you have all your sessions saved in `~/.vimdata/sessions` folder.\nI do have them there and usually create session with a helper command:\n\n[source,vim]\n------------------------------------------------------------------------------\ncommand! -nargs=1 S :mksession! ~/.vimdata/sessions/\u003cargs\u003e\n------------------------------------------------------------------------------\n\nThen just a simple `:S my_another_project` to persist a session.\n\nNow to narrow down and source/apply a session you can setup select plugin with:\n\n[source,vim]\n------------------------------------------------------------------------------\nlet g:select_info.session = {}\nlet g:select_info.session.data = {-\u003e map(glob(\"~/.vimdata/sessions/*\", 1, 1), {_, v -\u003e fnamemodify(v, \":t\")})}\nlet g:select_info.session.sink = \"%%bd | source ~/.vimdata/sessions/%s\"\nnnoremap \u003cleader\u003efs :Select session\u003cCR\u003e\n------------------------------------------------------------------------------\n\n\n=== Play mp3. Yes, mp3s.\n\nFunny thing, vim can play mp3s, so just for fun we can select a music file and\nplay it:\n\n[source,vim]\n------------------------------------------------------------------------------\nlet g:select_info.sound = {}\nlet g:select_info.sound.data = {\"job\": \"rg --files --glob *.mp3\"}\nlet g:select_info.sound.sink = {\"transform\": {p, v -\u003e p..v}, \"action\": {v -\u003e sound_playfile(v)}}\n------------------------------------------------------------------------------\n\nHaving this you can `:Select sound ~/Music`, select and play mp3 file.\n\nA new key `\"transform\"` is to apply additional logic for a value to be passed\nfor an action. It receives a current working directory path and a selected\nvalue. In this example the value is transformed to be a full path to a mp3\nfile.\n\n\n=== Filetype specific example\n\nThere is `b:select_info` you can use in the same way as `g:select_info`.\n\nFor example I would like to be able to select and run https://godotengine.org/[Godot] scene and it\nshould only be availble in https://github.com/habamax/vim-godot[gdscript] files.\n\nJust add to `~/.vim/after/ftplugin/gdscript.vim`:\n\n[source,vim]\n------------------------------------------------------------------------------\nlet b:select_info = {\"godotscene\": {}}\nlet b:select_info.godotscene.data = {\"job\": \"rg --files --glob *.tscn\"}\nlet b:select_info.godotscene.sink = {\"transform\": {_, v -\u003e fnameescape(v)}, \"action\": \"GodotRun %s\"}\nnnoremap \u003cbuffer\u003e \u003cleader\u003e\u003cleader\u003ef :Select godotscene\u003cCR\u003e\n------------------------------------------------------------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabamax%2Fvim-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhabamax%2Fvim-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabamax%2Fvim-select/lists"}