1
0
Fork 0

lazy: migrate plugins to lazy.nvim

This commit is contained in:
Felipe 2024-09-19 12:58:41 -03:00
parent 85fc76e226
commit 6bb7801397
Signed by: pitbuster
SSH key fingerprint: SHA256:HDYu2Pm4/TmSX8GBwV49UvFWr1Ljg8XlHxKeCpjJpOk
70 changed files with 822 additions and 809 deletions

159
.gitmodules vendored
View file

@ -1,166 +1,7 @@
[submodule "pack/general/start/gruvbox.nvim"]
path = pack/general/start/gruvbox.nvim
url = https://github.com/npxbr/gruvbox.nvim
branch = main
[submodule "pack/general/start/lush.nvim"]
path = pack/general/start/lush.nvim
url = https://github.com/rktjmp/lush.nvim
branch = main
[submodule "pack/general/start/nvim-lspconfig"]
path = pack/general/start/nvim-lspconfig
url = https://github.com/neovim/nvim-lspconfig
branch = master
[submodule "pack/general/start/nvim-treesitter"]
path = pack/general/start/nvim-treesitter
url = https://github.com/nvim-treesitter/nvim-treesitter
branch = master
[submodule "pack/general/start/plenary.nvim"]
path = pack/general/start/plenary.nvim
url = https://github.com/nvim-lua/plenary.nvim
branch = master
[submodule "pack/general/start/popup.nvim"]
path = pack/general/start/popup.nvim
url = https://github.com/nvim-lua/popup.nvim
[submodule "pack/general/start/telescope.nvim"]
path = pack/general/start/telescope.nvim
url = https://github.com/nvim-telescope/telescope.nvim
branch = master
[submodule "pack/general/start/gitsigns.nvim"]
path = pack/general/start/gitsigns.nvim
url = https://github.com/lewis6991/gitsigns.nvim
branch = main
[submodule "pack/general/start/nvim-cmp"]
path = pack/general/start/nvim-cmp
url = https://github.com/hrsh7th/nvim-cmp
[submodule "pack/general/start/cmp-path"]
path = pack/general/start/cmp-path
url = https://github.com/hrsh7th/cmp-path
[submodule "pack/general/start/LuaSnip"]
path = pack/general/start/LuaSnip
url = https://github.com/L3MON4D3/LuaSnip
branch = master
[submodule "pack/general/start/cmp_luasnip"]
path = pack/general/start/cmp_luasnip
url = https://github.com/saadparwaiz1/cmp_luasnip
[submodule "pack/general/start/cmp-buffer"]
path = pack/general/start/cmp-buffer
url = https://github.com/hrsh7th/cmp-buffer
[submodule "pack/general/start/cmp-nvim-lsp"]
path = pack/general/start/cmp-nvim-lsp
url = https://github.com/hrsh7th/cmp-nvim-lsp
[submodule "pack/general/start/Comment.nvim"]
path = pack/general/start/Comment.nvim
url = https://github.com/numToStr/Comment.nvim
[submodule "pack/general/start/vim-caddyfile"]
path = pack/general/start/vim-caddyfile
url = https://github.com/isobit/vim-caddyfile
[submodule "pack/general/start/git-blame.nvim"]
path = pack/general/start/git-blame.nvim
url = https://github.com/f-person/git-blame.nvim
branch = master
[submodule "nvim-dap"]
path = pack/general/opt/nvim-dap
url = https://github.com/mfussenegger/nvim-dap
branch = master
[submodule "pack/general/start/nvim-dap-go"]
path = pack/general/opt/nvim-dap-go
url = https://github.com/leoluz/nvim-dap-go
[submodule "pack/general/start/nvim-dap-ui"]
path = pack/general/opt/nvim-dap-ui
url = https://github.com/rcarriga/nvim-dap-ui
branch = master
[submodule "pack/general/start/vim-helm"]
path = pack/general/start/vim-helm
url = https://github.com/towolf/vim-helm
[submodule "pack/general/start/nvim-lint"]
path = pack/general/start/nvim-lint
url = https://github.com/mfussenegger/nvim-lint
branch = master
[submodule "pack/general/start/telescope-fzy-native.nvim"]
path = pack/general/start/telescope-fzy-native.nvim
url = https://github.com/nvim-telescope/telescope-fzy-native.nvim
[submodule "pack/general/start/nvim-web-devicons"]
path = pack/general/start/nvim-web-devicons
url = https://github.com/nvim-tree/nvim-web-devicons
branch = master
[submodule "pack/general/start/telescope-luasnip.nvim"]
path = pack/general/start/telescope-luasnip.nvim
url = https://github.com/benfowler/telescope-luasnip.nvim
[submodule "pack/general/start/formatter.nvim"]
path = pack/general/start/formatter.nvim
url = https://github.com/mhartington/formatter.nvim
branch = master
[submodule "pack/general/start/lualine.nvim"]
path = pack/general/start/lualine.nvim
url = https://github.com/nvim-lualine/lualine.nvim
[submodule "pack/general/start/nvim-rc"]
path = pack/general/start/nvim-rc
url = https://github.com/Dkendal/nvim-rc
[submodule "pack/general/start/nvim-osc52"]
path = pack/general/start/nvim-osc52
url = https://github.com/ojroques/nvim-osc52
[submodule "pack/general/start/crates.nvim"] [submodule "pack/general/start/crates.nvim"]
path = pack/general/start/crates.nvim path = pack/general/start/crates.nvim
url = https://github.com/Saecki/crates.nvim url = https://github.com/Saecki/crates.nvim
branch = main branch = main
[submodule "pack/general/start/neotest"]
path = pack/general/opt/neotest
url = https://github.com/nvim-neotest/neotest
branch = master
[submodule "pack/general/start/neotest-rust"]
path = pack/general/opt/neotest-rust
url = https://github.com/rouge8/neotest-rust
branch = main
[submodule "pack/general/start/lsp_lines.nvim"] [submodule "pack/general/start/lsp_lines.nvim"]
path = pack/general/opt/lsp_lines.nvim path = pack/general/opt/lsp_lines.nvim
url = https://git.sr.ht/~whynothugo/lsp_lines.nvim url = https://git.sr.ht/~whynothugo/lsp_lines.nvim
[submodule "pack/general/opt/crates.nvim"]
path = pack/general/opt/crates.nvim
url = https://github.com/Saecki/crates.nvim
[submodule "pack/general/start/nvim-surround"]
path = pack/general/start/nvim-surround
url = https://github.com/kylechui/nvim-surround
branch = main
[submodule "pack/general/start/nvim-spider"]
path = pack/general/start/nvim-spider
url = https://github.com/chrisgrieser/nvim-spider
branch = main
[submodule "pack/general/opt/lsp_lines.nvim"]
path = pack/general/start/lsp_lines.nvim
url = https://git.sr.ht/~whynothugo/lsp_lines.nvim
[submodule "pack/general/opt/lsp-timeout.nvim"]
path = pack/general/opt/lsp-timeout.nvim
url = https://github.com/hinell/lsp-timeout.nvim
[submodule "pack/general/start/nvim-colorizer.lua"]
path = pack/general/start/nvim-colorizer.lua
url = https://github.com/NvChad/nvim-colorizer.lua
[submodule "pack/general/opt/ferris.nvim"]
path = pack/general/opt/ferris.nvim
url = https://github.com/vxpm/ferris.nvim
[submodule "pack/general/start/typst.vim"]
path = pack/general/start/typst.vim
url = https://github.com/kaarmu/typst.vim
[submodule "pack/general/opt/typst-preview.nvim"]
path = pack/general/opt/typst-preview.nvim
url = https://github.com/niuiic/typst-preview.nvim
[submodule "pack/general/opt/core.nvim"]
path = pack/general/opt/core.nvim
url = https://github.com/niuiic/core.nvim
[submodule "pack/general/start/playground"]
path = pack/general/start/playground
url = https://github.com/nvim-treesitter/playground
[submodule "pack/general/start/conform.nvim"]
path = pack/general/start/conform.nvim
url = https://github.com/stevearc/conform.nvim
[submodule "pack/general/opt/nvim-nio"]
path = pack/general/opt/nvim-nio
url = https://github.com/nvim-neotest/nvim-nio
[submodule "pack/general/start/neogit"]
path = pack/general/start/neogit
url = https://github.com/NeogitOrg/neogit
[submodule "pack/general/start/diffview.nvim"]
path = pack/general/start/diffview.nvim
url = https://github.com/sindrets/diffview.nvim
[submodule "pack/general/start/fluent.vim"]
path = pack/general/start/fluent.vim
url = https://github.com/projectfluent/fluent.vim

647
init.lua
View file

@ -1,4 +1,3 @@
vim.loader.enable()
---- General Config ---- ---- General Config ----
vim.opt.mouse = "a" vim.opt.mouse = "a"
vim.opt.tabstop = 2 vim.opt.tabstop = 2
@ -30,6 +29,9 @@ vim.api.nvim_create_autocmd({ "TermOpen" }, {
end, end,
}) })
---- lazy.nvim ----
require("lazy-nvim")
---- Theming ---- ---- Theming ----
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.background = "dark" vim.opt.background = "dark"
@ -42,66 +44,6 @@ vim.opt.listchars = {
extends = "", extends = "",
trail = "", trail = "",
} }
---- lualine.nvim ----
local lualine = require("lualine")
local theme = require("lualine.themes.gruvbox")
theme.terminal = theme.insert
lualine.setup({
options = {
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
theme = theme,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "diagnostics" },
lualine_c = {
{
"filename",
path = 1,
},
},
lualine_x = {
{
"fileformat",
cond = function()
return vim.bo.fileformat ~= "unix"
end,
},
{
"encoding",
cond = function()
return vim.bo.fileencoding ~= "utf-8"
end,
},
},
lualine_y = {
{
"filetype",
icons_enabled = false,
symbols = {
modified = "",
readonly = "",
unnamed = "",
new = "󰎔",
},
},
},
lualine_z = { "searchcount", "progress", "location" },
},
tabline = {
lualine_a = {
{
"buffers",
show_filename_only = false,
max_length = function()
return math.max(math.ceil(vim.o.columns * 2 / 3), vim.o.columns - 6)
end,
},
},
lualine_z = { "tabs" },
},
})
---- Maps ---- ---- Maps ----
vim.keymap.set("!", "<C-BS>", "<C-w>") vim.keymap.set("!", "<C-BS>", "<C-w>")
@ -109,97 +51,6 @@ vim.keymap.set("v", ">", ">gv")
vim.keymap.set("v", "<", "<gv") vim.keymap.set("v", "<", "<gv")
vim.keymap.set("n", "<C-L>", ":nohlsearch<CR>") vim.keymap.set("n", "<C-L>", ":nohlsearch<CR>")
---- Treesitter ----
require("nvim-treesitter.configs").setup({
auto_install = true,
sync_install = false,
ignore_install = {},
modules = {}, -- not used, but it will silence lua_ls
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<Leader><Enter>",
node_incremental = "<Enter>",
node_decremental = "<BS>",
},
},
ensure_installed = {
"bash",
"c",
"cmake",
"comment",
"cpp",
"css",
"csv",
"diff",
"dockerfile",
"dot",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"html",
"htmldjango",
"http",
"ini",
"javascript",
"json",
"kdl",
"kotlin",
"latex",
"lua",
"make",
"markdown",
"markdown_inline",
"mermaid",
"passwd",
"perl",
"php",
"proto",
"python",
"query",
"regex",
"ron",
"rst",
"rust",
"scss",
"sql",
"terraform",
"toml",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
highlight = { enable = true, indent = true },
playground = {
enable = false,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = 'o',
toggle_hl_groups = 'i',
toggle_injected_languages = 't',
toggle_anonymous_nodes = 'a',
toggle_language_display = 'I',
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
show_help = '?',
},
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
})
---- Filetypes --- ---- Filetypes ---
-- KDL -- -- KDL --
vim.filetype.add({ extension = { kdl = "kdl" } }) vim.filetype.add({ extension = { kdl = "kdl" } })
@ -221,313 +72,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
end, end,
}) })
---- conform.nvim ----
require("conform").setup({
formatters_by_ft = {
terraform = { "terraform_fmt" }
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_format = "fallback",
},
})
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
---- LuaSnip
local luasnip = require("luasnip")
require("luasnip.loaders.from_lua").lazy_load()
luasnip.config.set_config({
store_selection_keys = "<c-s>",
})
vim.keymap.set({ "i", "s" }, "<Tab>", function()
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<Tab>", true, false, true),
"n", -- noremap to avoid infinite recursion
true
)
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
if luasnip.jumpable(-1) then
luasnip.jump(-1)
end
end, { silent = true })
---- completion-nvim
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
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(),
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
{ name = "crates" },
}),
})
---- LSP ----
local lsp = require("lspconfig")
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_lsp_attach = function(_client, _bufnr)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration)
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
vim.keymap.set("n", "K", vim.lsp.buf.hover)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help)
vim.keymap.set("n", "<Leader>D", vim.lsp.buf.type_definition)
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename)
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action)
vim.keymap.set("n", "gr", vim.lsp.buf.references)
vim.keymap.set("n", "<Leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<Leader>q", vim.diagnostic.setloclist)
end
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = {
clangd = {
filetypes = { "c", "cpp" }
},
dotls = {},
eslint = {},
gopls = {},
jsonls = {},
kotlin_language_server = {},
lua_ls = {
settings = {
Lua = {
runtime = { version = "LuaJIT" },
diagnostics = {
globals = { "vim" },
unusedLocalExclude = { "_*" },
},
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = { enable = false },
},
},
},
pylsp = {},
rust_analyzer = {
settings = {
['rust-analyzer'] = {
cargo = {
features = "all"
}
}
}
},
taplo = {},
texlab = {},
tflint = {},
tsserver = {},
biome = {
cmd = { "pnpm", "exec", "biome", "lsp-proxy" }
},
typst_lsp = {},
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lsp.util.default_config = vim.tbl_deep_extend("force", lsp.util.default_config, { capabilities = capabilities })
for server, add_to_config in pairs(servers) do
local config = {
on_attach = on_lsp_attach,
flags = {
debounce_text_changes = 150,
},
}
for k, v in pairs(add_to_config) do
config[k] = v
end
lsp[server].setup(config)
end
---- lsp_lines
require("lsp_lines").setup()
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
})
---- lsp-timeout
-- vim.g["lsp-timeout-config"] = {
-- stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSP servers
-- startTimeout = 1000 * 2, -- ms, timeout before restart
-- silent = false -- true to suppress notifications
-- }
---- nvim-lint ----
local lint = require("lint")
-- sqlfluff --
lint.linters.sqlfluff.args = {
"lint",
"--format=json",
"--dialect=postgres",
}
-- yamllint --
lint.linters.yamllint.args = {
args = { "--format=parsable", "-d relaxed" },
}
-- actionlint --
---- Set custom filetype to not lint everythin
--- https://github.com/mfussenegger/nvim-lint/issues/591#issuecomment-2142162704
vim.filetype.add({
pattern = {
['.*/.github/workflows/.*%.yml'] = 'yaml.ghaction',
['.*/.github/workflows/.*%.yaml'] = 'yaml.ghaction',
},
})
local linters = {
bash = { "shellcheck" },
dockerfile = { "hadolint" },
ghaction = { "actionlint" },
go = { "golangcilint" },
python = { "flake8" },
-- rust = { "clippy" },
sql = { "sqlfluff" },
yaml = { "yamllint" },
}
-- set linters --
lint.linters_by_ft = linters
-- set autocommands --
for ft, ft_linters in pairs(linters) do
local on_change = false
local on_write = false
for _, l in ipairs(ft_linters) do
if lint.linters[l].stdin then
on_change = true
else
on_write = true
end
end
if on_change then
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = ft,
callback = function()
vim.api.nvim_create_autocmd({ "TextChanged" }, {
callback = function()
lint.try_lint(nil, { ignore_errors = true })
end,
})
end,
})
end
if on_write then
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = ft,
callback = function()
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
lint.try_lint(nil, { ignore_errors = true })
end,
})
-- we want to also call linters here so we don't wait
-- for the first write to happen
lint.try_lint(nil, { ignore_errors = true })
end,
})
end
end
---- gitblame
local gitblame = require("gitblame")
gitblame.setup({
enabled = false,
})
vim.keymap.set({ "n" }, "<leader>oc", gitblame.open_commit_url)
vim.keymap.set({ "n" }, "<leader>tb", ":GitBlameToggle<CR>")
---- gitsigns.nvim
require("gitsigns").setup({
on_attach = function(_bufnr)
local gs = package.loaded.gitsigns
-- Navigation
vim.keymap.set("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
vim.keymap.set("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
end,
})
---- neogit ----
local neogit = require('neogit')
neogit.setup({
git_services = {
["azure.com"] =
"https://dev.azure.com/${owner}/_git/${repository}/pullrequestcreate?sourceRef=${branch_name}&targetRef=${target}",
["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1",
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
["gitlab.com"] =
"https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
["codeberg.org"] = "https://codeberg.org/${owner}/${repository}/compare/${target}...${branch_name}",
["oolong.ludwig.dog"] = "https://oolong.ludwig.dog/${owner}/${repository}/compare/${target}...${branch_name}",
},
})
---- Comment.nvim
require("Comment").setup()
---- Telescope
local telescope = require("telescope")
telescope.setup({
defaults = {
file_ignore_patterns = { "%.avif", "%.jpg", "%.pdf", "%.png", "%.webp" },
},
pickers = {
find_files = {
find_command = { "fd", "--type", "f", "--hidden", "--exclude", ".git", "--exclude", ".gitmodules" },
},
},
})
telescope.load_extension("fzy_native")
telescope.load_extension("luasnip")
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<Leader>f", builtin.find_files)
vim.keymap.set("n", "<Leader>b", builtin.buffers)
vim.keymap.set("n", "<Leader>/", builtin.current_buffer_fuzzy_find)
vim.keymap.set("n", "<Leader>g", builtin.live_grep)
vim.keymap.set("n", "<Leader>cg", builtin.grep_string)
vim.keymap.set("n", "<Leader>:", builtin.commands)
vim.keymap.set("n", "<Leader>s", telescope.extensions.luasnip.luasnip)
---- nvim-dap ---- nvim-dap
-- vim.g.dap_loaded = false -- vim.g.dap_loaded = false
-- vim.api.nvim_create_autocmd({ "FileType" }, { -- vim.api.nvim_create_autocmd({ "FileType" }, {
@ -605,148 +150,44 @@ vim.keymap.set("n", "<Leader>s", telescope.extensions.luasnip.luasnip)
-- require("dap-go").setup() -- require("dap-go").setup()
-- end, -- end,
-- }) -- })
--
---- web-devicons --
require("nvim-web-devicons").setup() -- ---- neotest
-- vim.g.neotest_loaded = false
---- nvim-osc52 -- vim.api.nvim_create_autocmd({ "FileType" }, {
vim.keymap.set("n", "<leader>y", require("osc52").copy_operator, { expr = true }) -- pattern = { "rust" },
vim.keymap.set("n", "<leader>yy", "<leader>y_", { remap = true }) -- callback = function()
vim.keymap.set("v", "<leader>y", require("osc52").copy_visual) -- if vim.g.neotest_loaded then
-- return
---- crates -- end
vim.g.crates_loaded = false -- vim.g.neotest_loaded = true
vim.api.nvim_create_autocmd({ "BufEnter" }, { -- vim.cmd("packadd nvim-nio")
pattern = { "Cargo.toml" }, -- vim.cmd("packadd neotest")
callback = function() -- vim.cmd("packadd neotest-rust")
if vim.g.crates_loaded then --
return -- local neotest = require("neotest")
end -- neotest.setup({
vim.g.crates_loaded = true -- adapters = {
vim.cmd("packadd crates.nvim") -- require("neotest-rust") {
-- args = { "--no-capture" },
local crates = require("crates") -- dap_adapter = "lldb",
crates.setup({ -- },
completion = { -- },
crates = { -- })
enabled = true, -- vim.keymap.set("n", "<leader>tr", function()
max_results = 5, -- neotest.run.run()
min_chars = 3, -- end)
} -- vim.keymap.set("n", "<leader>td", function()
}, -- neotest.run.run({ strategy = "dap" })
lsp = { -- end)
enabled = true, -- vim.keymap.set("n", "<leader>tf", function()
on_attach = on_lsp_attach, -- neotest.run.run(vim.fn.expand("%"))
actions = true, -- end)
completion = true, -- vim.keymap.set("n", "<leader>ts", function()
hover = true, -- neotest.run.stop()
} -- end)
}) -- vim.keymap.set("n", "<leader>tt", function()
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup) -- neotest.summary.toggle()
vim.keymap.set("n", "<leader>cf", crates.show_features_popup) -- end)
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup) -- end,
vim.keymap.set("n", "<leader>cu", crates.update_crate) -- })
vim.keymap.set("v", "<leader>cu", crates.update_crates)
vim.keymap.set("n", "<leader>cA", crates.update_all_crates)
vim.keymap.set("n", "<leader>cD", crates.open_documentation)
end,
})
---- neotest
vim.g.neotest_loaded = false
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "rust" },
callback = function()
if vim.g.neotest_loaded then
return
end
vim.g.neotest_loaded = true
vim.cmd("packadd nvim-nio")
vim.cmd("packadd neotest")
vim.cmd("packadd neotest-rust")
local neotest = require("neotest")
neotest.setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
dap_adapter = "lldb",
},
},
})
vim.keymap.set("n", "<leader>tr", function()
neotest.run.run()
end)
vim.keymap.set("n", "<leader>td", function()
neotest.run.run({ strategy = "dap" })
end)
vim.keymap.set("n", "<leader>tf", function()
neotest.run.run(vim.fn.expand("%"))
end)
vim.keymap.set("n", "<leader>ts", function()
neotest.run.stop()
end)
vim.keymap.set("n", "<leader>tt", function()
neotest.summary.toggle()
end)
end,
})
---- nvim-surround
require("nvim-surround").setup()
---- nvim-spider
-- we need to use the ex-command version to call the commands to allow dot repeatability
-- see: https://github.com/chrisgrieser/nvim-spider#installation
vim.keymap.set({ "n", "o", "x" }, "w", "<cmd>lua require('spider').motion('w')<CR>", { desc = "Spider-w" })
vim.keymap.set({ "n", "o", "x" }, "e", "<cmd>lua require('spider').motion('e')<CR>", { desc = "Spider-e" })
vim.keymap.set({ "n", "o", "x" }, "b", "<cmd>lua require('spider').motion('b')<CR>", { desc = "Spider-b" })
vim.keymap.set({ "n", "o", "x" }, "ge", "<cmd>lua require('spider').motion('ge')<CR>", { desc = "Spider-ge" })
---- colorizer
require 'colorizer'.setup({
user_default_options = {
names = false,
css_fn = true,
}
})
---- ferris.nvim
vim.g.ferris_loaded = false
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "rust" },
callback = function()
if vim.g.ferris_loaded then
return
end
vim.g.ferris_loaded = true
vim.cmd("packadd ferris.nvim")
require("ferris").setup()
vim.keymap.set("n", "<leader>od", require("ferris.methods.open_documentation"))
end,
})
---- typst-preview
vim.g.typst_loaded = false
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "typst" },
callback = function()
if vim.g.typst_loaded then
return
end
vim.g.typst_loaded = true
vim.cmd("packadd core.nvim")
vim.cmd("packadd typst-preview.nvim")
local typst_preview = require("typst-preview")
typst_preview.setup({
preview = function(output_file)
require("core").job.spawn("xdg-open", {
output_file,
}, {}, function() end, function() end, function() end)
end,
})
typst_preview.preview()
end,
})

