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