All Emacsen welcome.
>have a great idea for keybindings and command interface right before sleep
>write it down
>wake up
>glance at it
>it seems just unnecessary
How do you manage your keybindings? Do you use Evil or Hydra?
All Emacsen welcome.
>have a great idea for keybindings and command interface right before sleep
>write it down
>wake up
>glance at it
>it seems just unnecessary
How do you manage your keybindings? Do you use Evil or Hydra?
Other urls found in this thread:
caiorss.github.io
gnu.org
shop.fsf.org
macs.hw.ac.uk
emacswiki.org
github.com
github.com
github.com
twitter.com
Have a bump
t. vimfag
Sometimes I wonder if I'd have been better off starting with Emacs. Vim taught me a nice editing pattern, the core and the ecosystem work well together, and I don't intend to use it for anything but editing ever (rather use separate programs), but the API kind of gets in your way a lot of the time and isn't nowhere near as nice and consistent as Emacs.
I love having 12 fingers. I am able to use emacs!
Do you remap your meta key? If so, how?
No. But if you want to you'll have to use Xkeybindings
>Have a bump
Thanks user
I sometimes wonder whether I waste time on Emacs.
>open interactive Coq session
>have to manually position windows (frames in Emacs terms)
>'gee, why can't Emacs position them for me?'
>find a package for communicating with i3
>write a command that should do it
>it doesn't work as expected, I think it might be because i3 needs time to process commands
>now just when writing this post get derailed into looking how to make a copy of a buffer (another view into the same file) but still have to write my own function to avoid using shitty Emacs tiling
It's not nearly as bad, you just need a sane keyboard. Most keyboard layouts are retarded with the spacebar designed for 6 fingers. And if don't have a nice keyboard you can rebind them to avoid using any modifiers.
Yes. Pic related, still considering minor changes.
I've read that xmodmap is deprecated and I wrote xkb config instead. I made it kinda the wrong way because I modified files in /etc instead of making a local config and instructing setxkbmap to use precisely these files (which would be much better because default files interfered with my config).
>Yes. Pic related, still considering minor changes.
If you're Japanese, I bet Emacs keys are piece of cake after having to type kanji.
Also, as a Russian, I feel your pain of realizing that shortcuts don't work in some random software because you're not typing with English layout.
Emacs is for heterosexual white males ONLY.
Oh, no, I just bought that keyboard to have more keys under thumbs.
That's a fucking brilliant idea.
Are there any radical new projects for text editors? Seems like everything is just forking previous editors without rethinking fundamentals.
I just discovered that to visit a directory in dired you can type a instead of enter to avoid accumulating buffers and that's great. Shits been bothering me for a year
Kakoune, maybe. There's a bunch of text editors out there.
But Emacs if a Lisp machine, being able to edit text it's kind of byproduct of that.
Shit, thanks user.
Pretty genius
I wonder if Kakoune could have been implemented as an Emacs script? It's neat that they're doing something new, but not taking advantage of the existing plugin support of a popular battle-tested editor is a big minus to overcome.
Xah Lee
? are we fans
I use xah-fly-keys and it's a gamechanger for me. ex-vimfag here
Have you seen xah-lee yt channel pretty good too
Looks pretty cool. I actually had a similar idea for keybinds: one hand for changing view (positioning cursor) and the other for modification (and I follow the it for my window manager). I decided to change view with my left hand and perform actions with the right, opposite to xah-fly-keys. I wanted it so I could scratch my balls with the right hand while browsing through code or whatever I'd be looking at; but considering that I use mouse with the right hand it would make sense to do the opposite.
Using GENERAL which integrate into USE-PACKAGE, which it had a prompt structure to create "menus" like the hydra system has
I wrote my own modal keybinding minor mode. It uses Hydra.
Captain and abbrev-mode are clashing for me. If I use "k" as an abbrev for "the," captain turns it into "K" at the start of the sentence, which doesn't count as an abbrev and just stays as "K."
I can't add "K" as a separate abbrev from "k", and if I type shift+k instead of using captain, it yields "THE."
Any ideas on how to solve this? It's weird that abbrev-mode is case sensitive in one situation but not another, but maybe it's because only one mode can be triggered at a time.
Also, hopefully an easier question. Is there a kate or kakoune style autocomplete for emacs that only suggests previously used words from the same document, instead of drawing from a dictionary?
looks like evil but with no notion of operands or text objects and very unusual bindings
Haven't I seen these questions before? Nobody knows?
evil with ESC and CAPS LOCK swapped, might also swap LCTRL with ALT soon.
also use evil-leader with \ as the leader key, will probably change that to SPC when I need more custom binds, dont have many now as Im relatively new to Emacs.
might wanna put ctrl to alt, alt to super and super to ctrl instead. very comfy, can press both alt and ctrl with thumbs
I only know that company has configurable sources for completion (it's more that company is a general framework for completion and accepts whatever sources you give it)
dabbrev
Yeah, editor editing is a black hole that sucks in many promising programmers. You have the power to make everything work perfectly, but fact is your environment can never be just perfect, especially the more you try to make it do. So you gotta learn to find a good enough balance eventually and roll with a suboptimal and partially unoptimized environment, letting you do something else with your time too.
Spacemacs user, so Evil + Hydra.
>inb4 bloat
I don't give a damn, it's comfy, just werks TM, and I'm productive at my job.
Would have been nice if Emacs wasn't single threaded and the GUI was event based, but eh, what can you do?
I use alt the least of the 3 modifiers though, so I'll probably keep super in the same spot (for window manager stuff).
makes sense actually. fug now you made me question my layout
>Learn lisp
Yes, I'm trying to step by step. Holy fuck last 30 minutes I was wondering how the fuck to open a buffer in a new frame. I wanted to make-frame and somehow make it display the buffer but it turns out you have to display-buffer. Fuck, Emacs names are so unintuitive.
Anyways, thanks, looks like a nice guide.
>what can you do?
Make a new Emacs.
Checked
Making a new Emacs is the only thing you can do at that point but there's so much stuff added throughout the years you'd have to design it from scratch and break backwards compatibility. I don't know how you'll keep all the packages running without compromising on proper design. Although with it being a lisp you could write a converter.
How would you do it? Which language would you use? Will you make buffers and their variables atomic?
How would you separate Emacs variables, mode variables, and buffer local variables? namespaces?
>i3
Found your problem. Use a white man's window manager like xmonad. I don't know why you aren't using it when i3 is laughably inferior. I split some buffers into multiple frames too and I don't need to use any "packages" to communicate with my WM.
I've heard this one is good, html version of the book
gnu.org
What about dwm?
It's a pseudo-minimalist suckless program with a shit "extensiblity" system implemented via patches. It offers no real benefits over xmonad.
how to identify a White Man's post
you can also press 'i' to insert the new directory listing into the same buffer
does wanting this make me gay?
shop.fsf.org
GNUs are cute.
gnu-males
First a note that I don't think I'm gonna try making it any soon because it sounds like quite a lot of work. But here are my thoughts:
>How would you do it?
I think I'd lean towards configure-at-compile-time idea (like xmonad). I'm wondering whether it could fit nicely into Guix package management.
>Which language would you use?
I'd like to try Haskell but the libraries might be lacking. Other candidates would be OCaml or Rust. Guile as extension language but I don't think the core program itself would contain it. I would try to use Guile at compile-time to create hooks and stuff in the right places (so you could do it in Guix configuration). Dynamic interpretation would be a secondary function, possibly just an extension. I would like to create a solid core with just the basic functionality which you could extend.
>Will you make buffers and their variables atomic?
>How would you separate Emacs variables, mode variables, and buffer local variables? namespaces?
I'm not sure, I haven't spent nearly enough time considering it. What do you mean by atomic buffers and variables? You didn't mention parallelism so I'm not sure what you mean.
I don't think I want to provide the level of flexibility Emacs provides. Emacs variables would be just global constants. A buffer would be represented by a structure containing functions corresponding to each active mode (functions like transforming actual buffer data into the text to be displayed) along with their buffer-local data. I'm not sure if mode variables are that useful but if needed, each mode would simply have associated data. Functions corresponding to the modes would accept current buffer, buffer-local data and mode data. I don't know if this would be flexible enough or whether it could work well with multi-threading which I would definitely want.
I tried xmonad, comfy enough but I prefer i3's idea of tiling. If you don't communicate with your WM, that means you're doing a different thing. Can you use any xmonad functionality in Emacs Lisp code?
i just don't use a fucking tiling wm. gnome/kde saves me a ton of configuration time, looks and works good by default, and i just use workspaces/multiple screens instead of trying to organize as much shit as possible onto one screen. i usually fullscreen my terminals anyway, and losing 200mb ram to my DE isn't a problem when i rarely max out my ram.
I used Evil at first after switching from Vim, but after realizing modeless editing is better I use slightly customized bindings (just swapped the default ones to move with Ctrl+WASD instead). It's very comfortable once you remap your modifiers in comfortable positions (no, mapping Ctrl to Caps Lock is a suboptimal solution).
Xmonad + Emacs is a great combo. I use it too.
Many people forget that the same Emacs instance can spawn multiple external windows and let your wm arrange them.
It absolutely annihilates tmux and the like.
yep, he's pretty cool
>but I prefer i3's idea of tiling
Too bad it's garbage for people who for some odd reason prefer doing manual labor over having things automatically laid out as they specify.
>Can you use any xmonad functionality in Emacs Lisp code?
What are you trying to do specifically? I don't see why Emacs would ever need to know what WM you're running. You don't need to call any xmonad functionality if your WM is smart enough to let you customize how windows appear on some chosen workspace, and I have two of them dedicated to various emacs things.
>It's very comfortable once you remap your modifiers in comfortable positions
I'm looking into trying the emacs editing model too, what did you map your modifier keys to?
>Too bad it's garbage for people who for some odd reason prefer doing manual labor over having things automatically laid out as they specify.
I'm gonna keep liking what I like. To elaborate a bit, I think that i3 makes a better base for a better WM. i3 is about explicit structure, not about manual labor. Could you take workspace 2 and workspace 3 and put them next to each other on one display? Automatic layouts also fit into i3's model but i3 devs simply don't care about that. I find it unfortunate that they don't realize how good i3 could be. In the meantime one could try to write awkward IPC scripts like I did. Basically I keep using i3 because it has tabs and I hope to make it into a good WM one day.
>You don't need
You actually need very few things.
>What are you trying to do specifically?
I want to create a specific layout when entering interactive proof session. I don't dedicate workspaces for anything. It unarguably requires communication between Emacs and WM.
I would certainly want multi-threading and parallelism, mainly because I don't want any operation to block the entire editor or slow it down if something shits the bed.
By atomicity I mean that any thread can read the object in memory with minimal indirection, modify it with zero overhead, and set it with Compare And Swap (CAS). I'd also want transactional operations.
That way you could thread two function and there's no way they'd step on each others' toes.
In terms of constructs, syntax and idioms I find Clojure very pleasant in this regard and if it had a compiled low-level version I would have liked to take a crack at it.
Not sure how much types will be helpful, especially Haskell's. Probably was done better by other langs.
maybe I mistunderstand, but how does this annihilate tmux? Can emacs do this in the terminal ?
best package for email?
>Basically I keep using i3 because it has tabs
This is very reminiscent of vimtards who like vim because other autistic editors (or WMs in this case) allegedly don't have tabs. It's amusing how inextensible software written in C seems to have defenders with very similar mindsets.
>Could you take workspace 2 and workspace 3 and put them next to each other on one display?
A workspace and a display are just Haskell data structures, and your config is just a Haskell source file. So if it doesn't already exist (it probably does), you could write it yourself instead of waiting for the devs to make inherently crippled software into what it can never be.
>I want to create a specific layout when entering interactive proof session.
If I understand correctly, this requires very minimal communication from the emacs side of things. Just set some global state when you enter/exit the session and write some elisp to detach the buffers you need into frames managed by your WM. You can then write a function in your xmonad config to change your layout when it sees the state change.
There is probably also a saner way of doing this by just adopting xmonad's superior workflow.
mu4e. You need to install 'mu' from your system package manager and set up mbsync, here's a nice tutorial I used myself.
macs.hw.ac.uk
Why would you run emacs in a terminal? tmux in a graphical environment is obsoleted by emacs and any tiling window manager.
(global-set-key (kbd "M-j") 'insert-parentheses)
(global-set-key (kbd "M-k") (lambda ()
(interactive)
(let ((current-pos (point))
(start (make-marker)))
(set-marker start (point))
(while (or (eq (following-char) ?\s)
(eq (following-char) ?\n))
(forward-char 1))
(if (eq (following-char) ?\))
(progn
;; kill everything up to here
(kill-region start (point))
(forward-char))
(progn
;; just go back and put a darn ")" there
(goto-char current-pos)
(insert ")"))))))
I made shortcuts to insert parentheses and automatically close them, even if the matching one is way later after some whitespace. But I feel this is way too complicated and there is a much easier way. Any ideas?
>i3 is about explicit structure
Sounds like a buzzword if I've ever heard one. What is "not explicit" in xmonad's structure?
I use Emacs heavily and program in various Lisps a lot so I made the following modification to xmodmap. This changes the keyboard layout to more resemble the Space Cadet keyboard and similar Lisp Machine keyboards, which actually used a sane layout for Emacs usage. Save the following to any filename and run xmodmap against it to apply the changes.
! [ = (
! ] = )
! ( = [
! ) = ]
keycode 0x12 = 9 bracketleft
keycode 0x13 = 0 bracketright
keycode 0x22 = parenleft braceleft
keycode 0x23 = parenright braceright
! Ctrl = Win/Super
! Win/Super = Alt
! Alt = Ctrl
remove mod1 = Alt_L
remove mod4 = Super_L
remove control = Control_L
add mod1 = Super_L
add control = Alt_L
add mod4 = Control_L
I keep my xmodmap file in $HOME/.config/xmodmap and then run xmodmap $HOME/.config/xmodmap in $HOME/.xsession
That's definitely overkill. It's still a nice exercise in elisp though.
emacswiki.org
Also check out electric-pair-mode and/or paredit for parens related functionality if you don't mind pressing the parens keys themselves.
>I use Emacs heavily and program in various Lisps
cringe
The problem here is that I use autopair. Inserting a regular ) will just skip over the closing paren if it's next to it, but it won't automagically "fix" it like slimv would. The alternative mentioned in your link is move-past-close-and-reindent which I absolutely do NOT want.
Why aren't you using Lispy?
This. I can't imagine writing Lisp without Lispy or something equivalent now that I've discovered it.
Because I didn't know it exists. Will try, thanks!
>cringe
cringe
(cringe)
Thanks user, I'll look into your bindings. The parens swap seems really nice.
Yeah, I'm not gonna install like five packages and worry about a bunch of additional key bindings just to have parens close automatically. I'd rather just stick to using my code.
(((cringe)))
>just to have parens close automatically
It does far more than that. It prevents your parens from ever becoming unbalanced and lets you move around your code and reformat it really quickly. It basically takes full advantage of the nature of Lisp code being just a bunch of lists.
Stubbornly preserving your independence and privacy even if it means sacrificing commercialized comfort is like, super gay and stuff
I don't want forced paren matching and don't need all those other features as evil already provides shortcuts for them. I just want to close parentheses.
What's the point of altgr?
>evil already provides shortcuts for them
There's lispyville if you use evil. Evil doesn't provide shortcuts for moving your parens around effectively and it still breaks parens consistency when deleting or copying chunks of code.
That's all fun, but I don't care. I want to close parens, also not in Lisp code.
Why would I need a tiling wm with emacs if I can just split the frame into different windows and move between them?
>Why would I need a tiling wm with emacs
You don't "need" it, but some people prefer that for certain cases. I personally use both xmonad and exwm on different machines.
Oh yeah, that wasn't very precise expression. What I mean it that in i3 everything you see is strictly modeled with a tree of containers. In xmonad you just have a list of windows and information "this bunch of windows is tiled with this layout", a more abstract approach. The correspondence between the data structure and the layout you see on the screen isn't that obvious. When you have only vertical/horizontal split, xmonad seems somewhat better because it's simply easier to just press one button and a couple layouts can easily cover 99% use cases. But when you add tabs (and option to fullscreen any container, not just windows), this tree structure becomes very appealing because then you can group activities. Just look how many programs have tabs that can't work with each other. Why not move the tabs one level up to the window manager so you could have tabs for any program and even mix them together? You also wouldn't need a fucking pdf reader in your browser, fucking piece of bloat. However, in the end I have to keep the tree fairly simple because of serious flaws in i3.
Special characters in some languages, basically another modifier on the keyboard.
>This is very reminiscent of vimtards who like vim because other autistic editors (or WMs in this case) allegedly don't have tabs.
So do other window managers have tabs?
>So if it doesn't already exist (it probably does), you could write it yourself
No, it doesn't and you can't really modify that part of xmonad without modifying essential code which would break many existing extensions. Go eat a dick.
>instead of waiting for the devs to make inherently crippled software into what it can never be
I'm not even hoping for that, I'm exploring 20KLOCs and wondering whether I can make it actually good
>You can then write a function in your xmonad config to change your layout when it sees the state change.
Where do you keep that state? I just don't know of any IPC for xmonad.
I prefer Emacs with a tiling WM because Emacs sucks at being a window manager.
I swapped left Ctrl and left Alt, so that I can hit both Ctrl and Alt with my thumbs.
What's your favourite theme?
Badger
16-colours
I use vanilla Emacs with my keybindings: C-c o, C-c O, C-c y, C-c Y for Vim's o, O, Y, Y p respectively.
Fair enough
How do I use Ido to do auto complete
I don't use it as a WM, I'm using stock KDE but when I'm in Emacs it's in borderless full screen.
I prefer focusing on one thing at a time so I rarely need to tile anything anyway.
spacemacs-light
The only adjustment I've made is rebound M-h to C-x C-h, and I'm using it for backward-kill-word. Emacs has pretty much perfect keybindings,but I've been missing one for unwrapping recently, and I'm wondering whether I should just implement my own command for it, since most implementations reinvent the wheel when it comes to sexp manipulation.