improvements and font change
This commit is contained in:
21
nvim/.config/nvim/after/ftplugin/rust.lua
Normal file
21
nvim/.config/nvim/after/ftplugin/rust.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
vim.keymap.set("n", "<leader>a", function()
|
||||
vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping
|
||||
-- or vim.lsp.buf.codeAction() if you don't want grouping.
|
||||
end, { silent = true, buffer = bufnr })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||
function()
|
||||
vim.cmd.RustLsp({ "hover", "actions" })
|
||||
end,
|
||||
{ silent = true, buffer = bufnr }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>?", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||
function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end,
|
||||
{ buffer = bufnr }
|
||||
)
|
||||
@@ -37,7 +37,7 @@ return {
|
||||
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
||||
-- See the full "keymap" documentation for information on defining your own keymap.
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
preset = "super-tab",
|
||||
},
|
||||
|
||||
completion = {
|
||||
@@ -223,11 +223,11 @@ return {
|
||||
opts = {
|
||||
servers = {
|
||||
-- brew install rust-analyzer
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
["rust-analyzer"] = {},
|
||||
},
|
||||
},
|
||||
-- rust_analyzer = {
|
||||
-- settings = {
|
||||
-- ["rust-analyzer"] = {},
|
||||
-- },
|
||||
-- },
|
||||
-- brew install bash-language-server
|
||||
bashls = {},
|
||||
-- lua_ls = {
|
||||
@@ -257,4 +257,30 @@ return {
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
config = function()
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
float_win_config = {
|
||||
border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
auto_focus = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user