Fork me on GitHub
#spacemacs
<
2018-11-19
>
theeternalpulse00:11:34

is there a way to constrain the buffers that open up in a layout by project. I often have issues where I go to a different layout and do something in the original layout that opens a buffer from somewhere not in the prolect (sometimes previous/next buffer, evil-jump commands, etc)

practicalli-johnny13:11:21

@theeternalpulse if you do find a way to constrain projects buffers to layouts, then please share. I do rely on layouts to help structure task switching between different work. Using layouts does mean I have to be careful with the use of SPC TAB as if I do that just after switching between layouts, I'll pull in the buffer from the previous layout. I can kill the unwanted buffer, but it would be useful if SPC TAB could be layout specific. I couldnt find anything obvious, but will have another search around.

jeff.terrell14:11:26

I think layouts are supposed to have a constrained list of buffers by default. And I haven't noticed that SPC TAB behavior with layouts before. When I tried it just now, SPC TAB was appropriately scoped to the current layout. Y'all know that layout 1 is the special 'catch all' layout, right?

practicalli-johnny15:11:51

I have 11 layouts and using SPC TAB will display the last buffer I had open, regardless of layout it is in. For example, I have a layout called *clojure and another called spacemacs*. If I switch from the clojure layout to the spacemacs layout, I see the spacemacs name in the left corner. If I press SPC TAB then the last buffer will be displayed, which will be from the clojure layout. The layout name doesnt switch (switching the layout to clojure would be an acceptable result of displaying the last buffer from the clojure layer). The projectile specific keybindings all work as expected, its only SPC TAB that doesnt seem to honour layouts.

jeff.terrell15:11:57

Is the buffer that gets switched to legitimately in the current layout, as listed by SPC b b? If not, then maybe this is a difference between spacemacs versions—I'm on master and don't upgrade my deps very often.

practicalli-johnny15:11:55

Ah, I am on develop and maybe this is a feature 🙂 I am still learning how to use layouts, so may have missed something. For now I just minimise my use of SPC TAB and use SPC b b, SPC p f or SPC f f instead. I will check to see if cycling buffers works within the context of a layout.

practicalli-johnny15:11:00

SPC b n and SPC b p work correctly with the project and the layout, and give me more facility than SPC TAB, so will just use the former commands.

theeternalpulse15:11:02

I'll have to check, I use master on my current laptop and develop on my work laptop (backwards huh) and get that behavior on the work desktop. I may have seen it on my home laptop but more often on my work desktop, maybe because I use it (sadly) more every day at work.

ag17:11:24

@theeternalpulse SPC p l lets you open a project in a separate layout

theeternalpulse17:11:27

Yes, but as far as restricting buffers to that layout, I don't know if that functionality is a part of it.

ag17:11:38

it opens things in a layout - so regular buffer restrictions rules get applied there.

ag17:11:23

layouts a bit annoying - sometimes buffers “leak” from one to another.

theeternalpulse17:11:39

Right, sometimes you can't even tell until you go to projectile find file and realize it's another project's buffer

ag17:11:12

maybe this could help?

(with-eval-after-load 'spaceline-config
   (spaceline-define-segment buffer-id
      (if (buffer-file-name)
          (abbreviate-file-name (buffer-file-name))
        (powerline-buffer-id))))
That replaces the filename with the full path in the modeline. That helps me tremendously to not to lose my mind working with multiple projects simultaneously

theeternalpulse23:11:39

let me try that, I have the full path in the title bar just because there's more real-estate for 13in screens.

theeternalpulse23:11:51

but on my work computer I have a massive monitor.