39
lazy-lock.json Normal file
View file

@ -0,0 +1,39 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"completion-buffers": { "branch": "master", "commit": "c36871b2a44b59761387f4972c617b44dcec5e75" },
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" },
"core.nvim": { "branch": "main", "commit": "26ada48758e73ff3763ac134a9a0da320a7762e4" },
"crates.nvim": { "branch": "main", "commit": "5a24e3ba60e28e0cfde540696630b3c5a4db6dfd" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"ferris.nvim": { "branch": "main", "commit": "b9cd307a4bb3de6d87fc5da26f0f2775f4e2873a" },
"fluent.vim": { "branch": "master", "commit": "86f60ebc5dc6ee52c1b7676aa2c950eb4b9af06a" },
"git-blame.nvim": { "branch": "master", "commit": "8c56e864d448e84e0162872c381dd2715824dce2" },
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
"gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" },
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
"lsp_lines.nvim": { "branch": "main", "commit": "7d9e2748b61bff6ebba6e30adbc7173ccf21c055" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"neogit": { "branch": "master", "commit": "e0a8674ac6b6048e1e4d364645dc605ac789bc4a" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" },
"nvim-lint": { "branch": "master", "commit": "99cab0b885aaa2f59736c047d23e9a7835d4f9a9" },
"nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" },
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
"nvim-rc": { "branch": "main", "commit": "1d86e61e2256789b23da5071f21a973587e87e66" },
"nvim-spider": { "branch": "main", "commit": "b1c542a78522d59432a827f6ec2b28f9422c7e7f" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "3c6af36794b26e1bcac3f126b43e0f646154725d" },
"nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope-luasnip.nvim": { "branch": "master", "commit": "11668478677de360dea45cf2b090d34f21b8ae07" },
"telescope.nvim": { "branch": "master", "commit": "0df05c9e9f791dbc542c1fb612195f4dc97209b6" },
"typst-preview.nvim": { "branch": "main", "commit": "44404d931c2508a839c1770ae0decab5f068fae2" },
"typst.vim": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" },
"vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" },
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
}

