Vim, pulling up documentation, and jumping to definitions

This was going to be a question, but I figured it out and it works pretty well.

I set up ALE with rust-analyzer: GitHub - dense-analysis/ale: Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support

And then added this to .vimrc:

augroup filetype_rust                                                                                                                                                        
    au!                                                                                                                                              
    au BufRead,BufNewFile *.rs nnoremap K :ALEHover<CR>                                                                               
    au BufRead,BufNewFile *.rs nnoremap <C-]> :ALEGoToDefinition<CR>                                                                            
augroup END                         

Now I can use K to do a "keyword lookup" and <C-]> to jump to the definition.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.