Home > Blockchain >  Is there a way to get help for some C functions inside of vim/Neovim?
Is there a way to get help for some C functions inside of vim/Neovim?

Time:07-31

This question may be a little off topic. But I was wondering if there was a way for me to look at the descriptions of C functions using vim or neovim. Is it possible to look at their documentations by doing something like :help? This would really be helpful since I wouldn't need to lookup to my browser everytime.

I am unclear about these things:

  • Can :help be my friend here ?
  • Can I use LSPs to do something like this ?
  • I am using latest Neovim inside Ubunutu 20.04 in WSL. Is this helpful somehow ?

CodePudding user response:

Well yes, you can get the description of C functions by using a LSP (language server plugin)! Here is an image of me using information example

You'd "just" need to install the LSP and start it. I don't know how familiar you're with neovim, but just in case if you don't know how to install a plugin or to be more specifique: If you don't know how you can install a LSP server, then you can do the following:

  1. There're plenty videos how to set up a LSP-Server for your language. Here's an example.
  2. If you don't want to set up on your own, you can pick up one of the preconfigured neovim setups (some of my friends are recommending lunarvim)

But yeah, that's it. If you have any further questions feel free to ask them in the comments.

Happy vimming c(^-^)c

CodePudding user response:

By pressing K, the keyword under the cursor is looked up using a configured keyword lookup program, the default being man. This works pretty much out of the box for the C standard library.

For C , you might want to look at something like cppman.

  • Related