3

Everytime I open a project/directory I use the exact same vim pane layout:

 ---------
|    |pane|
|pane|pane|
|    |pane|
 ---------

I would like to be able to open a new vim session with this layout, all of the panes on the right would start in :Explore mode, while the left pane would start in :terminal mode (specific to neovim).

Is there any way to create a vim "layout" for a new session?

hhsnopek
  • 364
  • 3
  • 18

1 Answers1

3

Try something like this:

nvim -c ':vsp|Explore|sp|Explore|sp|Explore'

Placing terminal in front is tricky because it steals focus.

Now I got a idea.

nvim -c ':vsp|Explore|sp|Explore|sp|Explore|wincmd w|te'
Sim
  • 375
  • 2
  • 12
  • This is so close :D - tho the terminal doesn't open up, unless I'm not waiting long enough – hhsnopek Dec 10 '15 at 21:45
  • it's also backwards compared to my example, which is fine – hhsnopek Dec 10 '15 at 21:47
  • You can open terminal last, but if you open it first it steals focus and stops the command chain. – Sim Dec 10 '15 at 21:50
  • after your edit, I attempted again: here's the [outcome](https://cldup.com/Le6HbZL5aI.png). Could you explain the `wincmd w|te`? – hhsnopek Dec 10 '15 at 22:22
  • Lol strange, it look opposite on my machine. Do you use neovim and if so what version? Wincmd w means w(next window command). , te is shortcut for terminal command. – Sim Dec 10 '15 at 22:36
  • I'm running neovim v0.1.0, build type: Release (locally built) – hhsnopek Dec 10 '15 at 22:43
  • Mine is v0.1.1....... Try running this command inside Neovim one by one and see what happens. Later try to compose them to get the wanted output. Try using terminal instead of te...... – Sim Dec 10 '15 at 22:52
  • so the sequence that makes it work (cept is opposite of the layout that I have above) `nvim -c ':vsp|Explore|sp|Explore|sp|Explore|wincmd w|wincmd w|wincmd w|te'` – hhsnopek Dec 10 '15 at 23:04
  • do you know a way to shorten that? ^ – hhsnopek Dec 10 '15 at 23:06
  • The layout is exactly as you draw it on my machine.... funny... maybe is the neovim version.. – Sim Dec 10 '15 at 23:06
  • Try: Ve for vertical split and explore and Hex for horizontal split and explore. But you should map it in your terminal to something more appropriate... – Sim Dec 10 '15 at 23:09
  • Updated to nevim v0.1.1 Here's my cmd to make it work as I illustrated above: `nvim -c ':vsp|wincmd w|Explore|sp|sp|wincmd h|terminal'` - tho i'm not in insert/append mode, but I am focused in the terminal – hhsnopek Dec 10 '15 at 23:20