.
This commit is contained in:
parent
73ff9ee8ee
commit
664eb70e8c
14 changed files with 698 additions and 495 deletions
|
|
@ -86,6 +86,7 @@ in
|
|||
blade = { "blade-formatter" },
|
||||
go = { "gofmt" },
|
||||
wgsl = { "wgsl_fmt" },
|
||||
odin = { "odinfmt" },
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
|
|
@ -127,7 +128,14 @@ in
|
|||
},
|
||||
adapters = {
|
||||
require('neotest-pest'),
|
||||
}
|
||||
require('neotest-zig'),
|
||||
-- require('neotest-odin'),
|
||||
},
|
||||
watch = {
|
||||
filter_path = function(path, root)
|
||||
return true
|
||||
end,
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '<localleader>pn', function() require('neotest').run.run() end, { desc = "test nearest" })
|
||||
vim.keymap.set('n', '<localleader>pe', function() require('neotest').run.run(vim.fn.expand('%')) end, { desc = "test file" })
|
||||
|
|
@ -138,6 +146,10 @@ in
|
|||
type = "lua";
|
||||
}
|
||||
# {
|
||||
# plugin = neotest-zig;
|
||||
# type = "lua";
|
||||
# }
|
||||
# {
|
||||
# plugin = nvim-autopairs;
|
||||
# type = "lua";
|
||||
# config = ''
|
||||
|
|
@ -149,19 +161,43 @@ in
|
|||
type = "lua";
|
||||
config = ''
|
||||
local dap = require("dap")
|
||||
dap.adapters.php = {
|
||||
type = 'executable',
|
||||
command = '${pkgs.nodejs}/bin/node',
|
||||
args = { '${pkgs.vscode-extensions.xdebug.php-debug}/share/vscode/extensions/xdebug.php-debug/out/phpDebug.js' },
|
||||
dap.adapters = {
|
||||
php = {
|
||||
type = "executable",
|
||||
command = "${pkgs.nodejs}/bin/node",
|
||||
args = { "${pkgs.vscode-extensions.xdebug.php-debug}/share/vscode/extensions/xdebug.php-debug/out/phpDebug.js" },
|
||||
},
|
||||
|
||||
codelldb = {
|
||||
type = "server",
|
||||
port = "''${port}",
|
||||
executable = {
|
||||
command = '${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb',
|
||||
args = { "--port", "''${port}" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = 'php',
|
||||
request = 'launch',
|
||||
name = 'listen for xdebug',
|
||||
port = 9003,
|
||||
}
|
||||
dap.configurations = {
|
||||
php = {
|
||||
{
|
||||
type = 'php',
|
||||
request = 'launch',
|
||||
name = 'listen for xdebug',
|
||||
port = 9003,
|
||||
}
|
||||
},
|
||||
zig = {
|
||||
{
|
||||
name = 'launch',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = "''${workspaceFolder}/zig-out/bin/''${workspaceFolderBasename}",
|
||||
cwd = "''${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
}
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -199,7 +235,7 @@ in
|
|||
'fsharp', 'git_config', 'git_rebase', 'gitignore', 'glsl', 'go', 'gomod', 'graphql',
|
||||
'haskell', 'hlsl', 'http', 'ini', 'javadoc', 'jq', 'jsdoc', 'json', 'json5', 'kitty',
|
||||
'latex', 'markdown', 'nginx', 'nix', 'php', 'php_only', 'phpdoc', 'regex', 'rust', 'sql',
|
||||
'ssh_config', 'tmux', 'vim', 'wgsl', 'yaml', 'zig', 'ols',
|
||||
'ssh_config', 'tmux', 'vim', 'wgsl', 'yaml', 'zig', 'odin',
|
||||
},
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
|
|
@ -246,12 +282,11 @@ in
|
|||
config = ''
|
||||
vim.o.autoread = true
|
||||
-- Recommended/example keymaps.
|
||||
vim.keymap.set({ "n", "x" }, "<C-a>", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode…" })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>h", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode…" })
|
||||
vim.keymap.set({ "n", "x" }, "<C-x>", function() require("opencode").select() end, { desc = "Execute opencode action…" })
|
||||
vim.keymap.set({ "n", "t" }, "<C-.>", function() require("opencode").toggle() end, { desc = "Toggle opencode" })
|
||||
|
||||
vim.keymap.set({ "n", "x" }, "go", function() return require("opencode").operator("@this ") end, { desc = "Add range to opencode", expr = true })
|
||||
vim.keymap.set("n", "goo", function() return require("opencode").operator("@this ") .. "_" end, { desc = "Add line to opencode", expr = true })
|
||||
|
||||
vim.keymap.set("n", "<S-C-u>", function() require("opencode").command("session.half.page.up") end, { desc = "Scroll opencode up" })
|
||||
vim.keymap.set("n", "<S-C-d>", function() require("opencode").command("session.half.page.down") end, { desc = "Scroll opencode down" })
|
||||
|
|
@ -406,7 +441,7 @@ in
|
|||
extraConfig = ''
|
||||
colorscheme ${cfg.colorscheme}
|
||||
'';
|
||||
extraLuaConfig = ''
|
||||
initLua = ''
|
||||
${builtins.readFile ./settings.lua}
|
||||
${builtins.replaceStrings [ "@HOSTNAME@" ] [ cfg.hostname ] (builtins.readFile ./plugins.lua)}
|
||||
require("custom")
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ local servers = {
|
|||
zls = {
|
||||
enable_build_on_save = true,
|
||||
semantic_tokens = "partial",
|
||||
global_cache_path = vim.fn.getcwd(0, 0) .. "/.cache/zls",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -52,7 +53,11 @@ local servers = {
|
|||
html = { filetypes = { "html", "blade" } },
|
||||
htmx = { filetypes = { "html", "blade" } },
|
||||
gopls = {},
|
||||
ols = {},
|
||||
ols = {
|
||||
enable_semantic_tokens = true,
|
||||
enable_auto_import = true,
|
||||
checker_args = "-vet",
|
||||
},
|
||||
wgsl_analyzer = {},
|
||||
}
|
||||
for server, config in pairs(servers) do
|
||||
|
|
@ -77,12 +82,12 @@ local leap = require("leap")
|
|||
leap.opts.preview = function(ch0, ch1, ch2)
|
||||
return not (ch1:match("%s") or (ch0:match("%a") and ch1:match("%a") and ch2:match("%a")))
|
||||
end
|
||||
leap.opts.equivalence_classes = {
|
||||
" \t\r\n",
|
||||
"([{",
|
||||
")]}",
|
||||
"'\"`",
|
||||
}
|
||||
-- leap.opts.equivalence_classes = {
|
||||
-- " \t\r\n",
|
||||
-- "([{",
|
||||
-- ")]}",
|
||||
-- "'\"`",
|
||||
-- }
|
||||
vim.api.nvim_set_hl(0, "LeapBackdrop", { link = "Comment" })
|
||||
|
||||
do
|
||||
|
|
|
|||
|
|
@ -107,9 +107,6 @@ vim.keymap.set({ "n", "t" }, "<C-H>", function()
|
|||
end, { desc = "Go to previous tab" })
|
||||
vim.keymap.set({ "n", "t" }, "<C-Space>", "<C-w>p", { desc = "Go to previous pane" })
|
||||
|
||||
vim.keymap.set("n", "<localleader>v", "<cmd>vsplit<cr>", { desc = "split (vertical line)" })
|
||||
vim.keymap.set("n", "<leader>h", "<cmd>split<cr>", { desc = "split (horizontal line)" })
|
||||
|
||||
vim.keymap.set("n", "<localleader><localleader>", "<cmd>w<cr>", { desc = "save buffer" })
|
||||
|
||||
vim.diagnostic.config({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue