reddit / emacs
How do I use these lsp-mode key bindings? (S-l) ???
hangingpawns · 2022-02-08 08:32
What is this S-l keybinding? After googling for 20 minutes, I keep seeing "it's the super key!" but there's no indication on what the superkey is or how I find out what it is.
​
Additionally, I put in my .emacs this snipped:
(setq lsp-keymap-prefix "C-c C-l")
​
but if I do C-c C-l g g on a symbol, it types "g g" instead of finding the definition.
What gives?
holgerschurig · 2022-02-08 11:44
Try the windows key.
hangingpawns · 2022-02-08 14:14
That just brings up the start menu.
I am ssh'd into a server via WSL. Emacs is running on the remote server.
Bombastry · 2022-02-08 14:28
Apologies for the non-answer, but you may have a better experience using Emacs on your machine and then using Tramp to connect to the server.
hangingpawns · 2022-02-08 14:34
Nah, I like running various emacs daemons on the server,.each containing a different project. I also use all my shells within emacs as it involves running a lot of experiments.
ForkInBrain · 2022-02-08 15:08
“Super” key bindings basically doesn’t work over the terminal without Herculean efforts to configure both your terminal program and Emacs to basically send them over the wire as escape sequences you invent. You’ll have to bind any such bindings to something else, unfortunately. The only things that reliably work over the terminal are control and meta (alt) bindings. Even then, not all of them, especially if the shift modifier is involved.
Bombastry · 2022-02-08 17:28
Fair enough. Also, you should be able to change the lsp prefix to `C-c C-l` with the command `(define-key lsp-mode-map (kbd "C-c C-l") lsp-command-map)`.
hangingpawns · 2022-02-08 17:35
>(define-key lsp-mode-map (kbd "C-c C-l") lsp-command-map)
I've tried that numerous times, but I get the following error:
​
Symbol's value as variable is void: lsp-mode-map
Bombastry · 2022-02-08 17:54
Have you loaded in `lsp-mode` yet (e.g. using `require` or `use-package`)? If not, then the variable `lsp-mode-map` doesn't exist yet which means you can't bind any keys to it.
If you have loaded `lsp-mode` in when you get this error, I would check what version of `lsp-mode` you have installed (although from a quick look at its Git history, it seems like that variable has been around for awhile).
hangingpawns · 2022-02-08 18:07
Yes. I've tried it before and after.
Bombastry · 2022-02-08 18:43
That's weird. It works when I run the following command after ignoring my init file (`emacs -Q`).
(progn
(package-initialize)
(require 'lsp-mode)
(define-key lsp-mode-map (kbd "C-c C-l") lsp-command-map)
(switch-to-buffer "lsp-check")
(python-mode)
(lsp-mode))
Unfortunately, I don't know if there's much more help I can give you. I would check your `lsp-mode.el` file to make sure that `lsp-mode-map` exists in it. But that variable should exist if the command `lsp-mode` is available to be called.
hangingpawns · 2022-02-08 19:42
>(progn
(package-initialize)
(require 'lsp-mode)
(define-key lsp-mode-map (kbd "C-c C-l") lsp-command-map)
(switch-to-buffer "lsp-check")
(python-mode)
(lsp-mode))
This works. Thanks!
oantolin · 2022-02-11 03:19
Capital S actually means shift, the super key is lowercase s. As for what the super key is: on keyboards with a Windows key, that's the super key, on other keyboards who knows.
holgerschurig · 2022-02-14 07:26
Oh, I never expect someone to use Emacs in tty mode. My bad.
Emacs via GUI is so much better.
hangingpawns · 2022-02-14 15:10
I think most people use tty mode.
holgerschurig · 2022-02-14 15:18
Really?
When I look at the various video channels on Youtube, I see no one using Emacs from a terminal window.
You have much worse theme support. No real unicode, e.g. most of C-x 8 RET would be pointless. Some org-mode prettifier modules won't work, ligatures won't work, latex blocks in org-mode cannot be rendered to real math, eww with non-fixed-size font wouldn't work. pdf-tools couldn't be used...
The list of drawbacks goes on and on.
Can you list a few benefits, as a counterweight?
hangingpawns · 2022-02-14 15:24
Okay, simple question for you: How do you get emacs gui working through WSL?
Most emacs users aren't on YouTube. Look at the official emacs mail list and see what people use. Almost none of them use emacs via gui.
holgerschurig · 2022-02-14 16:02
Most Emacs users aren't on WSL, but on real Linux. Or on MacOSX.
> Almost none of them use emacs via gui.
Doubtful. Also, how would you see what people like Ingebringtson use from a mailing list post?
In any case, let us agree to disagree. It's pointless to argue with you that way. The Emacs for text-mode is really behind the GUI one, accept that. And therefore you won't be able to use the Super key. Just define your own keybinding then, e.g. to something starting with C-c SOMETHING.
hangingpawns · 2022-02-14 16:13
I don't know why you are arguing that GUI is better than terminal. I never argued otherwise. I agree a full GUI is sexier and more functional in a lot of ways, but being at a national lab, our interactions with the supercomputers are fairly restricted. They don't let us run full VMs on our laptops, for example, but they do let us run a modified WSL that the Dept of Energy and Microsoft worked on together (enhanced security).
holgerschurig · 2022-02-15 08:11
> that GUI is better than terminal
Because you had the idea that most people run Emacs in TTY: "I think most people use tty mode."
This is so insane and so clueless, that I thought I needed to point out some benefits to you. Emacs runs since ...
* 20+ years under X11 (even before it run on Linux)
* 15+ years on MacOSX
* 15+ years graphically under Windows
* since now with PGTK as a native Wayland application
And with that you say "I think most people use tty mode". From my point of view, you argue without any background knowledge.
So, if for some circumstances you are made to operate in a crippled environment ... (because WSL just emulates Linux, but it really isn't the real thing) ... then have my condolences. But assuming that your specific situation applies to the whole world is a bit ... over-to-top.
BTW, there seems to be X11 servers available for WSL2, maybe this can help you.
hangingpawns · 2022-02-15 14:16
Ask on the mailing list :-)
Most people use emacs in a terminal. Go ahead and ask.
Listen, you are an uneducated IT guy. I get it, you make like 75k/yr and spend your time taking IT certifications, and you're angry about it whenever you see someone doing something that you can't do. Given your poor reading comprehension, it's clear you don't do anything interesting.
holgerschurig · 2022-02-23 10:46
> Ask on the mailing list :-)
So, did you ask? Can you point me to a link of the mailing list archive?
I mean, you just didn't bring ANY evidence.
Now, I'm not aware of any post on the mailing list, but on Reddit, the vast majority isn't sadomasochistic and naturally uses Emacs in GUI: https://www.reddit.com/r/emacs/comments/7bh79w/do_you_use_emacs_as_a_gui_window_or_in_the/ --- and when I see blog posts woth screenshots, it's always GUI. When I see Emacs videos, it's always GUI. When I see screenshots in GIT projects, e.g. of helm, ivy, selectrum, vertico, company ... doesn't really matter ... i see **always** GUI screenshots.
And to your ...
* you are an uneducated IT guy
* you make like 75k/yr
* your poor reading comprehension
* you're angry
* you don't do anything interesting
... I see that you are now jumping to personal attacks and unfounded conclusions (how would you know how much I earn? And you didn't even specify a currently, 75k Turkish Lira is something entirely different than 75k Swiss Franks).
... I wonder who really is now angy :-)
I think --- at least in this thread --- if you're confronted with a meaning different to yours you go into "but i say, you must accept" mode? Bring at least arguments, or even better bring facts.
You should work on your self-esteem. If you bring it up, you don't need to talk people down (like in the 5 bullet points from above) to get any value.