31
lua/lazy-nvim.lua Normal file
View file

@ -0,0 +1,31 @@
---- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
---@diagnostic disable-next-line: undefined-field
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "gruvbox" } },
change_detection = {
enabled = false,
},
})

48
lua/plugins/cmp.lua Normal file
View file

@ -0,0 +1,48 @@
return {
{
"hrsh7th/nvim-cmp",
opts = function()
local cmp = require("cmp")
---@diagnostic disable-next-line: redundant-parameter
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
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(),
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
{ name = "crates" },
}),
})
end
},
{
"steelsojka/completion-buffers",
dependencies = {
"hrsh7th/nvim-cmp",
},
enabled = false,
},
{
"hrsh7th/cmp-path",
},
{
"saadparwaiz1/cmp_luasnip",
}
}

12
lua/plugins/color.lua Normal file
View file

@ -0,0 +1,12 @@
return {
{
"NvChad/nvim-colorizer.lua",
event = "VeryLazy",
opts = {
user_default_options = {
names = false,
css_fn = true,
}
}
},
}

View file

@ -0,0 +1,7 @@
return {
{
"npxbr/gruvbox.nvim",
lazy = false,
priority = 1000,
},
}

6
lua/plugins/comment.lua Normal file
View file

@ -0,0 +1,6 @@
return {
{
"numToStr/Comment.nvim",
lazy = true,
},
}

