Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom config file to load custom shortcuts #405

Open
eevmanu opened this issue Jan 4, 2025 · 1 comment
Open

custom config file to load custom shortcuts #405

eevmanu opened this issue Jan 4, 2025 · 1 comment

Comments

@eevmanu
Copy link

eevmanu commented Jan 4, 2025

I was looking into

//TODO: load from config
and I believe loading custom keyboard shortcuts (and its keybindings) is on the roadmap (correct me if i'm wrong please)

I tried to look for a doc or a url where the roadmap is but couldn't find anything (there is a closed issue, kind of related to that #101)


basically since I read this

WIP COSMIC terminal emulator, built using [alacritty\_terminal](https://docs.rs/alacritty_terminal) that is provided by the [alacritty](https://github.com/alacritty/alacritty) project. `cosmic-term` provides bidirectional rendering and ligatures with a custom renderer based on [cosmic-text](https://github.com/pop-os/cosmic-text).

built using alacritty_terminal

I was trying to find something similar to -> alacritty.org/config-alacritty.html:

  • $XDG_CONFIG_HOME/alacritty/alacritty.toml
  • $XDG_CONFIG_HOME/alacritty.toml
  • $HOME/.config/alacritty/alacritty.toml
  • $HOME/.alacritty.toml
  • %APPDATA%\\alacritty\\alacritty.toml

with keyboard section as described here, but couldn't find it


nevertheless, it was useful to find the actual keybindings in cosmic terminal (cosmic-term)

// Standard key bindings
bind!([Ctrl, Shift], Key::Character("A".into()), SelectAll);
bind!([Ctrl, Shift], Key::Character("C".into()), Copy);
bind!([Ctrl], Key::Character("c".into()), CopyOrSigint);
bind!([Ctrl, Shift], Key::Character("F".into()), Find);
bind!([Ctrl, Shift], Key::Character("N".into()), WindowNew);
bind!([Ctrl, Shift], Key::Character("Q".into()), WindowClose);
bind!([Ctrl, Shift], Key::Character("T".into()), TabNew);
bind!([Ctrl, Shift], Key::Character("V".into()), Paste);
bind!([Shift], Key::Named(Named::Insert), PastePrimary);
bind!([Ctrl, Shift], Key::Character("W".into()), TabClose);
bind!([Ctrl], Key::Character(",".into()), Settings);
// Ctrl+Alt+D splits horizontally, Ctrl+Alt+R splits vertically, Ctrl+Shift+X maximizes split
//TODO: Adjust bindings as desired by UX
bind!([Ctrl, Alt], Key::Character("d".into()), PaneSplitHorizontal);
bind!([Ctrl, Alt], Key::Character("r".into()), PaneSplitVertical);
bind!(
[Ctrl, Shift],
Key::Character("X".into()),
PaneToggleMaximized
);
// Ctrl+Tab and Ctrl+Shift+Tab cycle through tabs
// Ctrl+Tab is not a special key for terminals and is free to use
bind!([Ctrl], Key::Named(Named::Tab), TabNext);
bind!([Ctrl, Shift], Key::Named(Named::Tab), TabPrev);
// Ctrl+Shift+# activates tabs by index
bind!([Ctrl, Shift], Key::Character("!".into()), TabActivate0);
bind!([Ctrl, Shift], Key::Character("@".into()), TabActivate1);
bind!([Ctrl, Shift], Key::Character("#".into()), TabActivate2);
bind!([Ctrl, Shift], Key::Character("$".into()), TabActivate3);
bind!([Ctrl, Shift], Key::Character("%".into()), TabActivate4);
bind!([Ctrl, Shift], Key::Character("^".into()), TabActivate5);
bind!([Ctrl, Shift], Key::Character("&".into()), TabActivate6);
bind!([Ctrl, Shift], Key::Character("*".into()), TabActivate7);
bind!([Ctrl, Shift], Key::Character("(".into()), TabActivate8);
// Ctrl+0, Ctrl+-, and Ctrl+= are not special keys for terminals and are free to use
bind!([Ctrl], Key::Character("0".into()), ZoomReset);
bind!([Ctrl], Key::Character("-".into()), ZoomOut);
bind!([Ctrl], Key::Character("=".into()), ZoomIn);
bind!([Ctrl], Key::Character("+".into()), ZoomIn);
// Ctrl+Arrows and Ctrl+HJKL move between splits
bind!([Ctrl, Shift], Key::Named(Named::ArrowLeft), PaneFocusLeft);
bind!([Ctrl, Shift], Key::Character("H".into()), PaneFocusLeft);
bind!([Ctrl, Shift], Key::Named(Named::ArrowDown), PaneFocusDown);
bind!([Ctrl, Shift], Key::Character("J".into()), PaneFocusDown);
bind!([Ctrl, Shift], Key::Named(Named::ArrowUp), PaneFocusUp);
bind!([Ctrl, Shift], Key::Character("K".into()), PaneFocusUp);
bind!([Ctrl, Shift], Key::Named(Named::ArrowRight), PaneFocusRight);
bind!([Ctrl, Shift], Key::Character("L".into()), PaneFocusRight);
// CTRL+Alt+L clears the scrollback.
bind!([Ctrl, Alt], Key::Character("L".into()), ClearScrollback);


p.s.: maybe this could be linked in the root readme (as a suggestion)

@leb-kuchen
Copy link
Contributor

This is a duplicate of #197. Alacritty is just a part of the backend, but the keybindings are handled in Cosmic Terminal. I guess a KEYBINDS.md would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants