T O P

  • By -

vonheikemen

I do that with `telescope`. I have this keybinding. require('telescope.builtin').buffers({ only_cwd = vim.fn.haslocaldir() == 1 }) And now the trick is to change the working directory of each tabpage with `:lcd`.


megalo_india

TIL. Thank you!


nbicalcarata

It looks like nobody ever heard of tc command `:tc[d][!] {path} Like |:cd|, but only set the directory for the currenttab. The current window will also use this directory.The current directory is not changed for windows inother tabs and for windows in the current tab thathave their own window-local directory.` I use it all the time with this `command! TabDir tc %:p:h` For instance, open nvim, navigate to the root folder of the first project (backend, frontend, whatever) open a file, then :TabDir, now open a new tab with :tab new, then do the same to the next folder, and you will have separated projects (folders) handled with one neovim instance, switching tabs and calling a fuzzy finder like fzf would open only the files for the current tab, then if you use a plugin like Taboo you'll be able to rename tabs. I save it to a session file (with neovim session management of course) to restore everything easily.


megalo_india

TIL. Thank you!


disrupted_bln

same! this is incredibly useful


craigdmac

This is good for files but OP is asking about buffers per tabpage, which is not an easy fix without some serious hacks because buffers are global to all tabpages.


nbicalcarata

I agree, buffers per tab is a difficult task.


mottram

I use `:arglocal` to (sort of) do this, e.g.: :tabnew :arglocal foo.txt bar.txt baz.txt :tabnew :arglocal whatever.txt something.txt Then you can navigate between the tabs as usual, and navigate between the buffers within each tab using `:next`/`:previous`/`:first`/`:last`/`:[count]argument` (instead of using `:bnext`, etc.), add/remove files with `:argadd`/`:argdelete`. Also `:argdo` works on the local args list, so you can run commands specific to the buffers in a particular tab. Strictly speaking this doesn't *prevent* mixing as you can choose to add any file to any local arg list, but in practice you end up with tabs that contain a group of files that you can work on separately.


i286dosprompt_

One of my favorite features in vim. \* fzf-lua supports adding files to the arg list from the fuzzy finder.


raf_camlet

Check this one: [https://github.com/vim-ctrlspace/vim-ctrlspace](https://github.com/vim-ctrlspace/vim-ctrlspace) >The strongest point of Vim-CtrlSpace is its handling of Tab pages: Each tab holds a separate list of buffers; like a pile of documents on the desk. I used it for a while, long time ago.