36
lua/plugins/conform.lua Normal file
View file

@ -0,0 +1,36 @@
return {
{
"stevearc/conform.nvim",
lazy = true,
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<F3>",
function()
require("conform").format({ async = true })
end,
mode = "",
desc = "Format buffer",
},
},
opts = {
formatters_by_ft = {
terraform = { "terraform_ft" },
},
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = { timeout_ms = 500 },
-- Customize formatters
formatters = {
shfmt = {
prepend_args = { "-i", "2" },
},
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
},
}

11
lua/plugins/filetypes.lua Normal file
View file

@ -0,0 +1,11 @@
return {
{
"projectfluent/fluent.vim"
},
{
"https://github.com/isobit/vim-caddyfile",
},
{
"towolf/vim-helm",
}
}

64
lua/plugins/git.lua Normal file
View file

@ -0,0 +1,64 @@
return {
{
"lewis6991/gitsigns.nvim",
event = "VeryLazy",
opts = {
on_attach = function(_bufnr)
local gs = package.loaded.gitsigns
-- Navigation
vim.keymap.set("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
vim.keymap.set("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
end,
}
},
{
"f-person/git-blame.nvim",
lazy = true,
keys = {
{ "<leader>oc", ":GitBlameOpenCommitURL<CR>", desc = "Open Commit URL" },
{ "<leader>tb", ":GitBlameToggle<CR>", desc = "Git blame toggle" },
},
opts = {
enabled = false,
},
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim"
},
lazy = true,
cmd = { "Neogit" },
opts = {
git_services = {
["azure.com"] =
"https://dev.azure.com/${owner}/_git/${repository}/pullrequestcreate?sourceRef=${branch_name}&targetRef=${target}",
["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1",
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
["gitlab.com"] =
"https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
["codeberg.org"] = "https://codeberg.org/${owner}/${repository}/compare/${target}...${branch_name}",
["oolong.ludwig.dog"] = "https://oolong.ludwig.dog/${owner}/${repository}/compare/${target}...${branch_name}",
},
}
}
}

79
lua/plugins/lint.lua Normal file
View file

@ -0,0 +1,79 @@
return {
{
"mfussenegger/nvim-lint",
event = "VeryLazy",
config = function()
local lint = require("lint")
-- sqlfluff --
lint.linters.sqlfluff.args = {
"lint",
"--format=json",
"--dialect=postgres",
}
-- yamllint --
lint.linters.yamllint.args = {
args = { "--format=parsable", "-d relaxed" },
}
-- actionlint --
---- Set custom filetype to not lint everything
--- https://github.com/mfussenegger/nvim-lint/issues/591#issuecomment-2142162704
vim.filetype.add({
pattern = {
['.*/.github/workflows/.*%.yml'] = 'yaml.ghaction',
['.*/.github/workflows/.*%.yaml'] = 'yaml.ghaction',
},
})
local linters = {
bash = { "shellcheck" },
dockerfile = { "hadolint" },
ghaction = { "actionlint" },
go = { "golangcilint" },
sql = { "sqlfluff" },
yaml = { "yamllint" },
}
-- set linters --
lint.linters_by_ft = linters
-- set autocommands --
for ft, ft_linters in pairs(linters) do
local on_change = false
local on_write = false
for _, l in ipairs(ft_linters) do
if lint.linters[l].stdin then
on_change = true
else
on_write = true
end
end
if on_change then
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = ft,
callback = function()
vim.api.nvim_create_autocmd({ "TextChanged" }, {
callback = function()
lint.try_lint(nil, { ignore_errors = true })
end,
})
end,
})
end
if on_write then
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = ft,
callback = function()
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
lint.try_lint(nil, { ignore_errors = true })
end,
})
-- we want to also call linters here so we don't wait
-- for the first write to happen
lint.try_lint(nil, { ignore_errors = true })
end,
})
end
end
end
},
}

104
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,104 @@
local on_lsp_attach = function(_client, _bufnr)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration)
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
vim.keymap.set("n", "K", vim.lsp.buf.hover)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help)
vim.keymap.set("n", "<Leader>D", vim.lsp.buf.type_definition)
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename)
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action)
vim.keymap.set("n", "gr", vim.lsp.buf.references)
vim.keymap.set("n", "<Leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<Leader>q", vim.diagnostic.setloclist)
end
return {
{
"neovim/nvim-lspconfig",
event = "VeryLazy",
config = function()
local lsp = require("lspconfig")
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = {
clangd = {
filetypes = { "c", "cpp" }
},
dotls = {},
eslint = {},
gopls = {},
jsonls = {},
kotlin_language_server = {},
lua_ls = {
settings = {
Lua = {
runtime = { version = "LuaJIT" },
diagnostics = {
globals = { "vim" },
unusedLocalExclude = { "_*" },
},
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = { enable = false },
},
},
},
pylsp = {},
rust_analyzer = {
settings = {
['rust-analyzer'] = {
cargo = {
features = "all"
}
}
}
},
taplo = {},
texlab = {},
tflint = {},
ts_ls = {},
biome = {
cmd = { "pnpm", "exec", "biome", "lsp-proxy" }
},
typst_lsp = {},
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lsp.util.default_config = vim.tbl_deep_extend("force", lsp.util.default_config, { capabilities = capabilities })
for server, add_to_config in pairs(servers) do
local config = {
on_attach = on_lsp_attach,
flags = {
debounce_text_changes = 150,
},
}
for k, v in pairs(add_to_config) do
config[k] = v
end
lsp[server].setup(config)
end
end
},
{
"hrsh7th/cmp-nvim-lsp",
lazy = true,
},
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
enabled = false,
opts = {},
init = function()
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
})
end
}
}

66
lua/plugins/lualine.lua Normal file
View file

@ -0,0 +1,66 @@
return {
{
'nvim-lualine/lualine.nvim',
config = function ()
local lualine = require("lualine")
local theme = require("lualine.themes.gruvbox")
theme.terminal = theme.insert
lualine.setup({
options = {
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
theme = theme,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "diagnostics" },
lualine_c = {
{
"filename",
path = 1,
},
},
lualine_x = {
{
"fileformat",
cond = function()
return vim.bo.fileformat ~= "unix"
end,
},
{
"encoding",
cond = function()
return vim.bo.fileencoding ~= "utf-8"
end,
},
},
lualine_y = {
{
"filetype",
icons_enabled = false,
symbols = {
modified = "",
readonly = "",
unnamed = "",
new = "󰎔",
},
},
},
lualine_z = { "searchcount", "progress", "location" },
},
tabline = {
lualine_a = {
{
"buffers",
show_filename_only = false,
max_length = function()
return math.max(math.ceil(vim.o.columns * 2 / 3), vim.o.columns - 6)
end,
},
},
lualine_z = { "tabs" },
},
})
end
},
}

30
lua/plugins/luasnip.lua Normal file
View file

@ -0,0 +1,30 @@
return {
{
"L3MON4D3/LuaSnip",
version = "v2.3",
lazy = true,
config = function()
local luasnip = require("luasnip")
require("luasnip.loaders.from_lua").lazy_load()
luasnip.config.set_config({
store_selection_keys = "<c-s>",
})
vim.keymap.set({ "i", "s" }, "<Tab>", function()
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<Tab>", true, false, true),
"n", -- noremap to avoid infinite recursion
true
)
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
if luasnip.jumpable(-1) then
luasnip.jump(-1)
end
end, { silent = true })
end
},
}

