# Kitty Splits With Kakoune

**URL:** <https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368>\
**Category:** Help\
**Tags:** kitty\
**Created:** [November 15, 2020, 10:58pm UTC](https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368 "2020-11-15T22:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![The-BigDaddy](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/the-bigdaddy/32/1562_2.png) [@The-BigDaddy](https://discuss.kakoune.com/u/The-BigDaddy)\
**Post date:** [November 15, 2020, 10:58pm UTC](https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368/1 "2020-11-15T22:58:20Z")

</div>

Hello all!

So with Kitty, I have some commands already (that I stole from someone, I can’t remember who lol) for working with Tmux, and I would like to do something similar for Kitty in case I ever use it.

For Tmux I have:

```auto
hook global ModuleLoaded tmux %{
    define-command vsplit -docstring "split tmux vertically with `tmux-terminal-horizontal`" \
    -params .. -command-completion %{
        tmux-terminal-horizontal kak -c %val{session} -e "%arg{@}"
    }

    define-command split -docstring "split tmux horizontally with `tmux-terminal-vertical`" \
    -params .. -command-completion %{
        tmux-terminal-vertical kak -c %val{session} -e "%arg{@}"
    }

    define-command tabnew -docstring "create new tmux window with `tmux-terminal-window`" \
    -params .. -command-completion %{
        tmux-terminal-window kak -c %val{session} -e "%arg{@}"
    }
}

```

And I thought I could do something similar for Kitty:

```auto
hook global ModuleLoaded kitty %{
	define-command ktab -docstring "create a new kitty tab with `kitty-terminal-tab`" \
	-params .. -command-completion %{
		kitty-terminal-tab kak -c %val{session} -e "%arg{@}"
	}
	define-command knew -docstring "create a new kitty terminal with `kitty-terminal`" \
	-params .. -command-completion %{
		kitty-terminal kak -c %val{session} -e "%args{@}"
	}
}

```

However, I would rather make use of a split layout instead of opening a new window or tab. Though I’m not sure if that would be possible.

---

<div class="post-metadata">

**Author:** ![hss](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/hss/32/841_2.png) [@hss](https://discuss.kakoune.com/u/hss)\
**Post date:** [November 20, 2020, 9:27pm UTC](https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368/2 "2020-11-20T21:27:05Z")

</div>

I am not sure if there’s anything implemented to make kitty splits, but you can always consider using a window manager so new kitty windows resize automatically. I am using yabai on macOS and it feels just like working in tmux, if not better.

---

<div class="post-metadata">

**Author:** ![EpocSquadron](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/epocsquadron/32/78_2.png) [@EpocSquadron](https://discuss.kakoune.com/u/EpocSquadron)\
**Post date:** [November 21, 2020, 1:34am UTC](https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368/3 "2020-11-21T01:34:25Z")

</div>

I’d take a look at the kitty [documentation for the remote control protocol](https://sw.kovidgoyal.net/kitty/remote-control.html?highlight=split). It looks like kitty calls panes windows, so if you pass window type of kitty to the new-window command, it should at least create a split, though I don’t see from a cursory glance how to determine which direction without maybe doing a follow-up command to change the layout of the tab.

---

<div class="post-metadata">

**Author:** ![joefiorini](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/joefiorini/32/618_2.png) [@joefiorini](https://discuss.kakoune.com/u/joefiorini)\
**Post date:** [November 22, 2020, 9:14pm UTC](https://discuss.kakoune.com/t/kitty-splits-with-kakoune/1368/4 "2020-11-22T21:14:54Z")

</div>

It’s totally possible, I have a plugin on GitHub that implements a kitty-split function.

> <https://github.com/joefiorini/joeconf-kakoune-plugins/blob/master/plugins/kitty.kak>

Feel free to use it as is or pull whatever you want from it. Good luck!
