feat: Switch from spaces to tabs for indenting my config
This commit is contained in:
parent
cf9f8c40fc
commit
f073cca3b6
16
init.lua
16
init.lua
|
@ -3,14 +3,14 @@ vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
extension = {
|
extension = {
|
||||||
typ = function(_, bufnr)
|
typ = function(_, bufnr)
|
||||||
vim.bo[bufnr].shiftwidth = 2
|
vim.bo[bufnr].shiftwidth = 2
|
||||||
vim.bo[bufnr].tabstop = 2
|
vim.bo[bufnr].tabstop = 2
|
||||||
return "typst"
|
return "typst"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "mocha",
|
flavour = "mocha",
|
||||||
integrations = {
|
integrations = {
|
||||||
treesitter = true,
|
treesitter = true,
|
||||||
},
|
},
|
||||||
transparent_background = true,
|
transparent_background = true,
|
||||||
})
|
})
|
||||||
vim.cmd.colorscheme("catppuccin")
|
vim.cmd.colorscheme("catppuccin")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +1,66 @@
|
||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- base
|
-- base
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
"hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-cmdline",
|
||||||
-- snippets
|
-- snippets
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
-- documentation = cmp.config.window.bordered(),
|
-- documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp", priority = 2 },
|
{ name = "nvim_lsp", priority = 2 },
|
||||||
{ name = "luasnip", priority = 1 },
|
{ name = "luasnip", priority = 1 },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
vim.api.nvim_create_autocmd("BufRead", {
|
||||||
group = vim.api.nvim_create_augroup("CmpSourceCargo", { clear = true }),
|
group = vim.api.nvim_create_augroup("CmpSourceCargo", { clear = true }),
|
||||||
pattern = "Cargo.toml",
|
pattern = "Cargo.toml",
|
||||||
callback = function()
|
callback = function()
|
||||||
cmp.setup.buffer({ sources = { { name = "crates" } } })
|
cmp.setup.buffer({ sources = { { name = "crates" } } })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won"t work anymore).
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won"t work anymore).
|
||||||
cmp.setup.cmdline({ "/", "?" }, {
|
cmp.setup.cmdline({ "/", "?" }, {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore).
|
-- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore).
|
||||||
cmp.setup.cmdline(":", {
|
cmp.setup.cmdline(":", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
}, {
|
}, {
|
||||||
{ name = "cmdline" },
|
{ name = "cmdline" },
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
return {
|
return {
|
||||||
"freddiehaddad/feline.nvim",
|
"freddiehaddad/feline.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,71 +1,71 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
yadm = {
|
yadm = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
local function map(mode, l, r, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
opts.buffer = bufnr
|
opts.buffer = bufnr
|
||||||
vim.keymap.set(mode, l, r, opts)
|
vim.keymap.set(mode, l, r, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Navigation
|
-- Navigation
|
||||||
map("n", "]c", function()
|
map("n", "]c", function()
|
||||||
if vim.wo.diff then
|
if vim.wo.diff then
|
||||||
return "]c"
|
return "]c"
|
||||||
end
|
end
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
gs.next_hunk()
|
gs.next_hunk()
|
||||||
end)
|
end)
|
||||||
return "<Ignore>"
|
return "<Ignore>"
|
||||||
end, { expr = true })
|
end, { expr = true })
|
||||||
|
|
||||||
map("n", "[c", function()
|
map("n", "[c", function()
|
||||||
if vim.wo.diff then
|
if vim.wo.diff then
|
||||||
return "[c"
|
return "[c"
|
||||||
end
|
end
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
gs.prev_hunk()
|
gs.prev_hunk()
|
||||||
end)
|
end)
|
||||||
return "<Ignore>"
|
return "<Ignore>"
|
||||||
end, { expr = true })
|
end, { expr = true })
|
||||||
|
|
||||||
-- Actions
|
-- Actions
|
||||||
map("n", "<leader>hs", gs.stage_hunk)
|
map("n", "<leader>hs", gs.stage_hunk)
|
||||||
map("n", "<leader>hr", gs.reset_hunk)
|
map("n", "<leader>hr", gs.reset_hunk)
|
||||||
map("v", "<leader>hs", function()
|
map("v", "<leader>hs", function()
|
||||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
end)
|
end)
|
||||||
map("v", "<leader>hr", function()
|
map("v", "<leader>hr", function()
|
||||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
end)
|
end)
|
||||||
map("n", "<leader>hS", gs.stage_buffer)
|
map("n", "<leader>hS", gs.stage_buffer)
|
||||||
map("n", "<leader>hu", gs.undo_stage_hunk)
|
map("n", "<leader>hu", gs.undo_stage_hunk)
|
||||||
map("n", "<leader>hR", gs.reset_buffer)
|
map("n", "<leader>hR", gs.reset_buffer)
|
||||||
map("n", "<leader>hp", gs.preview_hunk)
|
map("n", "<leader>hp", gs.preview_hunk)
|
||||||
map("n", "<leader>hb", function()
|
map("n", "<leader>hb", function()
|
||||||
gs.blame_line({ full = true })
|
gs.blame_line({ full = true })
|
||||||
end)
|
end)
|
||||||
map("n", "<leader>tb", gs.toggle_current_line_blame)
|
map("n", "<leader>tb", gs.toggle_current_line_blame)
|
||||||
map("n", "<leader>hd", gs.diffthis)
|
map("n", "<leader>hd", gs.diffthis)
|
||||||
map("n", "<leader>hD", function()
|
map("n", "<leader>hD", function()
|
||||||
gs.diffthis("~")
|
gs.diffthis("~")
|
||||||
end)
|
end)
|
||||||
map("n", "<leader>td", gs.toggle_deleted)
|
map("n", "<leader>td", gs.toggle_deleted)
|
||||||
|
|
||||||
-- Text object
|
-- Text object
|
||||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"Saecki/crates.nvim",
|
"Saecki/crates.nvim",
|
||||||
tag = "stable",
|
tag = "stable",
|
||||||
init = function()
|
init = function()
|
||||||
local crates = require("crates")
|
local crates = require("crates")
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
pattern = "Cargo.toml",
|
pattern = "Cargo.toml",
|
||||||
group = vim.api.nvim_create_augroup("UserCratesNvimConfig", {}),
|
group = vim.api.nvim_create_augroup("UserCratesNvimConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
local opts = { silent = true, buffer = ev.buffer }
|
local opts = { silent = true, buffer = ev.buffer }
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ct", crates.toggle, opts)
|
vim.keymap.set("n", "<leader>ct", crates.toggle, opts)
|
||||||
vim.keymap.set("n", "<leader>cr", crates.reload, opts)
|
vim.keymap.set("n", "<leader>cr", crates.reload, opts)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup, opts)
|
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup, opts)
|
||||||
vim.keymap.set("n", "<leader>cf", crates.show_features_popup, opts)
|
vim.keymap.set("n", "<leader>cf", crates.show_features_popup, opts)
|
||||||
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup, opts)
|
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup, opts)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>cu", crates.update_crate, opts)
|
vim.keymap.set("n", "<leader>cu", crates.update_crate, opts)
|
||||||
vim.keymap.set("v", "<leader>cu", crates.update_crates, opts)
|
vim.keymap.set("v", "<leader>cu", crates.update_crates, opts)
|
||||||
vim.keymap.set("n", "<leader>ca", crates.update_all_crates, opts)
|
vim.keymap.set("n", "<leader>ca", crates.update_all_crates, opts)
|
||||||
vim.keymap.set("n", "<leader>cU", crates.upgrade_crate, opts)
|
vim.keymap.set("n", "<leader>cU", crates.upgrade_crate, opts)
|
||||||
vim.keymap.set("v", "<leader>cU", crates.upgrade_crates, opts)
|
vim.keymap.set("v", "<leader>cU", crates.upgrade_crates, opts)
|
||||||
vim.keymap.set("n", "<leader>cA", crates.upgrade_all_crates, opts)
|
vim.keymap.set("n", "<leader>cA", crates.upgrade_all_crates, opts)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ce", crates.expand_plain_crate_to_inline_table, opts)
|
vim.keymap.set("n", "<leader>ce", crates.expand_plain_crate_to_inline_table, opts)
|
||||||
vim.keymap.set("n", "<leader>cE", crates.extract_crate_into_table, opts)
|
vim.keymap.set("n", "<leader>cE", crates.extract_crate_into_table, opts)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>cH", crates.open_homepage, opts)
|
vim.keymap.set("n", "<leader>cH", crates.open_homepage, opts)
|
||||||
vim.keymap.set("n", "<leader>cR", crates.open_repository, opts)
|
vim.keymap.set("n", "<leader>cR", crates.open_repository, opts)
|
||||||
vim.keymap.set("n", "<leader>cD", crates.open_documentation, opts)
|
vim.keymap.set("n", "<leader>cD", crates.open_documentation, opts)
|
||||||
vim.keymap.set("n", "<leader>cC", crates.open_crates_io, opts)
|
vim.keymap.set("n", "<leader>cC", crates.open_crates_io, opts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
opts = {},
|
opts = {},
|
||||||
event = "BufEnter Cargo.toml",
|
event = "BufEnter Cargo.toml",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"simrat39/rust-tools.nvim",
|
"simrat39/rust-tools.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
},
|
},
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
require("rust-tools").setup({
|
require("rust-tools").setup({
|
||||||
server = {
|
server = {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
check = {
|
check = {
|
||||||
command = "clippy",
|
command = "clippy",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
return {
|
return {
|
||||||
"scalameta/nvim-metals",
|
"scalameta/nvim-metals",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
ft = { "scala", "sbt" },
|
ft = { "scala", "sbt" },
|
||||||
opts = function()
|
opts = function()
|
||||||
local metals_config = require("metals").bare_config()
|
local metals_config = require("metals").bare_config()
|
||||||
|
|
||||||
metals_config.settings = {
|
metals_config.settings = {
|
||||||
showImplicitArguments = true,
|
showImplicitArguments = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
return metals_config
|
return metals_config
|
||||||
end,
|
end,
|
||||||
config = function(self, metals_config)
|
config = function(self, metals_config)
|
||||||
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = self.ft,
|
pattern = self.ft,
|
||||||
callback = function()
|
callback = function()
|
||||||
require("metals").initialize_or_attach(metals_config)
|
require("metals").initialize_or_attach(metals_config)
|
||||||
end,
|
end,
|
||||||
group = nvim_metals_group,
|
group = nvim_metals_group,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,111 +4,111 @@
|
||||||
--- @see vim.api.nvim_create_autocmd
|
--- @see vim.api.nvim_create_autocmd
|
||||||
--- @param filetype string The filetype to set for the matching buffers
|
--- @param filetype string The filetype to set for the matching buffers
|
||||||
local function bind_filetype(pattern, filetype)
|
local function bind_filetype(pattern, filetype)
|
||||||
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
||||||
pattern = pattern,
|
pattern = pattern,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.bo.filetype = filetype
|
vim.bo.filetype = filetype
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ import = "plugins/languages" },
|
{ import = "plugins/languages" },
|
||||||
{
|
{
|
||||||
"folke/neodev.nvim",
|
"folke/neodev.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
lspconfig = false,
|
lspconfig = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
},
|
},
|
||||||
config = function() end,
|
config = function() end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||||
|
|
||||||
-- Buffer local mappings.
|
-- Buffer local mappings.
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
local opts = { buffer = ev.buf }
|
local opts = { buffer = ev.buf }
|
||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||||
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
|
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
|
||||||
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
|
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
vim.keymap.set("n", "<space>wl", function()
|
vim.keymap.set("n", "<space>wl", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts)
|
end, opts)
|
||||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
|
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
|
||||||
vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, opts)
|
vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, opts)
|
||||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
|
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
|
||||||
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
|
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||||
vim.keymap.set({ "n", "i" }, "<C-space>", vim.lsp.buf.hover, opts)
|
vim.keymap.set({ "n", "i" }, "<C-space>", vim.lsp.buf.hover, opts)
|
||||||
vim.keymap.set("n", "<space>f", function()
|
vim.keymap.set("n", "<space>f", function()
|
||||||
vim.lsp.buf.format({ async = true })
|
vim.lsp.buf.format({ async = true })
|
||||||
end, opts)
|
end, opts)
|
||||||
vim.keymap.set("n", "<C-m>", "<cmd>Telescope lsp_document_symbols<cr>", opts)
|
vim.keymap.set("n", "<C-m>", "<cmd>Telescope lsp_document_symbols<cr>", opts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
bind_filetype("*.wgsl", "wgsl")
|
bind_filetype("*.wgsl", "wgsl")
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
handlers = {
|
handlers = {
|
||||||
-- default handler
|
-- default handler
|
||||||
function(server_name)
|
function(server_name)
|
||||||
lspconfig[server_name].setup({
|
lspconfig[server_name].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
-- overrides
|
-- overrides
|
||||||
["rust_analyzer"] = function()
|
["rust_analyzer"] = function()
|
||||||
require("lazy").load({ plugins = { "rust-tools.nvim" } })
|
require("lazy").load({ plugins = { "rust-tools.nvim" } })
|
||||||
end,
|
end,
|
||||||
["lua_ls"] = function()
|
["lua_ls"] = function()
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
before_init = require("neodev.lsp").before_init,
|
before_init = require("neodev.lsp").before_init,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
version = "LuaJIT",
|
version = "LuaJIT",
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
},
|
},
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,60 +1,60 @@
|
||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
branch = "v3.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
"mrbjarksen/neo-tree-diagnostics.nvim",
|
"mrbjarksen/neo-tree-diagnostics.nvim",
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
opts = {
|
opts = {
|
||||||
sources = {
|
sources = {
|
||||||
"filesystem",
|
"filesystem",
|
||||||
"buffers",
|
"buffers",
|
||||||
"git_status",
|
"git_status",
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
},
|
},
|
||||||
filesystem = {
|
filesystem = {
|
||||||
filtered_items = {
|
filtered_items = {
|
||||||
visible = true,
|
visible = true,
|
||||||
hide_dotfiles = false,
|
hide_dotfiles = false,
|
||||||
hide_gitignored = false,
|
hide_gitignored = false,
|
||||||
hide_hidden = false,
|
hide_hidden = false,
|
||||||
},
|
},
|
||||||
follow_current_file = {
|
follow_current_file = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
group_empty_dirs = true, -- Not working well
|
group_empty_dirs = true, -- Not working well
|
||||||
use_libuv_file_watcher = true,
|
use_libuv_file_watcher = true,
|
||||||
},
|
},
|
||||||
buffers = {
|
buffers = {
|
||||||
follow_current_file = {
|
follow_current_file = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
group_empty_dirs = true,
|
group_empty_dirs = true,
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
position = "right",
|
position = "right",
|
||||||
width = 30,
|
width = 30,
|
||||||
auto_expand_width = true,
|
auto_expand_width = true,
|
||||||
},
|
},
|
||||||
source_selector = {
|
source_selector = {
|
||||||
winbar = true,
|
winbar = true,
|
||||||
sources = {
|
sources = {
|
||||||
{ source = "filesystem" },
|
{ source = "filesystem" },
|
||||||
{ source = "buffers" },
|
{ source = "buffers" },
|
||||||
{ source = "diagnostics" },
|
{ source = "diagnostics" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<C-N>c", "<cmd>Neotree close<cr>", "Close Neotree" },
|
{ "<C-N>c", "<cmd>Neotree close<cr>", "Close Neotree" },
|
||||||
{ "<C-N>t", "<cmd>Neotree toggle<cr>", "Toggle Neotree" },
|
{ "<C-N>t", "<cmd>Neotree toggle<cr>", "Toggle Neotree" },
|
||||||
{ "<C-N>f", "<cmd>Neotree filesystem focus<cr>", "Focus filesystem in Neotree" },
|
{ "<C-N>f", "<cmd>Neotree filesystem focus<cr>", "Focus filesystem in Neotree" },
|
||||||
{ "<C-N>b", "<cmd>Neotree buffers focus<cr>", "Focus buffers in Neotree" },
|
{ "<C-N>b", "<cmd>Neotree buffers focus<cr>", "Focus buffers in Neotree" },
|
||||||
{ "<C-N>g", "<cmd>Neotree git_status focus<cr>", "Focus git status in Neotree" },
|
{ "<C-N>g", "<cmd>Neotree git_status focus<cr>", "Focus git status in Neotree" },
|
||||||
{ "<C-N>d", "<cmd>Neotree diagnostics focus<cr>", "Focus diagnostics in Neotree" },
|
{ "<C-N>d", "<cmd>Neotree diagnostics focus<cr>", "Focus diagnostics in Neotree" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.completion.spell,
|
null_ls.builtins.completion.spell,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jay-babu/mason-null-ls.nvim",
|
"jay-babu/mason-null-ls.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { "stylua" },
|
ensure_installed = { "stylua" },
|
||||||
handlers = {},
|
handlers = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
return {
|
return {
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
version = "v2.*",
|
version = "v2.*",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,29 @@
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
branch = "0.1.x",
|
branch = "0.1.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"BurntSushi/ripgrep",
|
"BurntSushi/ripgrep",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"sharkdp/fd",
|
"sharkdp/fd",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<C-t>f", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
|
{ "<C-t>f", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
|
||||||
{ "<C-p>", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
|
{ "<C-p>", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
|
||||||
{ "<C-t>b", "<cmd>Telescope buffers<cr>", desc = "Fuzzy find open buffers with Telescope" },
|
{ "<C-t>b", "<cmd>Telescope buffers<cr>", desc = "Fuzzy find open buffers with Telescope" },
|
||||||
{ "<C-t>s", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Fuzzy find lsp symbols in current document with Telescope" },
|
{
|
||||||
},
|
"<C-t>s",
|
||||||
opts = {
|
"<cmd>Telescope lsp_document_symbols<cr>",
|
||||||
pickers = {
|
desc = "Fuzzy find lsp symbols in current document with Telescope",
|
||||||
find_files = {
|
},
|
||||||
find_command = { "rg", "--files", "--hidden", "--no-ignore-vcs" },
|
},
|
||||||
},
|
opts = {
|
||||||
},
|
pickers = {
|
||||||
},
|
find_files = {
|
||||||
|
find_command = { "rg", "--files", "--hidden", "--no-ignore-vcs" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
vim.api.nvim_create_autocmd("TermOpen", {
|
vim.api.nvim_create_autocmd("TermOpen", {
|
||||||
group = vim.api.nvim_create_augroup("UserTerminalConfig", {}),
|
group = vim.api.nvim_create_augroup("UserTerminalConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
vim.opt_local.spell = false
|
vim.opt_local.spell = false
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
modules = {},
|
modules = {},
|
||||||
ensure_installed = { "lua", "rust" },
|
ensure_installed = { "lua", "rust" },
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
ignore_install = {},
|
ignore_install = {},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
return {
|
return {
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<A-u>",
|
"<A-u>",
|
||||||
function()
|
function()
|
||||||
vim.cmd.UndotreeToggle()
|
vim.cmd.UndotreeToggle()
|
||||||
vim.cmd.UndotreeFocus()
|
vim.cmd.UndotreeFocus()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
indent_type = "Spaces"
|
indent_type = "Tabs"
|
||||||
indent_width = 4
|
indent_width = 4
|
||||||
column_width = 120
|
column_width = 120
|
||||||
quote_style = "ForceDouble"
|
quote_style = "ForceDouble"
|
||||||
|
|
Loading…
Reference in a new issue