5
lua/plugins/nvim-rc.lua Normal file
View file

@ -0,0 +1,5 @@
return {
{
"Dkendal/nvim-rc",
},
}

16
lua/plugins/osc52.lua Normal file
View file

@ -0,0 +1,16 @@
return {
{
"ojroques/nvim-osc52",
lazy = true,
keys = {
{"<Leader>y", desc = "OSC52 copy"},
{"<Leader>yy", desc = "OSC52 line copy"},
{"<Leader>y", mode = "v", desc = "OSC52 copy"},
},
config = function()
vim.keymap.set("n", "<leader>y", require("osc52").copy_operator, { expr = true })
vim.keymap.set("n", "<leader>yy", "<leader>y_", { remap = true })
vim.keymap.set("v", "<leader>y", require("osc52").copy_visual)
end
},
}

40
lua/plugins/rust.lua Normal file
View file

@ -0,0 +1,40 @@
return {
{
"Saecki/crates.nvim",
lazy = true,
event = { "BufEnter Cargo.toml" },
config = function()
local crates = require("crates")
crates.setup({
completion = {
crates = {
enabled = true,
max_results = 5,
min_chars = 3,
}
},
lsp = {
enabled = true,
on_attach = require("lsp").on_lsp_attach,
actions = true,
completion = true,
hover = true,
}
})
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup)
vim.keymap.set("n", "<leader>cf", crates.show_features_popup)
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup)
vim.keymap.set("n", "<leader>cu", crates.update_crate)
vim.keymap.set("v", "<leader>cu", crates.update_crates)
vim.keymap.set("n", "<leader>cA", crates.update_all_crates)
vim.keymap.set("n", "<leader>cD", crates.open_documentation)
end,
},
{
"vxpm/ferris.nvim",
ft = { "rust" },
init = function()
vim.keymap.set("n", "<leader>od", require("ferris.methods.open_documentation"))
end
},
}

12
lua/plugins/spider.lua Normal file
View file

@ -0,0 +1,12 @@
return {
{
"chrisgrieser/nvim-spider",
lazy = true,
keys = {
{ "e", "<cmd>lua require('spider').motion('e')<CR>", mode = { "n", "o", "x" }, desc = "Spider-e" },
{ "w", "<cmd>lua require('spider').motion('w')<CR>", mode = { "n", "o", "x" }, desc = "Spider-w" },
{ "b", "<cmd>lua require('spider').motion('b')<CR>", mode = { "n", "o", "x" }, desc = "Spider-b" },
{ "ge", "<cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
},
},
}

10
lua/plugins/surround.lua Normal file
View file

@ -0,0 +1,10 @@
return {
{
"kylechui/nvim-surround",
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end
}
}

46
lua/plugins/telescope.lua Normal file
View file

@ -0,0 +1,46 @@
return {
{
"nvim-telescope/telescope.nvim",
lazy = true,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
},
keys = {
{"<Leader>b", require("telescope.builtin").buffers, desc = "Telescope buffers"},
{"<Leader>f", require("telescope.builtin").find_files, desc = "Telescope find files"},
{"<Leader>g", require("telescope.builtin").live_grep, desc = "Telescope live grep"},
{"<Leader>/", require("telescope.builtin").current_buffer_fuzzy_find, desc = "Telescope current buffer fuzzy find"},
},
config = function()
local telescope = require("telescope")
telescope.setup({
defaults = {
file_ignore_patterns = { "%.avif", "%.jpg", "%.pdf", "%.png", "%.webp" },
},
pickers = {
find_files = {
find_command = { "fd", "--type", "f", "--hidden", "--exclude", ".git", "--exclude", ".gitmodules" },
},
},
})
-- telescope.load_extension("fzy_native")
telescope.load_extension("luasnip")
local builtin = require("telescope.builtin")
-- vim.keymap.set("n", "<Leader>f", builtin.find_files)
-- vim.keymap.set("n", "<Leader>b", builtin.buffers)
-- vim.keymap.set("n", "<Leader>/", builtin.current_buffer_fuzzy_find)
-- vim.keymap.set("n", "<Leader>g", builtin.live_grep)
vim.keymap.set("n", "<Leader>cg", builtin.grep_string)
vim.keymap.set("n", "<Leader>:", builtin.commands)
vim.keymap.set("n", "<Leader>s", telescope.extensions.luasnip.luasnip)
end
},
{
"benfowler/telescope-luasnip.nvim",
}
}

View file

@ -0,0 +1,97 @@
return {
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
config = function()
require("nvim-treesitter.configs").setup({
auto_install = true,
sync_install = false,
ignore_install = {},
modules = {}, -- not used, but it will silence lua_ls
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<Leader><Enter>",
node_incremental = "<Enter>",
node_decremental = "<BS>",
},
},
ensure_installed = {
"bash",
"c",
"cmake",
"comment",
"cpp",
"css",
"csv",
"diff",
"dockerfile",
"dot",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"html",
"htmldjango",
"http",
"ini",
"javascript",
"json",
"kdl",
"kotlin",
"latex",
"lua",
"make",
"markdown",
"markdown_inline",
"mermaid",
"passwd",
"perl",
"php",
"proto",
"python",
"query",
"regex",
"ron",
"rst",
"rust",
"scss",
"sql",
"terraform",
"toml",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
highlight = { enable = true, indent = true },
playground = {
enable = false,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = 'o',
toggle_hl_groups = 'i',
toggle_injected_languages = 't',
toggle_anonymous_nodes = 'a',
toggle_language_display = 'I',
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
show_help = '?',
},
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
})
end
}
}

19
lua/plugins/typst.lua Normal file
View file

