Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot understand keybinding #811

Closed
LysanderT opened this issue Jun 20, 2023 · 13 comments
Closed

cannot understand keybinding #811

LysanderT opened this issue Jun 20, 2023 · 13 comments
Labels
duplicate This issue or pull request already exists educational Issues that contain useful content keymap Keymap related issues lsp LSP related issues platform:macos usage User-specific issues

Comments

@LysanderT
Copy link

LysanderT commented Jun 20, 2023

for example, I want to use this hotkey:

toggle floating terminal | N | <A-d>

and i try <space> + letter <A> + letter <d>
but when i press <A>, it always output "E21 不能修改:因为选项‘modifiable‘是关的"

I also guess A represent Alt. Since option is the macOS version of Alt, so I try pressing option. But still not work

@LysanderT
Copy link
Author

And when I want to use ga in

show code action | N | ga

but it just pop method textDocument/codeAction is not supported by any of the servers registered for the current buffer

I installed all the prerequisite packages and i don't know why it cannot work

@fecet
Copy link
Contributor

fecet commented Jun 20, 2023

method textDocument/codeAction is not supported by any of the servers registered for the current buffer means your lsp doesn't support code action, so you can't use ga in this file.

"<A-d>" is alt+d in my setup, you cannot trigger this?

@LysanderT
Copy link
Author

Is lsp a plugin instead of a built-in feature? i'm new to neovim and just install your config. Isn't it enough to just install the prerequisite you required in the wiki and run the shell script to use neovim?

and yes, alt+d cannot work. I check my system hotkey setup to see whether there exists a conflict but find nothing.

@ayamir
Copy link
Owner

ayamir commented Jun 20, 2023

for example, I want to use this hotkey:

toggle floating terminal | N | <A-d>

and i try <space> + letter <A> + letter <d> but when i press <A>, it always output "E21 不能修改:因为选项‘modifiable‘是关的"

I also guess A represent Alt. Since option is the macOS version of Alt, so I try pressing option. But still not work

#344 (comment)

@ayamir
Copy link
Owner

ayamir commented Jun 20, 2023

Is lsp a plugin instead of a built-in feature?

Yes. We have configured some common lsp servers to make it work out of box.

method textDocument/codeAction is not supported by any of the servers registered for the current buffer

Different lsp servers have different levels of support. For example, bashls doesn't support lsp rename and find reference by scope.

@ayamir ayamir added the educational Issues that contain useful content label Jun 20, 2023
@Jint-lzxy Jint-lzxy added duplicate This issue or pull request already exists lsp LSP related issues keymap Keymap related issues usage User-specific issues labels Jun 20, 2023
@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Jun 20, 2023

@LysanderT FYI: intro.txt#key-notation. An editor (strictly speaking, a service provider) semantically parses your code in order to understand them and could provide support for advanced features such as code actions. Most editors exchange "messages" with the server (or the executable installed on your host machine) through Language Server Protocol (LSP), and the capabilities that the server has are closely related to the implementation of its Abstract Syntax Tree (AST). Neovim implements the protocol internally (or builtin), but how it's utilized depends on how the user configures that (e.g., nvim-lspconfig provides quickstart configs for Nvim LSP).

One significant difference from say, VSCode is that the vsix extension you install completes all those configuration behind the scene, but NeoVim does not - in other words, VSCode sacrifices extensibility in exchange for a completely out-of-box experience; NeoVim, on the other hand, focuses more on "grabbing what you need", which provides huge possibilities for custom configs. But it is worth noting that if a server doesn't have a certain capability (such as Goto Definition), then such feature is not supported on any editor that uses this implementation.

@LysanderT
Copy link
Author

LysanderT commented Jun 22, 2023

Different lsp servers have different levels of support. For example, bashls doesn't support lsp rename and find reference by scope.

so i need to replace my lsp server with another one right?

@ayamir
Copy link
Owner

ayamir commented Jun 22, 2023

so i need to replace my lsp server with another one right?

if you can find a better replacement :)

@LysanderT
Copy link
Author

@LysanderT FYI: intro.txt#key-notation. An editor (strictly speaking, a service provider) semantically parses your code in order to understand them and could provide support for advanced features such as code actions. Most editors exchange "messages" with the server (or the executable installed on your host machine) through Language Server Protocol (LSP), and the capabilities that the server has are closely related to the implementation of its Abstract Syntax Tree (AST). Neovim implements the protocol internally (or builtin), but how it's utilized depends on how the user configures that (e.g., nvim-lspconfig provides quickstart configs for Nvim LSP).

thanks for giving the explanation but i'm still confused. is it to say the shell script in the repo won't help configure lsp and i need to configure it by myself?

@LysanderT
Copy link
Author

if you can find a better replacement :)

oh i see. thank you for your kindness :)

@CharlesChiuGit
Copy link
Collaborator

is it to say the shell script in the repo won't help configure lsp and i need to configure it by myself?

normally u should config your lsp in the nvim config, the shell script only downloads the essential package that make things work.

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Jun 23, 2023

is it to say the shell script in the repo won't help configure lsp and i need to configure it by myself?

Ys as @CharlesChiuGit said to use a server, you need the server itself (the executable) and the correct protocol setups so that your server can start to exchange information with Neovim. We setup those servers via nvim-lspconfig.
The base config only configures a small portion of available servers [namely bashls (bash), clangd (C-family), html (HTML), jsonls (JSON), lua_ls (lua), pylsp (python), and gopls (golang)].

Details on how to setup your servers: Wiki: Usage#modify-lsps-linters-and-formatters.

@LysanderT
Copy link
Author

thank you guys, what you said helped me a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists educational Issues that contain useful content keymap Keymap related issues lsp LSP related issues platform:macos usage User-specific issues
Projects
None yet
Development

No branches or pull requests

5 participants