mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-06 04:56:34 +05:30
add rust and golang with debugger
This commit is contained in:
@ -16,6 +16,7 @@ local options = {
|
|||||||
markdown = { prettier },
|
markdown = { prettier },
|
||||||
nix = { "alejandra" },
|
nix = { "alejandra" },
|
||||||
go = { "goimports", "gofumpt" },
|
go = { "goimports", "gofumpt" },
|
||||||
|
rust = { "rust_analyzer" },
|
||||||
},
|
},
|
||||||
|
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
|
16
pkgs/nvchad/nvim/lua/configs/dap.lua
Normal file
16
pkgs/nvchad/nvim/lua/configs/dap.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require("dapui").setup()
|
||||||
|
|
||||||
|
local dap, dapui = require("dap"), require("dapui")
|
||||||
|
|
||||||
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
5
pkgs/nvchad/nvim/lua/configs/go.lua
Normal file
5
pkgs/nvchad/nvim/lua/configs/go.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
require("go").setup({
|
||||||
|
trouble = true,
|
||||||
|
icons = { breakpoint = "", currentpos = "" },
|
||||||
|
gocoverage_sign = "│",
|
||||||
|
})
|
@ -21,6 +21,9 @@ M.treesitter = {
|
|||||||
"gomod",
|
"gomod",
|
||||||
"gowork",
|
"gowork",
|
||||||
"gosum",
|
"gosum",
|
||||||
|
|
||||||
|
-- rust
|
||||||
|
"rust",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,13 +47,9 @@ M.mason = {
|
|||||||
|
|
||||||
-- go
|
-- go
|
||||||
"gopls",
|
"gopls",
|
||||||
"goimports",
|
|
||||||
"gofumpt",
|
-- rust
|
||||||
"gomodifytags",
|
"codelldb",
|
||||||
"impl",
|
|
||||||
"iferr",
|
|
||||||
"staticcheck",
|
|
||||||
"delve",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
pkgs/nvchad/nvim/lua/configs/rust.lua
Normal file
17
pkgs/nvchad/nvim/lua/configs/rust.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
local configs = require("nvchad.configs.lspconfig")
|
||||||
|
local on_attach = configs.on_attach
|
||||||
|
local capabilities = configs.capabilities
|
||||||
|
|
||||||
|
vim.g.rustaceanvim = {
|
||||||
|
server = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
default_settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
@ -36,6 +36,12 @@ map("n", "<leader>td", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME,BUG,TEST,NOTE
|
|||||||
map("n", "<leader>m", toggleTreesj, { desc = "Toggle Treesitter Join" })
|
map("n", "<leader>m", toggleTreesj, { desc = "Toggle Treesitter Join" })
|
||||||
map("n", "<leader>o", "<cmd>Outline<cr>", { desc = "Toggle Outline" })
|
map("n", "<leader>o", "<cmd>Outline<cr>", { desc = "Toggle Outline" })
|
||||||
|
|
||||||
|
-- DAP
|
||||||
|
map("n", "<C-b>", "<cmd>DapToggleBreakpoint<cr>", { desc = "Toggle break point" })
|
||||||
|
map("n", "<C-c>", "<cmd>DapContinue<cr>", { desc = "Continue" })
|
||||||
|
map("n", "<C-x>", "<cmd>DapTerminate<cr>", { desc = "Terminate" })
|
||||||
|
map("n", "<C-o>", "<cmd>DapStepOver<cr>", { desc = "Step over" })
|
||||||
|
|
||||||
if g.neovide then
|
if g.neovide then
|
||||||
local zoomInNeovide = function()
|
local zoomInNeovide = function()
|
||||||
g.neovide_scale_factor = g.neovide_scale_factor + 0.1
|
g.neovide_scale_factor = g.neovide_scale_factor + 0.1
|
||||||
|
@ -95,8 +95,25 @@ local plugins = {
|
|||||||
{
|
{
|
||||||
"folke/neodev.nvim",
|
"folke/neodev.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("neodev").setup({
|
||||||
|
library = {
|
||||||
|
plugins = { "nvim-dap-ui" },
|
||||||
|
types = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
config = function()
|
||||||
|
require("configs.dap")
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Language specific plugins
|
-- Language specific plugins
|
||||||
{
|
{
|
||||||
"pmizio/typescript-tools.nvim",
|
"pmizio/typescript-tools.nvim",
|
||||||
@ -114,5 +131,38 @@ local plugins = {
|
|||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ray-x/go.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
},
|
||||||
|
event = { "CmdlineEnter" },
|
||||||
|
config = function()
|
||||||
|
require("configs.go")
|
||||||
|
end,
|
||||||
|
ft = {
|
||||||
|
"go",
|
||||||
|
"gomod",
|
||||||
|
"gosum",
|
||||||
|
"gowork",
|
||||||
|
"gotmpl",
|
||||||
|
},
|
||||||
|
build = ':lua require("go.install").update_all_sync()',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mrcjkb/rustaceanvim",
|
||||||
|
config = function()
|
||||||
|
require("configs.rust")
|
||||||
|
end,
|
||||||
|
version = "^4",
|
||||||
|
dependencies = {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
},
|
||||||
|
ft = { "rust" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return plugins
|
return plugins
|
||||||
|
Reference in New Issue
Block a user