{"id":13927071,"url":"https://github.com/mhinz/vim-sayonara","last_synced_at":"2025-06-20T02:35:22.066Z","repository":{"id":31389486,"uuid":"34952618","full_name":"mhinz/vim-sayonara","owner":"mhinz","description":":japanese_goblin: Sane buffer/window deletion.","archived":false,"fork":false,"pushed_at":"2022-07-03T17:50:23.000Z","size":51,"stargazers_count":294,"open_issues_count":7,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-20T12:07:11.075Z","etag":null,"topics":["buffers","neovim","vim","vim-plugin","windows"],"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/mhinz.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}},"created_at":"2015-05-02T15:22:52.000Z","updated_at":"2025-04-23T19:01:22.000Z","dependencies_parsed_at":"2022-09-21T01:00:48.349Z","dependency_job_id":null,"html_url":"https://github.com/mhinz/vim-sayonara","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mhinz/vim-sayonara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fvim-sayonara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fvim-sayonara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fvim-sayonara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fvim-sayonara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhinz","download_url":"https://codeload.github.com/mhinz/vim-sayonara/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fvim-sayonara/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260866718,"owners_count":23074875,"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":["buffers","neovim","vim","vim-plugin","windows"],"created_at":"2024-08-07T16:01:23.155Z","updated_at":"2025-06-20T02:35:17.053Z","avatar_url":"https://github.com/mhinz.png","language":"Vim script","funding_links":[],"categories":["Vim Script","Vim script"],"sub_categories":[],"readme":"![vim-sayonara](https://github.com/mhinz/vim-sayonara/blob/master/image/sayonara.png)\n\nThis plugin provides a single command that deletes the current buffer and\nhandles the current window in a smart way.\n\nBasically you don't have to think in terms of `:bdelete`, `:close`, `:quit` etc.\nanymore. The plugin does that for you.\n\nIt reduces cognitive load and lets you focus on the main task: editing text.\n\n    :Sayonara\n\nThis deletes the current buffer and closes the current window.\n\n    :Sayonara!\n\nThis deletes the current buffer and preserves the current window.\n\n## Installation and Documentation\n\nUse your [favorite plugin\nmanager](https://github.com/mhinz/vim-galore#managing-plugins), e.g.\n[vim-plug](https://github.com/junegunn/vim-plug):\n\n    Plug 'mhinz/vim-sayonara', { 'on': 'Sayonara' }\n\nRead `:h sayonara` for more information about this plugin.\n\n## Details\n\nFirst of all, `:Sayonara` or `:Sayonara!` will only delete the buffer, if it\nisn't shown in any other window. Otherwise `:bdelete` would close these windows\nas well. Therefore both commands always only affect the current window. This is\nwhat the user expects and is easy reason about.\n\nIf the buffer contains unsaved changes, you'll be prompted on what to do.\n\n#### :Sayonara\n\n    * mark current buffer\n    * current window is the only window in current tabpage?\n      true  =\u003e is there only one tabpage?\n               true  =\u003e are there any other active buffers?\n                        true  =\u003e switch to most recently used active buffer\n                        false =\u003e Is g:sayonara_confirm_quit set?\n                                 true  =\u003e confirm whether to quit Vim\n                                 false =\u003e quit Vim\n               false =\u003e close tabpage\n      false =\u003e close window\n    * delete marked buffer unless it is shown in any other window\n\n#### :Sayonara!\n\n    * mark current buffer\n    * are there any other active buffers?\n      true  =\u003e switch to most recently used active buffer\n      false =\u003e create an empty scratch buffer\n    * delete marked buffer unless it is shown in any other window\n\nIf a window with an associated location-list is closed, the location list will\nbe closed as well.\n\n## Isn't this the same as bufkill?\n\nNo.\n\nThe biggest difference is that bufkill doesn't handle other windows and\ntabpages at all, so if you try to delete a buffer that is also shown in another\nwindow, multiple windows will be closed. Sayonara is more predictable in this\nregard, and, if at all, only closes the current window.\n\nBufkill also doesn't handle associated location lists.\n\nSayonara simply handles more corner cases and tries to make one command always\nDo The Right Thing whereas bufkill provides multiple commands so you always\nhave to think about what you're trying to do.\n\n## Feedback\n\nIf you like this plugin, star it! It's a great way of getting feedback. The same\ngoes for reporting issues or feature requests.\n\nContact: [Twitter](https://twitter.com/_mhinz_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhinz%2Fvim-sayonara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhinz%2Fvim-sayonara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhinz%2Fvim-sayonara/lists"}