4 ms·
> It is fair to note that end has a lot more characters than } but I do think it comes across as more human. It's also easier to type on non-QWERTY keyboard la
by amadeuspagel 3y ago
> It is fair to note that end has a lot more characters than } but I do think it comes across as more human.
It's also easier to type on non-QWERTY keyboard layouts (including the portuguese layout), where you need the Alt Gr key (the right alt key) to type curly braces.
- lawik 3y agoHad not thought about it. But I and my nordic keyboards agree.
- sph 3y agoSpeaking of, anyone know of a simple Emacs mode to automatically add "end" when I write "do" in elixir-mode? Ideally something language-agnostic. I know smartparens can do that, but I want something smaller and more focused. I'd love if electric-pair-mode could do pairing with words, not only brackets.
- giraffe_lady 3y agoThis says smartparens can do it but I don't know how. But there's a snippet for hacking it out of ruby completion that works for me. https://github.com/elixir-editors/emacs-elixir#pairing https://github.com/elixir-editors/emacs-elixir#pairing
- alwaysbeconsing 3y agoA alternative that is builtin might be an skeletons (and abbrev) or tempo? Also see the newer implementation, tempel: https://github.com/minad/tempel https://github.com/minad/tempel
- jagaerglad 3y agoI use Ctrl+Alt as a substitute for Alt Gr making it feel as natural as typing any other shift-bound special character on the right side of keyboard It's standard on windows but I have to resort to a hacky solution to make it work on linux unfortunately (still don't have a nice way of doing it cleanly so suggestions are welcome, currently it's an autokey script where e.g. ctrl+alt+0 prints '}', which isn't elegant, doesn't work in wayland etc)
- limecat 3y agoI use autokey not as a hotkey but as text expansion. If I type "..c" then this is expanded into "{}" with the cursor inside the braces. And to surround text with "{}" I use ",,c", hence "whatever,,c" becomes "{whatever}". I have similar text expansion for other symbols that require AltGr, square braces are ..s and ,,s for instance. On Windows Autohotkey can do the same, just the scripting language is different. The Autokey text for curly braces is simply "{}<left>" and for surrounding with curly braces the script is: import time keyboard.send_keys("<shift>+<ctrl>+<left>") time.sleep(0.25) sample = clipboard.get_selection() keyboard.send_key("<delete>") keyboard.send_keys("{%s}" % sample) Maybe it helps you.
- jagaerglad 3y agoThat is actually very smart and helpful, thanks! :) My only gripe with autokey is that it's the only thing holding me back from wayland. Hawck is supposed to work with wayland but I never got it to work, was a while ago I tried though https://github.com/snyball/Hawck https://github.com/snyball/Hawck
- limecat 3y agoI don't use Wayland, but it seems xdg-desktop-portal since 1.16.0 has a 'Global Shortcuts portal'. Perhaps check it out. https://github.com/flatpak/xdg-desktop-portal https://github.com/flatpak/xdg-desktop-portal
- lkuty 3y agoThat's the sort of reason that made me switch to US Qwerty a couple of years ago and as a programmer I should have done that from the very beginning instead of staying on Azerty BE. The shortcuts of most programs have been thought for Qwerty (thinking about you Vim). It made my developer's life much easier. I am on macOS and I had to install Karabiner and goku (https://github.com/yqrashawn/GokuRakuJoudo https://github.com/yqrashawn/GokuRakuJoudo) to get the french accented letters. Now right-alt+e gives me é, right-shift-alt+e gives me è, etc. BTW, I love Elixir.
- matrss 3y agoAre you aware of the "EurKEY" layout (https://eurkey.steffen.bruentjen.eu https://eurkey.steffen.bruentjen.eu)? As a european, I think a US ansi keyboard with eurkey is the best option available, if you want to stick with something "standard". On linux it should even be available by default, although Gnome hides it behind some gsettings option. For macos there seems to be some installation involved: https://github.com/jonasdiemer/EurKEY-Mac https://github.com/jonasdiemer/EurKEY-Mac.
- lkuty 3y agoIt looks very interesting. Might give it a try even if I am now used to my key combinations to get the accented letters.
- az09mugen 3y agoA friend of mine switched on mac os recently and as a french dude had trouble making accents. Do you know you can keep the vowel pressed on the keyboard to have accent suggestions like on mobile ? And mac native of course. It changed his way of writing. Hope it helps you.
- el_oni 3y agothe lsp (or maybe it's my editor) will also automatically do a closing `end` for every `do` similar to autobraces where typing an open `{` will automatically add a closing `}` it means that most of the time i don't think about `end` unless it's an anonymous function `fn x -> x end`, which is where the only place i ever forget to add `end`
- paradox460 3y agoProbably no small part to Jose Valim speaking Portuguese