diff options
author | Marc Coquand <marc@baemingo.com> | 2023-05-20 16:36:58 -0500 |
---|---|---|
committer | Marc Coquand <marc@baemingo.com> | 2023-05-20 16:36:58 -0500 |
commit | 9c49cd7adb8d0254ea1efca28c46524d3fa51ed6 (patch) | |
tree | 07c8a0c65afeb8d44bcf4ef89859dbe0a4d3ae94 | |
parent | 6da058ff66f58eaf983f51b00be22871df92bc60 (diff) | |
download | BufferBrowser-9c49cd7adb8d0254ea1efca28c46524d3fa51ed6.tar.gz BufferBrowser-9c49cd7adb8d0254ea1efca28c46524d3fa51ed6.tar.bz2 BufferBrowser-9c49cd7adb8d0254ea1efca28c46524d3fa51ed6.zip |
Change readme, update defaults
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | doc/BufferBrowser.txt | 15 | ||||
-rw-r--r-- | lua/buffer_browser.lua | 2 |
3 files changed, 11 insertions, 19 deletions
@@ -58,22 +58,19 @@ function. This is the default config: ```lua require('buffer-browser').setup({ - -- '' + 'netrw' is used to filter out netrw. - filetype_filters = {'', 'netrw', 'gitcommit', 'TelescopePrompt'} + filetype_filters = {'gitcommit', 'TelescopePrompt'} }) ``` This can be used to filter out buffers you do not want in the history. -#### Limitation - -To filter out netrw, we need to also filter out `''`, as the filetype -occassionally gets set to that by netrw (not sure why...). This means files -without filetype are filtered out. +To immediately close netrw after you have opened a file, I recommend setting +` g:netrw_fastbrowse = 0`, this will remove the netrw buffer and wipe it from +the browser history. ## Credits The plugin is mostly a copy of [ton/vim-bufsurf](https://github.com/ton/vim-bufsurf), but rewritten in Lua and -adds the ability to filter unwanted filetypes to get rid of netrw buffers. +adds the ability to filter unwanted filetypes. diff --git a/doc/BufferBrowser.txt b/doc/BufferBrowser.txt index c5c061b..d257ad0 100644 --- a/doc/BufferBrowser.txt +++ b/doc/BufferBrowser.txt @@ -29,17 +29,12 @@ You can configure the filetype_filters by passing a table to the setup function. require('buffer-browser').setup({ -- '' + 'netrw' is used to filter out netrw. - filetype_filters = {'', 'netrw', 'gitcommit', 'TelescopePrompt'} + filetype_filters = {'gitcommit', 'TelescopePrompt'} }) -This can be used to filter out buffers you do not want in the history. If your -current buffer ends with, for example netrw, it will be filtered out and not -available in the history - -LIMITATIONS - -To filter out netrw, we need to also filter out '', as the filetype -occassionally gets set to that by netrw (not sure why...). This means files -without filetype are filtered out. +This can be used to filter out buffers you do not want in the history. +To immediately close netrw after you have opened a file, I recommend setting +` g:netrw_fastbrowse = 0`, this will remove the netrw buffer and wipe it from +the browser history. diff --git a/lua/buffer_browser.lua b/lua/buffer_browser.lua index 5bc4a3e..701e500 100644 --- a/lua/buffer_browser.lua +++ b/lua/buffer_browser.lua @@ -232,7 +232,7 @@ end local function setup(opts) if (opts == nil) then local default = { - '', 'netrw', 'gitcommit', 'TelescopePrompt' + 'gitcommit', 'TelescopePrompt' } vim.g.buffer_browser_filters = default else |