Just found kakoune from HN thread. So far I like it :)
My one problem is I don't really a fan of pressing alt. This one reason I'm stay away from emacs. Its really hurt my pinky to press alt on a mac.
Are you guys really use alt that much when using kakoune?
If so, is there a way to avoid it?
I think so. Maybe I will use , or <space> to toggle the alternate mode. (not tried yet)
On many keyboards the alt key is pressed with the left thumb.
I'm using xshell, needs a little tweak to get alt working. I would prefer to avoid alt key too.
I agree with OP. Alt is a not an ergonomic key to press on Mac keyboards since Command is directly adjacent to Space.
What key would be better for mac users?
If it's something that the users can fix by remapping or adjusting the terminal behavior it's reasonable to just add a wiki entry for this, otherwise allowing a different key instead of alt for mac users as a compile-time option would be fine IMO.
I'm a big fan of using <space> as <leader> in vim. It would be nice if <space> could be made more useful. Right now, I think the main use is to clear multiple selections?
@opsound that's correct, although space has some other rather important behaviour if prefixed with ALT for example it allows you to skip words if you use N to select next occurrence of current search register.
One ALT usecase that I think could be remedied is ALT+i which is used to select inner quotes or inner block for example. I would like to suggest to change the way s (select) works by making it context aware:
In case a selection is active, make s behave like it does now (creating a subselection using a user provided regex). If no selection is active make it behave like a prefix for selection based commands:
an example would be: s+i+{ to select inner curly bracket.
I haven't seen the implementation of select, so I'm not sure how technically challenging this change would be but it would drastically improve the ergonomics of selecting inner objects which is a movement I'm using quite often.
@alexanderjeurissen There's always an active selection (the "cursor" is actually a selection where the anchor and the cursor coincide). Changing the uniformity of the behavior is not a good idea, it could even break scripts.
Put this in the top of your kakrc to bind ,k to <a-k> for each key k:
%sh{
python -c "
import string
for i in string.printable[:95]:
if i != '\\\\':
lhs = repr(i)
rhs = repr('<A-'+i+'>') if i != '>' else '<a-lt>'
print('map global user -- ' + lhs + ' ' + rhs)
"
}
edit: fixed so it works in python2, too
This came up a few times, we could introduce a prefix that would emulate alt, but I am not sure its a good direction. Ideally, that would be handled by the terminal emulator, or by the display server input configuration.
One real problem is that we do not have any nice key available for that prefix.
Anyone have a good solution to this problem? I tried the , rebinds but they didn't feel great.
I didn't find that the above %sh expansion worked, but when I slightly modified it to
%sh{
python -c "
import string
for i in string.printable[:95]:
if i != '\\\\':
lhs = str(i)
rhs = str('<A-'+i+'>') if i != '>' else '<a-lt>'
print('map global user ' + lhs + ' ' + rhs)
"
}
and then copied its output (each line looks something like map global user 0 <A-0>) from the *debug* buffer into my $HOME/.config/kak/kakrc file, it seemed to have worked (I only really cared about the \
Wondering would the workarounds above work in order to make <space>i work as <a-i>? (same for other characters)
Also on a Mac, where Alt is not the nicest key to press for sure... Any other ideas or workarounds?
On Mac I swap fn <-> control and alt <-> command to get a "sane" keyboard layout.
@mawww if you鈥檙e mainly working on Linux and just using macs once in a while - agreed, I鈥檇 do that too. But swapping cmd can only be done globally at os level, and then you鈥檙e messing up shortcuts in the entire system and all apps. Having spent a decade on a Mac, that messes up your muscle memory real bad and turns everything upside down :/
@aldanor On Mac, Karbiner-Elements can be used to remap keys differently depending on the focused application.
As a data-point, I spent a while on Mac OS X back in the day, so when I switched to Linux, I remapped the Alt and Win keys so that the big, easy-to-press key is Win, and the smaller, harder-to-hit key key is Alt. Alt is a fairly common key in Kakoune, but it usually takes me longer to figure out what key I want to modify with Alt than it does to press it (with my thumb).
Most helpful comment
I'm a big fan of using
<space>as<leader>in vim. It would be nice if<space>could be made more useful. Right now, I think the main use is to clear multiple selections?