diff --git a/home/vim-dev/dev.lua b/home/vim-dev/dev.lua index 7139f59..0ff652e 100644 --- a/home/vim-dev/dev.lua +++ b/home/vim-dev/dev.lua @@ -62,6 +62,20 @@ require'lspconfig'.rnix.setup{ require'lspconfig'.rust_analyzer.setup{ on_attach = on_attach, capabilities = capabilities, + commands = { + RustOpenDocs = { + function() + vim.lsp.buf_request(vim.api.nvim_get_current_buf(), 'experimental/externalDocs', vim.lsp.util.make_position_params(), function(err, url) + if err then + error(tostring(err)) + else + vim.fn['netrw#BrowseX'](url, 0) + end + end) + end, + description = 'Open documentation for the symbol under the cursor in default browser', + }, + }, } require'lspconfig'.dhall_lsp_server.setup{ on_attach = on_attach,