{"id":17089458,"url":"https://github.com/mihaifm/bufstop","last_synced_at":"2025-03-06T12:13:10.417Z","repository":{"id":5520801,"uuid":"6722406","full_name":"mihaifm/bufstop","owner":"mihaifm","description":"Fast and efficient buffer switching for Vim","archived":false,"fork":false,"pushed_at":"2024-09-02T18:44:01.000Z","size":103,"stargazers_count":95,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T14:14:02.431Z","etag":null,"topics":["vim","vim-plugin","vim-plugins","vim-script","viml"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mihaifm.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":"2012-11-16T14:04:42.000Z","updated_at":"2024-12-13T16:54:42.000Z","dependencies_parsed_at":"2024-03-02T02:24:19.526Z","dependency_job_id":"0bfa5a62-7539-472b-9a90-1c1721559525","html_url":"https://github.com/mihaifm/bufstop","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihaifm%2Fbufstop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihaifm%2Fbufstop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihaifm%2Fbufstop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihaifm%2Fbufstop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mihaifm","download_url":"https://codeload.github.com/mihaifm/bufstop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242206046,"owners_count":20089255,"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":["vim","vim-plugin","vim-plugins","vim-script","viml"],"created_at":"2024-10-14T13:47:16.063Z","updated_at":"2025-03-06T12:13:10.360Z","avatar_url":"https://github.com/mihaifm.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bufstop\n\nIf you find yourself frequently switching back and forth between files, and looking for \na faster way to do it, well...your journey has come to an end. Welcome to the **Bufstop** !\n\n**Bufstop** is a plugin for faster buffer switching, built for efficiency and less keystrokes.\nIt provides no less than 7 ways to display and switch buffers.\n\nIf you can think of faster ways to switch files, let me know and I will include them in the plugin.\n\n![image](https://github.com/mihaifm/bufstop/assets/981184/ed719eb5-0fd3-40f2-ae63-083c18e5b844)\n\n## Buffer window with hotkeys\n\nhttps://github.com/mihaifm/bufstop/assets/981184/21294af7-54de-4c67-b8fb-9779640b6853\n\nThe `:Bufstop` command opens a new window at the top/bottom of the screen containing the list of\ncurrent buffers, ordered by most recently used. Each buffer has an associated hotkey \ndisplayed besides it. When pressed, the correspoding buffer\nis loaded, with the focus remaining in the Bufstop window. This way you can quickly preview\nbuffers with only 1 keystroke !\n\nThe Bufstop window is easily dismissed with the `\u003cEsc\u003e` key.\n\nThere is also a `:BufstopFast` command which opens the Bufstop window in the same way,\nbut spares you the effort of pressing the `\u003cEsc\u003e` key : the window closes automatically after\nyou select a buffer.\n\n**_Tip:_** If you're using the recommended mappings (see below), `\u003cleader\u003eb2` will always take you to\nthe previously opened file (aka *alternate buffer*)\n\n## Preview mode\n\nhttps://github.com/mihaifm/bufstop/assets/981184/86fea879-67fa-4902-98f6-f5acdafab141\n\nThe `:BufstopPreview` command is similar to the `:Bufstop` command, with the notable difference that you can\npreview and navigate files by moving **up or down** in the window with `j,k` or arrow keys. \nIt is a powerful and instant way to check your files.\n\n**_Tip:_** You can still switch files by pressing the hotkeys associated with them.\n\n## Minimal mode inside the command line\n\nhttps://github.com/mihaifm/bufstop/assets/981184/1d6e450f-851c-48e9-be5f-4bcc6dbd7047\n\nDon't like a pottentially huge file list popping on the screen? Use the `:BufstopMode` command.\nBuffers will be displayed in the command line, in the same order: by most recently used.\n\nIn this mode, you can only press numbers. Pressing `3` will take you to the 3rd recently used \nbuffer. However here's __*the catch*__: because the 3rd buffer will now be first in the hierarchy,\nit's place will be taken by another buffer.   \nSo pressing `33333....` will __*cycle between the last 3 buffers*__.   \nSimilarly, `4444` will cycle the last 4 buffers, and so on.\n\nPressing `\u003cEsc\u003e` will dismiss the mode. There is a `:BufstopModeFast` alternative, \nwhich dismisses the mode once you select a buffer.\n\n**_Tip:_** The first buffer labeled with `1` will always be the current file.\n\n## On the statusline\n\nThe `:BufstopStatusline` command works the same way as `:BufstopMode`, but displays the buffers\non the statusline. As before, there is a fast alternative, `:BufstopStatuslineFast` that\nwill close the mode once you select something.\n\n**_Tip:_** No worries, your old statusline is restored once you exit the mode.\n\n## Extreme speed hotkeys\n\nThe previous methods are cool, but they still require a mapping to bring up the buffer list\n(typically `\u003cleader\u003eb`).    \nLooking for a faster way? Use the `:BufstopSpeedToggle` command. \n\nIt creates the following mappings: `\u003cleader\u003e2` opens the previous buffer, `\u003cleader\u003e3` to open\nthe 3rd recently used buffer, and so on.\n\nUsing `:BufstopSpeedToggle` again will clear out these mappings.\n\n**_Tip:_** Pressing `,5,5,5...` will cycle the last 5 buffers.\n\n## Ultimate\n\nThe previous speed method requires 2 keys to open any arbitrary buffer. Too much? Put this \nin your `vimrc`:\n\n    let g:BufstopSpeedKeys = [\"\u003cF1\u003e\", \"\u003cF2\u003e\", \"\u003cF3\u003e\", \"\u003cF4\u003e\", \"\u003cF5\u003e\", \"\u003cF6\u003e\"]\n    let g:BufstopLeader = \"\"\n    let g:BufstopAutoSpeedToggle = 1\n\nYes, you guessed it. __*1 key to open arbitrary buffers*__ !\n\nOnce again, pressing `\u003cF4\u003e\u003cF4\u003e\u003cF4\u003e...` will cycle between the last 4 buffers.\n\n**_Tip:_** Already had something mapped to `\u003cFx\u003e`? Use `:BufstopSpeedToggle` to switch off\nthese mappings. Bufstop will attempt to restore your old mapping (given that you didn't use\n`noremap`).\n\n## Bonuses\n\n1. As a bonus, this plugin provides __*navigation history for each window*__.    \nUse the `:BufstopBack` and `:BufstopForward` to navigate this history.\n\n2. The other bonus is the ability to sort the buffers by __*MFU (most frequently\nused)*__. Use the `g:BufstopSorting` option to activate this powerful feature.\n\n## Recommended mappings\n\nHopefully we're not crazy to type in those long command names. You can use the below \nmappings or create your own:\n\n    map \u003cleader\u003eb :Bufstop\u003cCR\u003e             \" get a visual on the buffers\n    map \u003cleader\u003ew :BufstopPreview\u003cCR\u003e      \" switch files by moving inside the window\n    map \u003cleader\u003ea :BufstopModeFast\u003cCR\u003e     \" a command for quick switching\n    map \u003cC-tab\u003e   :BufstopBack\u003cCR\u003e\n    map \u003cS-tab\u003e   :BufstopForward\u003cCR\u003e\n    let g:BufstopAutoSpeedToggle = 1       \" now I can press ,3,3,3 to cycle the last 3 buffers\n\n## Don't like this plugin?\n\nAt least put this in your `vimrc`:\n\n    :map \u003cleader\u003eb :ls\u003cCR\u003e:b\n\nIt will display the buffer list and prompt you for a number. Simple, but primitive, especially \nwhen you're dealing with a lot of files.\n\nIn addition to this plugin, you can use a fuzzy finder like \n[CtrlP](https://github.com/kien/ctrlp.vim), which requires you to type parts of the file name.\n\n## Reference documentation\n\n### Commands:\n\n* `:Bufstop`  \n\nInvokes the `Bufstop` window. Inside it, each buffer will have an associated \nhotkey that can be used to open the buffer. \n\nIn addition, the following key mappings are present in the `Bufstop` window:\n\n    d          Wipe the selected buffer (close the file)\n    \u003cCR\u003e       Open the selected buffer.\n    \u003cEsc\u003e      Dismiss the Bufstop window\n    k,j        Move up/down to select a buffer.\n\n* `:BufstopFast`   \n\nSame as `:Bufstop`, but the window is closed after you select a buffer.    \n\n* `:BufstopPreview`   \n\nSame as `:Bufstop` but navigating to different rows with k,j or arrow keys will\ninstantly swtich buffers.\n\n* `:BufstopMode`\n\nDisplay the most recently used buffers in the command line and enter Bufstop mode.\nIn this mode you can press only a number coresponding to a buffer, or the `\u003cEsc\u003e` key\nwhich exits the mode. The number of displayed files can be configured using\nthe `g:BufstopModeNumFiles` option.\n\n* `:BufstopModeFast`\n\nSame as `:BufstopMode` but exits the mode once a buffer is selected.\n\n* `:BufstopStatusline`\n\nSame as `:BufstopMode` but displays the list in the statusline. The old statusline is \nrestored once the mode is dismissed.\n\n* `:BufstopStatuslineFast`\n\nSame as `:BufstopStatusline` but exists the mode once a buffer is selected.\n\n* `:BufstopSpeedToggle`\n\nToggle speed mappings. The defaults are `\u003cleader\u003e2` to go to the 2nd recently used buffer,\n`\u003cleader\u003e3` to go to the 3rd, an so on. These can be configured using the\n`g:BufstopSpeedKeys` and `g:BufstopLeader` options.\n\n* `:BufstopBack`\n\nOpens the previous buffer in the navigation history for the current window.\n\n* `:BufstopForward`\n\nOpens the next buffer in the navigation history for the current window.\n\n## Config\n\n* `g:BufstopKeys`\n\nThe shortcut keys used to switch buffers. The keys are displayed next to the\nbuffer names, in the order they appear in this string.\nDefault: `\"1234asfcvzx5qwertyuiopbnm67890ABCEFGHIJKLMNOPQRSTUVZ\"`\n\n* `g:BufstopSpeedKeys`\n\nKeys used to create speed mappings. The `g:BufstopLeader` will be appended to\neach key to create the mappig.\nDefault: `[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]`\n\n* `g:BufstopLeader`\n\nThe key that is appended to the speed mappings. \nDefault: `\"\u003cleader\u003e\"`\n\n* `g:BufstopAutoSpeedToggle`\n\nMount the speed mappings automatically when loading the plugin. Default is 0.\n\n* `g:BufstopSplit`\n\nThe split location of the Bufstop window. Valid options are the ones that\ninfluence the `:split` command in Vim: `topleft`, `leftabove`, `rigthbelow`, etc.\nDefault: `\"botright\"`\n\n* `g:BufstopSorting`\n\nControls the way buffers are sorted before being displayed. Valid options are:\n\n    \"MRU\" - sort by most recently used\n    \"MFU\" - sort by most frequently used\n    \"none\" or \"\" - disable sorting\n\nDefault: `\"MRU\"`\n\nMore config options with `:help Bufstop`\n\n## Customization\n\nYou can add symbols/icons next to buffer names by implementing `g:BufstopFileSymbolFunc` in you vimrc. \nExample using the vim-devicons plugin:\n\n    let g:BufstopFileSymbolFunc = 'MyBufstopFileIcon'\n    function MyBufstopFileIcon(path)\n      return WebDevIconsGetFileTypeSymbol(a:path)\n    endfunction\n\nYou can format file names displayed by the plugin by implementing `g:BufstopFileFormatFunc`.\nFor example you can hide file extensions:\n\n    let g:BufstopFileFormatFunc = 'MyBufstopFileFormat'\n    function! MyBufstopFileFormat(shortname)\n      return fnamemodify(a:shortname, ':t:r')\n    endfunction\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihaifm%2Fbufstop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihaifm%2Fbufstop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihaifm%2Fbufstop/lists"}