Compare commits
17 Commits
353df255e1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9485a9253 | ||
| eba4afff84 | |||
|
|
0d78f3b576 | ||
|
|
6073938c44 | ||
|
|
6d7b993478 | ||
|
|
fa32c992ca | ||
|
|
b00d96f033 | ||
|
|
dd981c1a1f | ||
|
|
42bbc0b55d | ||
|
|
f7db5e3599 | ||
|
|
4acf9a7852 | ||
|
|
d225638e1f | ||
|
|
7c0f9e6cca | ||
|
|
418840eb27 | ||
|
|
f6e9194731 | ||
|
|
93b3ff7dda | ||
|
|
ed6bba05aa |
175
init.lua
175
init.lua
@@ -1,67 +1,110 @@
|
|||||||
if vim.g.vscode then
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
local vscode = require('vscode')
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
vim.g.mapleader = " "
|
"git",
|
||||||
vim.cmd("set clipboard+=unnamedplus")
|
"clone",
|
||||||
vim.g.clipboard = vim.g.vscode_clipboard
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
local k = function(mode, lhs, rhs)
|
"--branch=stable", -- latest stable release
|
||||||
vim.keymap.set(mode, lhs, rhs, { expr = true }) -- expr is required
|
lazypath,
|
||||||
end
|
})
|
||||||
|
|
||||||
k("n", "<leader>gf", function()
|
|
||||||
vscode.action("editor.action.formatDocument")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "K", function()
|
|
||||||
vscode.action("editor.action.showDefinitionPreviewHover")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "gD", function()
|
|
||||||
vscode.action("editor.action.goToImplementation")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "<leader>ca", function()
|
|
||||||
vscode.call("editor.action.quickFix")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "<leader>dd", function()
|
|
||||||
vscode.call("workbench.actions.view.toggleProblems")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "<leader>e", function()
|
|
||||||
vscode.call("workbench.view.explorer")
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("v", "gc", function()
|
|
||||||
vscode.call("editor.action.commentLine", {
|
|
||||||
restore_selection=false
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "gcc", function()
|
|
||||||
vscode.call("editor.action.commentLine", {
|
|
||||||
restore_selection=false
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
|
|
||||||
k("n", "<leader>cr", function()
|
|
||||||
vscode.call("editor.action.rename")
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git",
|
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable", -- latest stable release
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require("vim-options")
|
|
||||||
require("lazy").setup("plugins")
|
|
||||||
end
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("vim-options")
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
|
||||||
|
vim.o.number = true
|
||||||
|
vim.o.relativenumber = true
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
gotmpl = 'gotmpl',
|
||||||
|
},
|
||||||
|
pattern = {
|
||||||
|
[".*%.gohtml"] = "gotmpl",
|
||||||
|
[".*%.gotmpl"] = "gotmpl"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Panes
|
||||||
|
vim.cmd.set("splitright")
|
||||||
|
vim.keymap.set("n", "<leader>/", function()
|
||||||
|
vim.cmd.vnew()
|
||||||
|
end, { desc = "Pane split right" })
|
||||||
|
|
||||||
|
vim.cmd.set("splitbelow")
|
||||||
|
vim.keymap.set("n", "<leader>-", function()
|
||||||
|
vim.cmd.new()
|
||||||
|
end, { desc = "Pane split down" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-k>', ':wincmd k<CR>', { noremap = true, silent = true, desc = "Move to up windows" });
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-h>', ':wincmd h<CR>', { noremap = true, silent = true, desc = "Move to left windows" });
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-j>', ':wincmd j<CR>', { noremap = true, silent = true, desc = "Move to down windows" });
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-l>', ':wincmd l<CR>', { noremap = true, silent = true, desc = "Move to right windows" });
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', 'gb', ':bnext<CR>', { noremap = true, silent = true, desc = "Go back last buffer" });
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('t', '<c-[><c-[>', '<C-\\><C-n>', { noremap = true, silent = true, desc = "Escape Terminal" });
|
||||||
|
vim.api.nvim_create_autocmd('TermOpen', {
|
||||||
|
group = vim.api.nvim_create_augroup('custom-term-open', { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
vim.opt.number = false
|
||||||
|
vim.opt.relativenumber = false
|
||||||
|
end,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "Telescope live grep" })
|
||||||
|
vim.keymap.set('n', 'gl', builtin.lsp_references, { desc = "Telescope show references" })
|
||||||
|
vim.keymap.set('n', '<leader>fx', builtin.diagnostics, { desc = "Telescope open diagnostics" })
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Telescope find files" })
|
||||||
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Telescope open buffers" })
|
||||||
|
|
||||||
|
-- Formating
|
||||||
|
vim.keymap.set("n", "<leader>gf", function()
|
||||||
|
require("conform").format({ lsp_format = "fallback" })
|
||||||
|
end, { desc = "Format buffer" })
|
||||||
|
|
||||||
|
-- Filesystem
|
||||||
|
vim.keymap.set("n", "<leader>e", ":Oil<CR>", { desc = "Open file explorer: OIL" })
|
||||||
|
|
||||||
|
|
||||||
|
-- Neotest
|
||||||
|
local neotest = require("neotest")
|
||||||
|
vim.keymap.set("n", "<leader>ts", function()
|
||||||
|
neotest.summary.toggle()
|
||||||
|
end, { desc = "Neotest open summary" })
|
||||||
|
vim.keymap.set("n", "<leader>to", neotest.output.open, { desc = "Neotest open output" })
|
||||||
|
vim.keymap.set("n", "<leader>td", function() neotest.run.run({ suite = false, strategy = "dap" }) end,
|
||||||
|
{ desc = "Neotest debug closest test" })
|
||||||
|
vim.keymap.set("n", "<leader>tr", function() neotest.run.run({ suite = false }) end,
|
||||||
|
{ desc = "Neotest run closest test" })
|
||||||
|
|
||||||
|
-- Debugging
|
||||||
|
local dap = require("dap")
|
||||||
|
vim.keymap.set("n", "<leader>db", dap.toggle_breakpoint,
|
||||||
|
{ nowait = true, remap = false, desc = "Debug toggle breakpoint" })
|
||||||
|
vim.keymap.set("n", "<leader>dc", dap.continue, { nowait = true, remap = false, desc = "Debug continue" })
|
||||||
|
vim.keymap.set("n", "<leader>di", dap.step_into, { nowait = true, remap = false, desc = "Debug step into" })
|
||||||
|
vim.keymap.set("n", "<leader>do", dap.step_over, { nowait = true, remap = false, desc = "Debug step over" })
|
||||||
|
vim.keymap.set("n", "<leader>dr", dap.repl.open, { nowait = true, remap = false, desc = "Debug open repl" })
|
||||||
|
vim.keymap.set("n", "<leader>dq", function()
|
||||||
|
dap.terminate()
|
||||||
|
require("dapui").close()
|
||||||
|
require("nvim-dap-virtual-text").toggle()
|
||||||
|
end, { nowait = true, remap = false, desc = "Debug close" })
|
||||||
|
vim.keymap.set("n", "<leader>dl", dap.list_breakpoints, { nowait = true, remap = false, desc = "Debug list breakpoints" })
|
||||||
|
|
||||||
|
|
||||||
|
-- Lsp Config
|
||||||
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" })
|
||||||
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" })
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, { desc = "LSP code action" })
|
||||||
|
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename, { desc = "LSP rename" })
|
||||||
|
|
||||||
|
-- Motions
|
||||||
|
vim.keymap.set("n", "<C-d>", "<C-d>zz", {})
|
||||||
|
vim.keymap.set("n", "<C-u>", "<C-u>zz", {})
|
||||||
|
|||||||
@@ -1,23 +1,34 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "3d5bced1b9ae69fa3f9b1942e28af5dbc537f946" },
|
"autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" },
|
||||||
"catppuccin": { "branch": "main", "commit": "94f6e8a06b6bb7b8e5529cf9f93adb4654534241" },
|
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f2fa60409630ec2d24acf84494fb55e1d28d593c" },
|
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "3671ab0d40aa5bd24b1686562bd0a23391ecf76a" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "3ce66bc62eb363f19cceeb1fae2e71ea2bede56d" },
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"mini.icons": { "branch": "main", "commit": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "3db16ceeea947517f0dc1404c24dcb5ab0c91d26" },
|
"neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" },
|
||||||
|
"neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" },
|
||||||
|
"nvim-dap": { "branch": "master", "commit": "cdfd55a133f63228c55f91378f12908cb2a78ded" },
|
||||||
|
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||||
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "ca6ea12daf0a4d92dc24c5c9ae22a1f0418ade37" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "92ee7d42320edfbb81f3cad851314ab197fa324a" },
|
||||||
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "4a8369f4c78ef6f6f895f0cec349e48f74330574" },
|
"nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"ripgrep": { "branch": "master", "commit": "0a88cccd5188074de96f54a4b6b44a63971ac157" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }
|
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "ecce93ff7db4461e942c03e0fcc64bd785df4057" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
}
|
}
|
||||||
|
|||||||
6
lua/plugins/autoclose.lua
Normal file
6
lua/plugins/autoclose.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'm4xshen/autoclose.nvim',
|
||||||
|
config = function()
|
||||||
|
require('autoclose').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
8
lua/plugins/blink.lua
Normal file
8
lua/plugins/blink.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
dependecies = { "rafamadriz/friendly-snippets" },
|
||||||
|
version = "1.*",
|
||||||
|
opts = {
|
||||||
|
keymap = { preset = "enter" }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
opts = {
|
|
||||||
-- add any options here
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"hrsh7th/cmp-nvim-lsp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
dependencies = {
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
-- REQUIRED - you must specify a snippet engine
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" }, -- For luasnip users.
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
16
lua/plugins/conform.lua
Normal file
16
lua/plugins/conform.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
config = function()
|
||||||
|
require("conform").setup {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "isort", "black", lsp_format = "fallback" },
|
||||||
|
gotmpl = { "djlint" }
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_format = "fallback"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
77
lua/plugins/dap.lua
Normal file
77
lua/plugins/dap.lua
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
return {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = {
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local mason_dap = require("mason-nvim-dap")
|
||||||
|
local dap = require("dap")
|
||||||
|
local ui = require("dapui")
|
||||||
|
local dap_virtual_text = require("nvim-dap-virtual-text")
|
||||||
|
|
||||||
|
-- Dap Virtual Text
|
||||||
|
dap_virtual_text.setup()
|
||||||
|
|
||||||
|
mason_dap.setup({
|
||||||
|
ensure_installed = { "python" },
|
||||||
|
automatic_installation = true,
|
||||||
|
handlers = {
|
||||||
|
function(config)
|
||||||
|
require("mason-nvim-dap").default_setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Configurations
|
||||||
|
dap.configurations = {
|
||||||
|
python = {
|
||||||
|
{
|
||||||
|
-- The first three options are required by nvim-dap
|
||||||
|
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch file",
|
||||||
|
|
||||||
|
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
||||||
|
|
||||||
|
program = "${file}", -- This configuration will launch the current file if used.
|
||||||
|
pythonPath = function()
|
||||||
|
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
||||||
|
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
||||||
|
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
||||||
|
return cwd .. "/venv/bin/python"
|
||||||
|
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
||||||
|
return cwd .. "/.venv/bin/python"
|
||||||
|
else
|
||||||
|
return "/usr/bin/python"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Dap UI
|
||||||
|
|
||||||
|
ui.setup()
|
||||||
|
|
||||||
|
vim.fn.sign_define("DapBreakpoint", { text = "🐞" })
|
||||||
|
|
||||||
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
|
ui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
|
ui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
|
ui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
|
ui.close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
4
lua/plugins/fidget.lua
Normal file
4
lua/plugins/fidget.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
opts = {}
|
||||||
|
}
|
||||||
9
lua/plugins/flash.lua
Normal file
9
lua/plugins/flash.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
---@type Flash.Config
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "zk", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||||
|
},
|
||||||
|
}
|
||||||
17
lua/plugins/linter.lua
Normal file
17
lua/plugins/linter.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
'mfussenegger/nvim-lint',
|
||||||
|
config = function()
|
||||||
|
local lint = require("lint")
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
python = { 'dmypy' }
|
||||||
|
}
|
||||||
|
|
||||||
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
|
group = lint_augroup,
|
||||||
|
callback = function()
|
||||||
|
lint.try_lint(nil, {ignore_errors = true})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
return {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
local handlers = {
|
|
||||||
-- ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }),
|
|
||||||
-- ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }),
|
|
||||||
}
|
|
||||||
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"lua_ls",
|
|
||||||
"gopls",
|
|
||||||
"html",
|
|
||||||
"pyright",
|
|
||||||
"clangd",
|
|
||||||
"yamlls",
|
|
||||||
"ansiblels",
|
|
||||||
},
|
|
||||||
handlers = {
|
|
||||||
function(server_name)
|
|
||||||
require("lspconfig")[server_name].setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
handlers = handlers
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
clangd = function()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
lspconfig.clangd.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
handlers = handlers,
|
|
||||||
init_options = {
|
|
||||||
fallbackFlags = { '--std=c++20' }
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
|
|
||||||
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename, {})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
23
lua/plugins/lsp.lua
Normal file
23
lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
vim.lsp.enable({ "lua_ls", "basedpyright", "gopls", "html", "yamlls", "svelte-language-server", "clangd",
|
||||||
|
"ansiblels", "vtsls", "zls", "glsl_analyzer", "rust_analyzer" })
|
||||||
|
|
||||||
|
-- Testing basedpyright atm, change to jedi idk
|
||||||
|
vim.lsp.config("basedpyright", {
|
||||||
|
settings = {
|
||||||
|
['basedpyright'] = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "basic",
|
||||||
|
inlayHints = {
|
||||||
|
variableTypes = true,
|
||||||
|
genericTypes = true,
|
||||||
|
},
|
||||||
|
autoFormatStrings = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -8,4 +8,4 @@ return {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
4
lua/plugins/mason.lua
Normal file
4
lua/plugins/mason.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
opts = {}
|
||||||
|
}
|
||||||
19
lua/plugins/neotest.lua
Normal file
19
lua/plugins/neotest.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-neotest/neotest-python",
|
||||||
|
"nvim-neotest/neotest-go",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neotest").setup({
|
||||||
|
adapters = {
|
||||||
|
require("neotest-python"),
|
||||||
|
require("neotest-go")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
branch = "v3.x",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("neo-tree").setup({
|
|
||||||
event_handlers = {
|
|
||||||
{
|
|
||||||
event = "file_opened",
|
|
||||||
handler = function(file_path)
|
|
||||||
require("neo-tree.command").execute({ action = "close" })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filesystem = {
|
|
||||||
filtered_items = {
|
|
||||||
visible = false,
|
|
||||||
show_hidden_count = true,
|
|
||||||
hide_dotfiles = false,
|
|
||||||
hide_gitignored = false,
|
|
||||||
hide_by_name = {
|
|
||||||
'.git',
|
|
||||||
'bin',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
vim.keymap.set("n", "<C-n>", ":Neotree filesystem reveal right toggle<CR>", {})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
config = function()
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
null_ls.setup({
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.formatting.stylua,
|
|
||||||
null_ls.builtins.formatting.gofmt,
|
|
||||||
null_ls.builtins.formatting.prettierd,
|
|
||||||
null_ls.builtins.formatting.black
|
|
||||||
},
|
|
||||||
})
|
|
||||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
10
lua/plugins/oil.lua
Normal file
10
lua/plugins/oil.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
---@module 'oil'
|
||||||
|
---@type oil.SetupOpts
|
||||||
|
opts = {},
|
||||||
|
-- Optional dependencies
|
||||||
|
dependencies = { { "nvim-mini/mini.icons", opts = {} } },
|
||||||
|
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||||
|
lazy = false,
|
||||||
|
}
|
||||||
@@ -2,19 +2,17 @@ return {
|
|||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
tag = '0.1.6',
|
tag = '0.1.6',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = {
|
||||||
config = function()
|
'nvim-lua/plenary.nvim',
|
||||||
local builtin = require("telescope.builtin")
|
'BurntSushi/ripgrep',
|
||||||
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
},
|
||||||
vim.keymap.set('n', 'gl', builtin.lsp_references, {})
|
|
||||||
vim.keymap.set('n', '<leader>d', builtin.diagnostics, {})
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope-ui-select.nvim',
|
'nvim-telescope/telescope-ui-select.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").setup({
|
local telescope = require("telescope")
|
||||||
|
telescope.setup({
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
["ui-select"] = {
|
||||||
require("telescope.themes").get_dropdown {
|
require("telescope.themes").get_dropdown {
|
||||||
@@ -22,7 +20,9 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
require("telescope").load_extension("ui-select")
|
|
||||||
|
telescope.load_extension("ui-select")
|
||||||
|
telescope.load_extension("fzf")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
lua/plugins/tiny-inline.lua
Normal file
19
lua/plugins/tiny-inline.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"rachartier/tiny-inline-diagnostic.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require('tiny-inline-diagnostic').setup({
|
||||||
|
preset = "modern",
|
||||||
|
transparent_bg = true,
|
||||||
|
|
||||||
|
options = {
|
||||||
|
multilines = {
|
||||||
|
enabled = true,
|
||||||
|
always_show = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.diagnostic.config({ virtual_text = false }) -- Disable Neovim's default virtual text diagnostics
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -2,11 +2,13 @@ return {
|
|||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
local config = require("nvim-treesitter.configs")
|
require("nvim-treesitter.configs").setup({
|
||||||
config.setup({
|
ensure_installed = { "lua", "go", "zig", "markdown", "json", "yaml", "javascript",
|
||||||
ensure_installed = { "lua", "go", "zig", "markdown", "json", "yaml", "javascript", "typescript", "bash", "python", "c_sharp", "cpp", "gleam" },
|
"typescript", "bash", "python", "c_sharp", "cpp", "gleam", "svelte" },
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
|
sync_install = false,
|
||||||
|
|
||||||
|
highlight = { enable = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
opts = {},
|
|
||||||
cmd = "Trouble",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>dd",
|
|
||||||
"<cmd>Trouble diagnostics toggle<cr>"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
11
lua/plugins/vim-lazy-dev.lua
Normal file
11
lua/plugins/vim-lazy-dev.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua", -- only load on lua files
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- See the configuration section for more details
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
27
lua/plugins/which-key.lua
Normal file
27
lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = false })
|
||||||
|
end,
|
||||||
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.add({
|
||||||
|
{ "<leader>d", group = "Debug" },
|
||||||
|
{ "<leader>f", group = "Telescope" },
|
||||||
|
{ "<leader>t", group = "Test" },
|
||||||
|
{ "<leader>c", group = "Code" },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -3,24 +3,9 @@ vim.cmd("set tabstop=2")
|
|||||||
vim.cmd("set softtabstop=2")
|
vim.cmd("set softtabstop=2")
|
||||||
vim.cmd("set shiftwidth=2")
|
vim.cmd("set shiftwidth=2")
|
||||||
vim.cmd("set expandtab")
|
vim.cmd("set expandtab")
|
||||||
vim.cmd("set number")
|
|
||||||
vim.cmd("set clipboard+=unnamedplus")
|
vim.cmd("set clipboard+=unnamedplus")
|
||||||
vim.cmd("highlight Normal guibg=none")
|
vim.cmd("highlight Normal guibg=none")
|
||||||
vim.cmd("highlight NonText guibg=none")
|
vim.cmd("highlight NonText guibg=none")
|
||||||
vim.cmd("highlight Normal ctermbg=none")
|
vim.cmd("highlight Normal ctermbg=none")
|
||||||
vim.cmd("highlight NonText ctermbg=none")
|
vim.cmd("highlight NonText ctermbg=none")
|
||||||
vim.o.winborder = 'rounded'
|
vim.o.winborder = 'rounded'
|
||||||
|
|
||||||
vim.cmd.set("splitright")
|
|
||||||
vim.keymap.set("n", "<leader>v", function()
|
|
||||||
vim.cmd.vnew()
|
|
||||||
end)
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>h", function()
|
|
||||||
vim.cmd.new()
|
|
||||||
end)
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('n', '<c-k>', ':wincmd k<CR>', { noremap = true, silent = true });
|
|
||||||
vim.api.nvim_set_keymap('n', '<c-h>', ':wincmd h<CR>', { noremap = true, silent = true });
|
|
||||||
vim.api.nvim_set_keymap('n', '<c-j>', ':wincmd j<CR>', { noremap = true, silent = true });
|
|
||||||
vim.api.nvim_set_keymap('n', '<c-l>', ':wincmd l<CR>', { noremap = true, silent = true });
|
|
||||||
|
|||||||
3
queries/gotmpl/injections.scm
Normal file
3
queries/gotmpl/injections.scm
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
((text) @injection.content
|
||||||
|
(#set! injection.language "html")
|
||||||
|
(#set! injection.combined))
|
||||||
Reference in New Issue
Block a user