@ -0,0 +1,19 @@
return {
{
"kaarmu/typst.vim",
ft = "typst",
lazy = false,
},
{
"niuiic/typst-preview.nvim",
ft = "typst",
dependencies = { "niuiic/core.nvim" },
opts = {
preview = function(output_file)
require("core").job.spawn("xdg-open", {
output_file,
}, {}, function() end, function() end, function() end)
end,
},
},
}

@ -1 +0,0 @@
Subproject commit 26ada48758e73ff3763ac134a9a0da320a7762e4

@ -1 +0,0 @@
Subproject commit 891063a2dc8471501b9742406a514be62a20c138

@ -1 +0,0 @@
Subproject commit b9cd307a4bb3de6d87fc5da26f0f2775f4e2873a

@ -1 +0,0 @@
Subproject commit 6325906730330105a9adc41d0ceb8499b3072e2b

@ -1 +0,0 @@
Subproject commit 32ff2ac21135a372a42b38ae131e531e64833bd3

@ -1 +0,0 @@
Subproject commit 0418811e1e3499b2501593f2e131d02f5e6823d4

@ -1 +0,0 @@
Subproject commit 281a2e4cd1e7a17cea7ecb1745d84a8ab1249925

@ -1 +0,0 @@
Subproject commit 5511788255c92bdd845f8d9690f88e2e0f0ff9f2

@ -1 +0,0 @@
Subproject commit a5606bc5958db86f8d92803bea7400ee26a8d7e4

@ -1 +0,0 @@
Subproject commit a428f309119086dc78dd4b19306d2d67be884eee

@ -1 +0,0 @@
Subproject commit 44404d931c2508a839c1770ae0decab5f068fae2

@ -1 +0,0 @@
Subproject commit e30b7f2008e52442154b66f7c519bfd2f1e32acb

@ -1 +0,0 @@
Subproject commit 7ad2eaeaca56d6ed63acacbfc114b99f1f67b982

@ -1 +0,0 @@
Subproject commit 3022dbc9166796b644a841a02de8dd1cc1d311fa

@ -1 +0,0 @@
Subproject commit 39e2eda76828d88b773cc27a3f61d2ad782c922d

@ -1 +0,0 @@
Subproject commit 91ff86cd9c29299a64f968ebb45846c485725f23

@ -1 +0,0 @@
Subproject commit 05a9ab28b53f71d1aece421ef32fee2cb857a843

@ -1 +0,0 @@
Subproject commit 62eba813b7501b39612146cbf29cd07f1d4ac29c

@ -1 +0,0 @@
Subproject commit 4516612fe98ff56ae0415a259ff6361a89419b0a

@ -1 +0,0 @@
Subproject commit 2278e05ec7fbb48e06b5d26319385e1c09325760

@ -1 +0,0 @@
Subproject commit ad246d34ce7a32f752071ed81b09b94e6b127fad

@ -1 +0,0 @@
Subproject commit 50543e3993f4b996eea01ff5ccc8fe2a354c5388

@ -1 +0,0 @@
Subproject commit 562dc47189ad3c8696dbf460d38603a74d544849

@ -1 +0,0 @@
Subproject commit 7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e

@ -1 +0,0 @@
Subproject commit 7d9e2748b61bff6ebba6e30adbc7173ccf21c055

@ -1 +0,0 @@
Subproject commit b431d228b7bbcdaea818bdc3e25b8cdbe861f056

@ -1 +0,0 @@
Subproject commit 45a79ec4acb5af783a6a29673a999ce37f00497e

@ -1 +0,0 @@
Subproject commit 2b74a777b963dfdeeabfabf84d5ba611666adab4

@ -1 +0,0 @@
Subproject commit ae644feb7b67bf1ce4260c231d1d4300b19c6f30

@ -1 +0,0 @@
Subproject commit 194ec600488f7c7229668d0e80bd197f3a2b84ff

@ -1 +0,0 @@
Subproject commit debabca63c0905b59ce596a55a8e33eafdf66342

@ -1 +0,0 @@
Subproject commit dddd0945c0f31a0abd843425927a1712d2db2e10

@ -1 +0,0 @@
Subproject commit 04cfaba1865ae5c53b6f887c3ca7304973824fb2

@ -1 +0,0 @@
Subproject commit 1d86e61e2256789b23da5071f21a973587e87e66

@ -1 +0,0 @@
Subproject commit 7641ce03636633b986493fc6f52d5051cb1375ce

@ -1 +0,0 @@
Subproject commit ec2dc7671067e0086cdf29c2f5df2dd909d5f71f

@ -1 +0,0 @@
Subproject commit 6699eae8ba4551fe927da0f0f3f61ae085f836aa

@ -1 +0,0 @@
Subproject commit 3722e3d1fb5fe1896a104eb489e8f8651260b520

@ -1 +0,0 @@
Subproject commit ba48c6a62a280eefb7c85725b0915e021a1a0749

@ -1 +0,0 @@
Subproject commit ec289423a1693aeae6cd0d503bac2856af74edaa

@ -1 +0,0 @@
Subproject commit b7404d35d5d3548a82149238289fa71f7f6de4ac

@ -1 +0,0 @@
Subproject commit 282f069504515eec762ab6d6c89903377252bf5b

@ -1 +0,0 @@
Subproject commit 11668478677de360dea45cf2b090d34f21b8ae07

@ -1 +0,0 @@
Subproject commit 5972437de807c3bc101565175da66a1aa4f8707a

@ -1 +0,0 @@
Subproject commit 4d18ced62599ffe5b3c0e5e49566d5456121bc02

@ -1 +0,0 @@
Subproject commit 24fe0720551883e407cb70ae1d7c03f162d1d5a0

@ -1 +0,0 @@
Subproject commit ae1ebc160d2b9b90108477ab10df7a4fc501e358