Update nvim
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
cmd = { "ols" },
|
||||||
|
filetypes = { "odin" },
|
||||||
|
root_markers = { "ols.json", ".git" },
|
||||||
|
}
|
||||||
@@ -53,6 +53,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
|||||||
-- Enable LSP servers for Neovim 0.11+
|
-- Enable LSP servers for Neovim 0.11+
|
||||||
vim.lsp.enable({
|
vim.lsp.enable({
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"ols",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Load Lsp on-demand, e.g: eslint is disable by default
|
-- Load Lsp on-demand, e.g: eslint is disable by default
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ vim.pack.add({
|
|||||||
require("conform").setup({
|
require("conform").setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
|
odin = { "odinfmt" },
|
||||||
go = { "goimports", "gofmt" },
|
go = { "goimports", "gofmt" },
|
||||||
python = { "ruff_format", "black", stop_after_first = true },
|
python = { "ruff_format", "black", stop_after_first = true },
|
||||||
json = { "biome", "prettier", stop_after_first = true },
|
json = { "biome", "prettier", stop_after_first = true },
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/mfussenegger/nvim-dap" },
|
||||||
|
{ src = "https://github.com/rcarriga/nvim-dap-ui" },
|
||||||
|
{ src = "https://github.com/nvim-neotest/nvim-nio" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
|
||||||
|
local lldb_dap = vim.fn.exepath("lldb-dap")
|
||||||
|
if lldb_dap == "" then
|
||||||
|
vim.notify("lldb-dap not found — install lldb (pacman -S lldb)", vim.log.levels.WARN)
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.adapters.lldb = {
|
||||||
|
type = "executable",
|
||||||
|
command = lldb_dap,
|
||||||
|
name = "lldb",
|
||||||
|
}
|
||||||
|
|
||||||
|
local function project_binary()
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
return cwd .. "/" .. vim.fn.fnamemodify(cwd, ":t")
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.configurations.odin = {
|
||||||
|
{
|
||||||
|
type = "lldb",
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch Odin",
|
||||||
|
cwd = function()
|
||||||
|
return vim.fn.getcwd()
|
||||||
|
end,
|
||||||
|
program = project_binary,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dapui.setup({})
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui"] = dapui.open
|
||||||
|
dap.listeners.before.event_terminated["dapui"] = dapui.close
|
||||||
|
dap.listeners.before.event_exited["dapui"] = dapui.close
|
||||||
|
|
||||||
|
local function run_or_continue()
|
||||||
|
if dap.session() then
|
||||||
|
dap.continue()
|
||||||
|
elseif vim.bo.filetype == "odin" then
|
||||||
|
vim.system({ "odin", "build", ".", "-debug" }, { cwd = vim.fn.getcwd() }, function(obj)
|
||||||
|
if obj.code ~= 0 then
|
||||||
|
vim.notify("odin build failed (code " .. obj.code .. ")", vim.log.levels.ERROR)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
dap.run(dap.configurations.odin[1])
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
dap.continue()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local maps = {
|
||||||
|
{ "n", "<F5>", run_or_continue, "Start/Continue" },
|
||||||
|
{ "n", "<leader>dc", run_or_continue, "Start/Continue" },
|
||||||
|
{ "n", "<F10>", function() dap.step_over() end, "Step Over" },
|
||||||
|
{ "n", "<leader>do", function() dap.step_over() end, "Step Over" },
|
||||||
|
{ "n", "<F11>", function() dap.step_into() end, "Step Into" },
|
||||||
|
{ "n", "<leader>di", function() dap.step_into() end, "Step Into" },
|
||||||
|
{ "n", "<F12>", function() dap.step_out() end, "Step Out" },
|
||||||
|
{ "n", "<leader>dO", function() dap.step_out() end, "Step Out" },
|
||||||
|
{ "n", "<leader>db", function() dap.toggle_breakpoint() end, "Toggle Breakpoint" },
|
||||||
|
{ "n", "<leader>dB", function() dap.set_breakpoint(vim.fn.input("Condition: ")) end, "Conditional Breakpoint" },
|
||||||
|
{ "n", "<leader>dt", function() dap.terminate() end, "Terminate" },
|
||||||
|
{ "n", "<leader>dq", function() dap.close() end, "Close Session" },
|
||||||
|
{ "n", "<leader>dr", function() dap.repl.toggle() end, "REPL" },
|
||||||
|
{ "n", "<leader>du", function() dapui.toggle() end, "Toggle DAP UI" },
|
||||||
|
{ "n", "<leader>d?", function() dap.list_breakpoints() end, "List Breakpoints" },
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, map in ipairs(maps) do
|
||||||
|
vim.keymap.set(map[1], map[2], map[3], { desc = "DAP: " .. map[4] })
|
||||||
|
end
|
||||||
@@ -15,6 +15,7 @@ vim.api.nvim_create_autocmd("PackChanged", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
require("plugins.theme")
|
require("plugins.theme")
|
||||||
|
require("plugins.mini-icons")
|
||||||
require("plugins.treesitter")
|
require("plugins.treesitter")
|
||||||
require("plugins.blink")
|
require("plugins.blink")
|
||||||
require("plugins.whichkey")
|
require("plugins.whichkey")
|
||||||
@@ -22,6 +23,7 @@ require("plugins.lualine")
|
|||||||
require("plugins.telescope")
|
require("plugins.telescope")
|
||||||
require("plugins.neotree")
|
require("plugins.neotree")
|
||||||
require("plugins.conform")
|
require("plugins.conform")
|
||||||
|
require("plugins.dap")
|
||||||
require("plugins.git")
|
require("plugins.git")
|
||||||
require("plugins.markdown")
|
require("plugins.markdown")
|
||||||
require("plugins.log-highlight")
|
require("plugins.log-highlight")
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/nvim-mini/mini.nvim", version = vim.version.range("^0.18") },
|
||||||
|
})
|
||||||
|
|
||||||
|
require("mini.icons").setup()
|
||||||
@@ -9,7 +9,7 @@ require("nvim-treesitter").install({
|
|||||||
"fish", "gitcommit", "gitignore", "go", "gomod", "gosum", "gowork",
|
"fish", "gitcommit", "gitignore", "go", "gomod", "gosum", "gowork",
|
||||||
"html", "ini", "javascript", "jsdoc", "json", "lua", "luadoc",
|
"html", "ini", "javascript", "jsdoc", "json", "lua", "luadoc",
|
||||||
"luap", "make", "markdown", "markdown_inline", "nginx", "nix",
|
"luap", "make", "markdown", "markdown_inline", "nginx", "nix",
|
||||||
"proto", "python", "query", "regex", "rust", "scss", "sql",
|
"odin", "proto", "python", "query", "regex", "rust", "scss", "sql",
|
||||||
"terraform", "toml", "tsx", "typescript", "vim", "vimdoc",
|
"terraform", "toml", "tsx", "typescript", "vim", "vimdoc",
|
||||||
"xml", "yaml", "zig",
|
"xml", "yaml", "zig",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
||||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||||
},
|
},
|
||||||
|
"mini.nvim": {
|
||||||
|
"rev": "1345d191bb3da9c7b0e977f4387c5761f9bff68d",
|
||||||
|
"src": "https://github.com/nvim-mini/mini.nvim",
|
||||||
|
"version": "0.18.0 - 0.19.0"
|
||||||
|
},
|
||||||
"neo-tree.nvim": {
|
"neo-tree.nvim": {
|
||||||
"rev": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61",
|
"rev": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61",
|
||||||
"src": "https://github.com/nvim-neo-tree/neo-tree.nvim",
|
"src": "https://github.com/nvim-neo-tree/neo-tree.nvim",
|
||||||
@@ -38,6 +43,18 @@
|
|||||||
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
|
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
|
||||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||||
},
|
},
|
||||||
|
"nvim-dap": {
|
||||||
|
"rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570",
|
||||||
|
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||||
|
},
|
||||||
|
"nvim-dap-ui": {
|
||||||
|
"rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43",
|
||||||
|
"src": "https://github.com/rcarriga/nvim-dap-ui"
|
||||||
|
},
|
||||||
|
"nvim-nio": {
|
||||||
|
"rev": "edcc181a875301dd21840189aa2f2f9ad69fc172",
|
||||||
|
"src": "https://github.com/nvim-neotest/nvim-nio"
|
||||||
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
"rev": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025",
|
"rev": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025",
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ set -g status-interval 10
|
|||||||
set -g allow-passthrough on
|
set -g allow-passthrough on
|
||||||
set -g set-clipboard on
|
set -g set-clipboard on
|
||||||
|
|
||||||
|
set -g focus-events on
|
||||||
|
|
||||||
set -ga update-environment TERM
|
set -ga update-environment TERM
|
||||||
set -ga update-environment TERM_PROGRAM
|
set -ga update-environment TERM_PROGRAM
|
||||||
set -ga update-environment SSH_CONNECTION
|
set -ga update-environment SSH_CONNECTION
|
||||||
|
|||||||
Reference in New Issue
Block a user