xircon
July 28, 2020, 2:47pm
1
I use ctrl+s & ctrl+q to save and quit in vim (muscle memory!!).
Cannot get it to work, same configs as used in Manjaro.
Tried stty -ixon and stty -ixoff but baffled, can’t get it to work. Any ideas?
I don’t use vim, but I found this and maybe it can help:
Press the Escape key. The cursor will go to the bottom (the command area)
Press the key sequence: q
Or you can also press: q! to exit the editor without saving changes
Press the Enter key
First we press Esc to place ourselves in the lower buffer in normal mode, and:
: q → exits the file, if we have no changes without saving it just exits.
: q! → exits the file discarding unsaved changes.
: w → saves changes to the file, but does not exit Vim to continue editing the file.
: wq → save changes and exit Vim.
: x → same as the previous one.
Maybe I am misunderstanding something, or maybe @xircon wasn’t clear in his post, but I think the issue is that he has set in his .vimrc
to use Ctrl +S to save and Ctrl +Q to quit, but these keyboard shortcuts are in conflict with Alacritty terminal emulator which uses them for pausing and resuming flow.
I’ve never used Alacritty so I don’t know how to configure it.
2 Likes
xircon
July 28, 2020, 4:25pm
4
What @Kresimir said, I use ctrl+s to save (or course :w works) and ctrl+q (ditto :q). See:
I wanted to have a single key stroke that would save existing files, or call the file browser. Here's a key map for Ctrl-S to accomplish that (place in vimrc file): " If the current buffer has never been saved, it will have no name, " call the file...
This worked fine on Manjaro (I am the guy that says bububut…)
" Ctrl+S to save:
:nmap <c-s> :w<CR>
:nmap <c-q> <Esc>:qa<CR>
:imap <c-q> <Esc>:qa<CR>
:nmap <c-f> / <---------- Works!!!!!!
:imap <c-s> <Esc>:w<CR>a
What actually happens is ctrl+s freezes, ctrl+q reverts = flow control
Have you tried the other way around?
I mean to change / get rid of Alacritty flow control shortcuts somewhere in it’s settings (maybe you don’t even use this functionality like me)
I’d start by looking at Alacritty config file on Manjaro, since that’s not a problem there.
I haven’t yet felt the need to use flow control in a terminal emulator.
xircon
July 28, 2020, 4:31pm
7
Yes, set stty -ixon, which should turn it off, it doesn’t.
If I use Konsole and turn off in settings it works. Alacritty is just a plain yaml and copied straight from Manjaro where it worked - there should be no differences.
2 Likes
There must be some reason why Alacritty is ignoring that config file. Is is the same version of Alacritty?
According to Arch wiki:
Alacritty searches for a configuration file at the following places in this order:
$XDG_CONFIG_HOME/alacritty/alacritty.yml
$XDG_CONFIG_HOME/alacritty.yml
$HOME/.config/alacritty/alacritty.yml
$HOME/.alacritty.yml
Copy the example configuration file at /usr/share/doc/alacritty/example/alacritty.yml
to one of those places and uncomment the settings you want to change. Most settings take effect as soon as you save the file.
Perhaps one config file is overriding another one.
opened 04:10PM - 19 Jul 20 UTC
closed 02:40PM - 07 Oct 20 UTC
B - bug
S - winit/glutin
A - deps
DS - Wayland
S - keybindings
I've run into issues trying to replicate one feature from my urxvt setup:
> Exi… ting Vi mode using a Caps Lock (which is mapped to Escape in my WM).
I have remapped Caps Lock to Escape in my Sway configuration as follows:
```
input type:keyboard {
repeat_delay 170
repeat_rate 50
xkb_layout se
xkb_variant nodeadkeys
xkb_options caps:escape
}
```
Ideally, Alacritty would interpret me pressing Caps Lock as Escape, but that does not seem to be the case. See the following logs for when I press Escape and Caps Lock respectively:
```
[2020-07-19 18:02:49.128491248] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 1, state: Pressed, virtual_keycode: Some(Escape), modifiers: (empty) }, is_synthetic: false } }
[2020-07-19 18:02:49.128552545] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: ReceivedCharacter('\u{1b}') }
[2020-07-19 18:02:49.128583303] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.128605774] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.132201788] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19725, tv_nsec: 833281035 }, requested_resume: None })
[2020-07-19 18:02:49.132278168] [INFO] glutin event: UserEvent(TerminalEvent(MouseCursorDirty))
[2020-07-19 18:02:49.132304845] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.132326329] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.132354807] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19725, tv_nsec: 833434613 }, requested_resume: None })
[2020-07-19 18:02:49.132383836] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.132404486] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.133327616] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19725, tv_nsec: 834406656 }, requested_resume: None })
[2020-07-19 18:02:49.133434858] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.133464832] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.199927517] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19725, tv_nsec: 901006707 }, requested_resume: None })
[2020-07-19 18:02:49.199996190] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 1, state: Released, virtual_keycode: Some(Escape), modifiers: (empty) }, is_synthetic: false } }
```
```
[2020-07-19 18:02:49.759940225] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 58, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
[2020-07-19 18:02:49.759952949] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: ReceivedCharacter('\u{1b}') }
[2020-07-19 18:02:49.759969059] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.759974669] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.760806763] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19726, tv_nsec: 461886603 }, requested_resume: None })
[2020-07-19 18:02:49.760821291] [INFO] glutin event: UserEvent(TerminalEvent(MouseCursorDirty))
[2020-07-19 18:02:49.760826908] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.760831148] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.760836742] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19726, tv_nsec: 461916660 }, requested_resume: None })
[2020-07-19 18:02:49.760842430] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.760846586] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.761155090] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19726, tv_nsec: 462234813 }, requested_resume: None })
[2020-07-19 18:02:49.761193836] [INFO] glutin event: MainEventsCleared
[2020-07-19 18:02:49.761199867] [INFO] glutin event: RedrawEventsCleared
[2020-07-19 18:02:49.831873727] [INFO] glutin event: NewEvents(WaitCancelled { start: Instant { tv_sec: 19726, tv_nsec: 532953034 }, requested_resume: None })
[2020-07-19 18:02:49.831919488] [INFO] glutin event: WindowEvent { window_id: WindowId(Wayland(WindowId(94529468199840))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 58, state: Released, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
```
The behavior is the same for both my laptop keyboard and an external USB keyboard.
A less ideal work-around would be to map Caps Lock to `ToggleViMode` directly, but I can't seem to be able to map Caps Lock at all.
Apart from this issue, Alacritty is working great for me so thanks all the good work done!
### System
OS: Linux
Version: alacritty 0.5.0-dev (f0cb1e7c)
Linux/BSD: Wayland, Sway
### Logs
Crashes: N/A
Font/Terminal size: N/A
Keyboard and bindings: See above.
There’s that also, seems there are problems with remapping recently
xircon
July 28, 2020, 4:36pm
10
Nope it is definitely readiing ~/.config/alacritty, because if I change the transparency in that file, it changes it real time in alacritty.
I have been using alacritty for years as well (at least 5!!!).
xircon
July 28, 2020, 4:40pm
11
This works!!!
tmux new-session -s test "stty -ixon; vim"
Going to try to set it in an env.sh file, BRB.
1 Like
xircon
July 28, 2020, 6:03pm
12
The solution:
# .zprofile
stty -ixon
Read before .zshrc and works. Thats 3-4 hours of my life I wont get back
1 Like
btw, sine you’re long time user - can you share some benefits of using Alacritty?
xircon
July 28, 2020, 7:03pm
14
Quick, light and I can change to transparency on the fly with two scripts wot I wrote. Just got used to it when using bspwm, other terminals are just as good.
1 Like