style: fmt

This commit is contained in:
u2515h 2024-01-14 14:35:51 +01:00
parent 67de3e4110
commit 21fdf2d031

105
rust.lua
View File

@ -132,15 +132,12 @@ vim.g.rustaceanvim = {
vim.cmd.RustLsp {'hover', 'actions'}
end, keymap_opts)
vim.keymap.set('n', '<leader>cc',
function()
vim.cmd.RustLsp('openCargo')
end, keymap_opts)
vim.keymap.set('n', '<leader>cr',
function()
function() vim.cmd.RustLsp('openCargo') end,
keymap_opts)
vim.keymap.set('n', '<leader>cr', function()
vim.cmd.RustLsp {'runnables', 'last' --[[ optional ]] }
end, keymap_opts)
vim.keymap.set('n', '<leader>cd',
function()
vim.keymap.set('n', '<leader>cd', function()
vim.cmd.RustLsp {'debuggables', 'last' --[[ optional ]] }
end, keymap_opts)
-- vim.keymap.set("n", "g0", vim.lsp.buf.document_symbol, keymap_opts)
@ -171,8 +168,7 @@ vim.g.rustaceanvim = {
local rt = require("rust-tools")
local deps = require("nvim-deps")
rt.setup(
{
rt.setup({
tools = { -- rust-tools options
-- how to execute terminal commands
@ -220,7 +216,7 @@ rt.setup(
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
highlight = "Comment"
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
@ -229,14 +225,10 @@ rt.setup(
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"}
},
-- Maximal width of the hover window. Nil means no max.
@ -247,7 +239,7 @@ rt.setup(
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
auto_focus = false
},
-- settings for showing the crate graph based on graphviz and the dot
@ -270,62 +262,16 @@ rt.setup(
-- Is used for input validation and autocompletion
-- Last updated: 2021-08-26
enabled_graphviz_backends = {
"bmp",
"cgimage",
"canon",
"dot",
"gv",
"xdot",
"xdot1.2",
"xdot1.4",
"eps",
"exr",
"fig",
"gd",
"gd2",
"gif",
"gtk",
"ico",
"cmap",
"ismap",
"imap",
"cmapx",
"imap_np",
"cmapx_np",
"jpg",
"jpeg",
"jpe",
"jp2",
"json",
"json0",
"dot_json",
"xdot_json",
"pdf",
"pic",
"pct",
"pict",
"plain",
"plain-ext",
"png",
"pov",
"ps",
"ps2",
"psd",
"sgi",
"svg",
"svgz",
"tga",
"tiff",
"tif",
"tk",
"vml",
"vmlz",
"wbmp",
"webp",
"xlib",
"x11",
},
},
"bmp", "cgimage", "canon", "dot", "gv", "xdot", "xdot1.2",
"xdot1.4", "eps", "exr", "fig", "gd", "gd2", "gif", "gtk",
"ico", "cmap", "ismap", "imap", "cmapx", "imap_np", "cmapx_np",
"jpg", "jpeg", "jpe", "jp2", "json", "json0", "dot_json",
"xdot_json", "pdf", "pic", "pct", "pict", "plain", "plain-ext",
"png", "pov", "ps", "ps2", "psd", "sgi", "svg", "svgz", "tga",
"tiff", "tif", "tk", "vml", "vmlz", "wbmp", "webp", "xlib",
"x11"
}
}
},
-- all the opts to send to nvim-lspconfig
@ -335,7 +281,7 @@ rt.setup(
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
cmd = { (deps.rust_analyzer_path .. "/bin/rust-analyzer") },
cmd = {(deps.rust_analyzer_path .. "/bin/rust-analyzer")}
}, -- rust-analyzer options
-- debugging stuff
@ -343,8 +289,7 @@ rt.setup(
adapter = {
type = "executable",
command = deps.lldb_path .. "lldb-vscode",
name = "rt_lldb",
},
},
name = "rt_lldb"
}
)
}
})