diff --git a/lua/holger/plugins/alpha.lua b/lua/holger/plugins/alpha.lua index c912f49..e5faac0 100644 --- a/lua/holger/plugins/alpha.lua +++ b/lua/holger/plugins/alpha.lua @@ -1,36 +1,36 @@ return { - "goolord/alpha-nvim", - event = "VimEnter", - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") + "goolord/alpha-nvim", + event = "VimEnter", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") - -- Set header - dashboard.section.header.val = { - " ", - " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", - " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", - " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", - " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", - " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", - " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", - " ", - } + -- Set header + dashboard.section.header.val = { + " ", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + " ", + } - -- Set menu - dashboard.section.buttons.val = { - dashboard.button("e", " > New File", "ene"), - dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), - dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), - dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), - dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), - dashboard.button("q", " > Quit NVIM", "qa"), - } + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), + dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), + dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "AutoSession restore"), + dashboard.button("q", " > Quit NVIM", "qa"), + } - -- Send config to alpha - alpha.setup(dashboard.opts) + -- Send config to alpha + alpha.setup(dashboard.opts) - -- Disable folding on alpha buffer - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) - end, + -- Disable folding on alpha buffer + vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + end, } diff --git a/lua/holger/plugins/auto-session.lua b/lua/holger/plugins/auto-session.lua index adeff79..64a062b 100644 --- a/lua/holger/plugins/auto-session.lua +++ b/lua/holger/plugins/auto-session.lua @@ -1,16 +1,16 @@ return { - "rmagatti/auto-session", - config = function() - local auto_session = require("auto-session") + "rmagatti/auto-session", + config = function() + local auto_session = require("auto-session") - auto_session.setup({ - auto_restore_enabled = false, - auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" }, - }) + auto_session.setup({ + auto_restore_enabled = false, + auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" }, + }) - local keymap = vim.keymap + local keymap = vim.keymap - keymap.set("n", "wr", "SessionRestore", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory - keymap.set("n", "ws", "SessionSave", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory - end, + keymap.set("n", "wr", "AutoSession restore", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory + keymap.set("n", "ws", "AutoSession save", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory + end, } diff --git a/lua/holger/plugins/formatting.lua b/lua/holger/plugins/formatting.lua index 074c931..c1178e6 100644 --- a/lua/holger/plugins/formatting.lua +++ b/lua/holger/plugins/formatting.lua @@ -1,39 +1,39 @@ return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local conform = require("conform") + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local conform = require("conform") - conform.setup({ - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - svelte = { "prettier" }, - css = { "prettier" }, - html = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - markdown = { "prettier" }, - graphql = { "prettier" }, - liquid = { "prettier" }, - lua = { "stylua" }, - python = { "isort", "black" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }, - }) + conform.setup({ + formatters_by_ft = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + svelte = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + liquid = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 3000, + }, + }) - vim.keymap.set({ "n", "v" }, "mp", function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }) - end, { desc = "Format file or range (in visual mode)" }) - end, + vim.keymap.set({ "n", "v" }, "mp", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, } diff --git a/lua/holger/plugins/linting.lua b/lua/holger/plugins/linting.lua index e9fea9b..9614883 100644 --- a/lua/holger/plugins/linting.lua +++ b/lua/holger/plugins/linting.lua @@ -1,29 +1,68 @@ return { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") + "mfussenegger/nvim-lint", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local lint = require("lint") - lint.linters_by_ft = { - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - svelte = { "eslint_d" }, - python = { "pylint" }, - } + lint.linters_by_ft = { + python = { "pylint" }, + } - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) + local function file_in_cwd(file_name) + return vim.fs.find(file_name, { + upward = true, + stop = vim.loop.cwd():match("(.+)/"), + path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), + type = "file", + })[1] + end - vim.keymap.set("n", "l", function() - lint.try_lint() - end, { desc = "Trigger linting for current file" }) - end, + local function remove_linter(linters, linter_name) + for k, v in pairs(linters) do + if v == linter_name then + linters[k] = nil + break + end + end + end + + local function linter_in_linters(linters, linter_name) + for k, v in pairs(linters) do + if v == linter_name then + return true + end + end + return false + end + + local function remove_linter_if_missing_config_file(linters, linter_name, config_file_name) + if linter_in_linters(linters, linter_name) and not file_in_cwd(config_file_name) then + remove_linter(linters, linter_name) + end + end + + local function try_linting() + local linters = lint.linters_by_ft[vim.bo.filetype] + + -- if linters then + -- -- remove_linter_if_missing_config_file(linters, "eslint_d", ".eslintrc.cjs") + -- remove_linter_if_missing_config_file(linters, "eslint_d", "eslint.config.js") + -- end + + lint.try_lint(linters) + end + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_augroup, + callback = function() + try_linting() + end, + }) + + vim.keymap.set("n", "l", function() + try_linting() + end, { desc = "Trigger linting for current file" }) + end, } diff --git a/lua/holger/plugins/lsp/lspconfig.lua b/lua/holger/plugins/lsp/lspconfig.lua index b632b4d..cb06496 100644 --- a/lua/holger/plugins/lsp/lspconfig.lua +++ b/lua/holger/plugins/lsp/lspconfig.lua @@ -1,101 +1,19 @@ return { - "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", event = { "BufReadPre", "BufNewFile" }, dependencies = { - "hrsh7th/cmp-nvim-lsp", { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, - -- Falls nicht bereits woanders eingebunden: - -- { "mason-org/mason-lspconfig.nvim", opts = {} }, + { "folke/lazydev.nvim", opts = {} }, }, config = function() - -- cmp capabilities global setzen (für alle Server) - local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- import cmp-nvim-lsp plugin + local cmp_nvim_lsp = require("cmp_nvim_lsp") + + -- used to enable autocompletion (assign to every lsp server config) + local capabilities = cmp_nvim_lsp.default_capabilities() + vim.lsp.config("*", { capabilities = capabilities, - }) -- :help lsp-config-merge - - -- Keymaps bei Attach (deins, unveraendert) - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), - callback = function(ev) - local keymap = vim.keymap - local opts = { buffer = ev.buf, silent = true } - - opts.desc = "Show LSP references" - keymap.set("n", "gR", "Telescope lsp_references", opts) - - opts.desc = "Go to declaration" - keymap.set("n", "gD", vim.lsp.buf.declaration, opts) - - opts.desc = "Show LSP definitions" - keymap.set("n", "gd", "Telescope lsp_definitions", opts) - - opts.desc = "Show LSP implementations" - keymap.set("n", "gi", "Telescope lsp_implementations", opts) - - opts.desc = "Show LSP type definitions" - keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) - - opts.desc = "See available code actions" - keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) - - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) - - opts.desc = "Show buffer diagnostics" - keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) - - opts.desc = "Show line diagnostics" - keymap.set("n", "d", vim.diagnostic.open_float, opts) - - opts.desc = "Go to previous diagnostic" - keymap.set("n", "[d", function() - vim.diagnostic.jump({ count = -1, float = true }) - end, opts) - - opts.desc = "Go to next diagnostic" - keymap.set("n", "]d", function() - vim.diagnostic.jump({ count = 1, float = true }) - end, opts) - - opts.desc = "Show documentation" - keymap.set("n", "K", vim.lsp.buf.hover, opts) - - opts.desc = "Restart LSP" - keymap.set("n", "rs", ":LspRestart", opts) - end, }) - - -- Diagnostics-UI - local x = vim.diagnostic.severity - vim.diagnostic.config({ - virtual_text = { prefix = "" }, - signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } }, - underline = true, - float = { border = "single" }, - }) - - -- Server-spezifisch: Lua - vim.lsp.config("lua_ls", { - settings = { - Lua = { - diagnostics = { globals = { "vim" } }, - completion = { callSnippet = "Replace" }, - }, - }, - }) - - -- (Optional) Mason-LSPConfig: Installer + kein Auto-Enable (wir enablen selbst) - local ok_mason, mason_lspconfig = pcall(require, "mason-lspconfig") - if ok_mason then - mason_lspconfig.setup({ - ensure_installed = { "html", "cssls", "tailwindcss", "lua_ls", "pyright" }, - automatic_enable = false, -- sonst wuerde Mason selbst enable() rufen - }) - end - - -- Neovim 0.11+: Server aktivieren (statt lspconfig[server].setup) - vim.lsp.enable({ "html", "cssls", "tailwindcss", "lua_ls", "pyright" }) end, } diff --git a/lua/holger/plugins/lsp/mason.lua b/lua/holger/plugins/lsp/mason.lua index b9e840e..bf7b51f 100644 --- a/lua/holger/plugins/lsp/mason.lua +++ b/lua/holger/plugins/lsp/mason.lua @@ -1,50 +1,48 @@ return { - "williamboman/mason.nvim", - dependencies = { + { "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - -- import mason - local mason = require("mason") - - -- import mason-lspconfig - local mason_lspconfig = require("mason-lspconfig") - - local mason_tool_installer = require("mason-tool-installer") - - -- enable mason and configure icons - mason.setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, - }) - - mason_lspconfig.setup({ + opts = { -- list of servers for mason to install ensure_installed = { + "ts_ls", "html", "cssls", "tailwindcss", "lua_ls", "pyright", + "eslint", }, - automatic_enable = false, - }) - - mason_tool_installer.setup({ + }, + dependencies = { + { + "williamboman/mason.nvim", + opts = { + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }, + }, + "neovim/nvim-lspconfig", + }, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + opts = { ensure_installed = { "prettier", -- prettier formatter "stylua", -- lua formatter "isort", -- python formatter "black", -- python formatter - "pylint", -- python linter - "eslint_d", -- js linter + "pylint", + "eslint_d", }, - }) - end, + }, + dependencies = { + "williamboman/mason.nvim", + }, + }, } diff --git a/lua/holger/plugins/nvim-cmp.lua b/lua/holger/plugins/nvim-cmp.lua index 0947011..57081cd 100644 --- a/lua/holger/plugins/nvim-cmp.lua +++ b/lua/holger/plugins/nvim-cmp.lua @@ -1,63 +1,60 @@ return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- source for text in buffer - "hrsh7th/cmp-path", -- source for file system paths - { - "L3MON4D3/LuaSnip", - -- follow latest release. - version = "v2.*", -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp", - }, - "saadparwaiz1/cmp_luasnip", -- for autocompletion - "rafamadriz/friendly-snippets", -- useful snippets - "onsails/lspkind.nvim", -- vs-code like pictograms - }, - config = function() - local cmp = require("cmp") + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- source for text in buffer + "hrsh7th/cmp-path", -- source for file system paths + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + }, + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + }, + config = function() + local cmp = require("cmp") - local luasnip = require("luasnip") + local luasnip = require("luasnip") - local lspkind = require("lspkind") + local lspkind = require("lspkind") - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) - require("luasnip.loaders.from_vscode").lazy_load() + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - completion = { - completeopt = "menu,menuone,preview,noselect", - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), -- previous suggestion - [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- show completion suggestions - [""] = cmp.mapping.abort(), -- close completion window - [""] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "nvim_lsp"}, - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - }), + cmp.setup({ + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", - }), - }, - }) - end, + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, + }) + end, } diff --git a/lua/holger/plugins/nvim-tree.lua b/lua/holger/plugins/nvim-tree.lua index 9bc7864..f52b25e 100644 --- a/lua/holger/plugins/nvim-tree.lua +++ b/lua/holger/plugins/nvim-tree.lua @@ -1,56 +1,61 @@ return { - "nvim-tree/nvim-tree.lua", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - local nvimtree = require("nvim-tree") + "nvim-tree/nvim-tree.lua", + dependencies = "nvim-tree/nvim-web-devicons", + config = function() + local nvimtree = require("nvim-tree") - -- recommended settings from nvim-tree documentation - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 + -- recommended settings from nvim-tree documentation + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 - nvimtree.setup({ - view = { - width = 35, - relativenumber = true, - }, - -- change folder arrow icons - renderer = { - indent_markers = { - enable = true, - }, - icons = { - glyphs = { - folder = { - arrow_closed = "", -- arrow when folder is closed - arrow_open = "", -- arrow when folder is open - }, - }, - }, - }, - -- disable window_picker for - -- explorer to work well with - -- window splits - actions = { - open_file = { - window_picker = { - enable = false, - }, - }, - }, - filters = { - custom = { ".DS_Store" }, - }, - git = { - ignore = false, - }, - }) + nvimtree.setup({ + view = { + width = 50, + relativenumber = true, + }, + -- change folder arrow icons + renderer = { + indent_markers = { + enable = true, + }, + icons = { + glyphs = { + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + -- disable window_picker for + -- explorer to work well with + -- window splits + actions = { + open_file = { + window_picker = { + enable = false, + }, + }, + }, + filters = { + custom = { ".DS_Store" }, + }, + git = { + ignore = false, + }, + }) - -- set keymaps - local keymap = vim.keymap -- for conciseness + -- set keymaps + local keymap = vim.keymap -- for conciseness - keymap.set("n", "ee", "NvimTreeToggle", { desc = "Toggle file explorer" }) -- toggle file explorer - keymap.set("n", "ef", "NvimTreeFindFileToggle", { desc = "Toggle file explorer on current file" }) -- toggle file explorer on current file - keymap.set("n", "ec", "NvimTreeCollapse", { desc = "Collapse file explorer" }) -- collapse file explorer - keymap.set("n", "er", "NvimTreeRefresh", { desc = "Refresh file explorer" }) -- refresh file explorer - end + keymap.set("n", "ee", "NvimTreeToggle", { desc = "Toggle file explorer" }) -- toggle file explorer + keymap.set( + "n", + "ef", + "NvimTreeFindFileToggle", + { desc = "Toggle file explorer on current file" } + ) -- toggle file explorer on current file + keymap.set("n", "ec", "NvimTreeCollapse", { desc = "Collapse file explorer" }) -- collapse file explorer + keymap.set("n", "er", "NvimTreeRefresh", { desc = "Refresh file explorer" }) -- refresh file explorer + end, } diff --git a/lua/holger/plugins/telescope.lua b/lua/holger/plugins/telescope.lua index 33d9d2e..4e77db8 100644 --- a/lua/holger/plugins/telescope.lua +++ b/lua/holger/plugins/telescope.lua @@ -1,36 +1,36 @@ return { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") - telescope.setup({ - defaults = { - path_display = { "smart" }, - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + actions.open_qflist, - }, - }, - }, - }) + telescope.setup({ + defaults = { + path_display = { "smart" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, + }, + }, + }, + }) - telescope.load_extension("fzf") + telescope.load_extension("fzf") - -- set keymaps - local keymap = vim.keymap -- for conciseness + -- set keymaps + local keymap = vim.keymap -- for conciseness - keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) - keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) - keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) - keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) - end, + keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) + keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) + keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) + keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) + end, } diff --git a/lua/holger/plugins/treesitter.lua b/lua/holger/plugins/treesitter.lua index f5a6535..8053eee 100644 --- a/lua/holger/plugins/treesitter.lua +++ b/lua/holger/plugins/treesitter.lua @@ -2,9 +2,6 @@ return { "nvim-treesitter/nvim-treesitter", event = { "BufReadPre", "BufNewFile" }, build = ":TSUpdate", - dependencies = { - "windwp/nvim-ts-autotag", - }, config = function() -- import nvim-treesitter plugin local treesitter = require("nvim-treesitter.configs") @@ -14,17 +11,8 @@ return { highlight = { enable = true, }, - - sync_install = false, - ignore_install = {}, - auto_install = false, - -- enable indentation indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { - enable = true, - }, -- ensure these language parsers are installed ensure_installed = { "json", @@ -58,5 +46,8 @@ return { }, }, }) + + -- use bash parser for zsh files + vim.treesitter.language.register("bash", "zsh") end, }