Closed PMassicotte closed 2 months ago
Also, then I use external_term = "kitty"
I am getting this message:
And opens tmux
even if kitty
is specified.
The goal is to have separate windows, which can be freely positioned, for example, on different monitors (if you have a dual monitor setup), or partially overlapping each other (if you have only one small monitor).
You can't use kitty
within nvim
because kitty
is a graphical application, not a text one.
You can suppress the warning with the following config option:
silent_term = true
Thank you for the explanation!
I am using kitty and I can share my kitty config if you want. Although I am not using an external term but it is possible. I view data tables in a separate tab witthin kitty although I could also view it in a new window if I so desire
I mostly run kitty as a server, and use only one instance of kitty, from this instance, I can then launch new tabs, split the tabs and so on. I have something like this in my sway config
set $term kitty -1 --instance-group "kitty_sock" -o allow_remote_control=yes --listen-on unix:/tmp/kitty_sock
And then have something like this for viewing datatables
vim.g["R_csv_app"] = "kitten @ --to unix:/tmp/kitty_sock launch --type tab sc-im" so I believe that the above can be modified as an external_app to something like this vim.g["R_external_app"] = "kitten @ --to unix:/tmp/kitty_sock launch --type window"
their are many options that can be considered, you can use tab, window, split the current window and so on, you can get more info from
https://sw.kovidgoyal.net/kitty/remote-control/#remote-control-via-a-socket
vim.g["R_external_app"] = "kitten @ --to unix:/tmp/kitty_sock launch --type window"
do you mean external_term
?
vim.g["R_external_app"] = "kitten @ --to unix:/tmp/kitty_sock launch --type window"
do you mean
external_term
?
Yes it should have been vim.g["R_external_term"]
Should I define set $term kitty -1 --instance-group "kitty_sock" -o allow_remote_control=yes --listen-on unix:/tmp/kitty_sock
in my zshrc
file?
The $term is mainly defined in sway I don't know the window manager you are using mine is sway it has similar configs to i3, in gnome, KDE and other none tilled window manager I have no clue, and then subsequently the $term is called when a kitty terminal is to be launched.
for example to launch a new terminal window from sway I simply use
bindsym $mod+Shift+Return exec $term
where $term is the initial defined variable in sway, other window manager may have different methods of achieving this.
Cool this is almost working out. The only thing is that the terminal is opening horizontally instead of vertically on the right as before.
Did you split your kitty terminal, by creating windows within it?, if yes, you may have to change the default r.nvim layout configs by reducing the length at which it changes to horizontal layout.
I have tried
kitten @ --to unix:/tmp/kitty_sock launch --type window --location=after
kitten @ --to unix:/tmp/kitty_sock launch --type window --location=vsplit
kitten @ --to unix:/tmp/kitty_sock launch --type window --location=hsplit
seems kitty has a default layout scheme, below is lifted from the kitty page which can be changed with ctrl+shift+l
https://sw.kovidgoyal.net/kitty/overview/
By default, all layouts are enabled and you can switch between layouts using the [ctrl+shift+l](https:// sw.kovidgoyal.net/ kitty/conf/#shortcut-kitty.Next-layout) key combination. You can also create shortcuts to select particular layouts, and choose which layouts you want to enable, see [Layout management](https://sw.kovidgoyal.net/kitty/conf/#conf-kitty-shortcuts-layout) for examples. The first layout listed in [enabled_layouts](https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.enabled_layouts) becomes the default layout.
To make it permanent you can specify the default layout in your kitty.conf
, because I am not sure if the changes made through ctrl+shift+L
is permanent or not.
the layout scheme and how they can be enabled is found in the link below. https://sw.kovidgoyal.net/kitty/layouts/
It is possible to set the layout you want, however, you have to include the layout you want when you run the initial server/socket
set $term kitty -1 --instance-group "kitty_sock" -o allow_remote_control=yes --listen-on unix:/tmp/kitty_sock -o enable_layout=splits"
or include it in your kitty.conf as layout splits
you may have to kill all active kitty terminals before the new layout can be used.
then you can then use the following to state either horizontal split or vertical split
kitten @ --to unix:/tmp/kitty_sock launch --type window --location hsplit
kitten @ --to unix:/tmp/kitty_sock launch --type window --location vsplit
"You can change [...] get text from one window and send text to another, etc."
This means that it would be possible to run R in an external terminal (kitty
) without Tmux.
yes I have done this before without any kind of problem
Got it working. I was playing with this because I could not use all the vim motion in the built-in terminal (running radian). For example, when I am in normal mode, I can not use ciw
or other derivative. It gives me:
Running radian in kitty allows me to do it.
Reviving this older discussion.
How would you close the terminal (kitty in my case) on :qa
? If I use localleader rq
it closes the terminal. It is not working if I quit my editor window.
I would like to close the terminal automatically when I :qa
. Possible?
There is an option for this: :h auto_quit
.
Excellent! Thank you
Just pasting my config here, so it is findable by others (in case someone else needs it):
In my R.nvim
config I have this:
external_term = "/usr/bin/kitten @ --to unix:/tmp/kitty_sock launch --type window --location=vsplit",
In my i3 config I have this to start kitty and make it listen on a socket:
bindsym $mod+Return exec kitty -1 --instance-group "kitty_sock" -o allow_remote_control=yes --listen-on unix:/tmp/kitty_sock
Quick question.
I am trying to use kitty by doing this in my config:
The thing is this opening an external terminal (i.e., another terminal outside nvim, instead of a new window within nvim). Is this expected behavior? Can I use kitty within neovim?