diff options
Diffstat (limited to 'neovim/.config/nvim/lua/plugins')
-rw-r--r-- | neovim/.config/nvim/lua/plugins/aider.lua | 23 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/cspell.lua | 23 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/gen.lua | 7 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/goyo.lua | 16 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/lspsaga.lua | 6 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/lualine.lua (renamed from neovim/.config/nvim/lua/plugins/galaxyline.lua) | 14 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/neogit.lua | 8 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/noice.lua | 94 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/nvim_cmp.lua | 18 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua | 78 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/tabby.lua | 1 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/telescope.lua | 45 | ||||
-rw-r--r-- | neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua | 6 |
13 files changed, 277 insertions, 62 deletions
diff --git a/neovim/.config/nvim/lua/plugins/aider.lua b/neovim/.config/nvim/lua/plugins/aider.lua new file mode 100644 index 0000000..709c00b --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/aider.lua @@ -0,0 +1,23 @@ +return { + { + "ddzero2c/aider.nvim", + config = function() + require("aider").setup({ + command = 'aider', -- Path to aider command + model = 'ollama_chat/qwen2.5', -- AI model to use + mode = 'diff', -- Edit mode: 'diff' or 'inline' + -- Floating window options + float_opts = { + relative = 'editor', + width = 0.8, -- 80% of editor width + height = 0.8, -- 80% of editor height + style = 'minimal', + border = 'rounded', + title = ' Aider ', + title_pos = 'center', + }, + }) + vim.keymap.set({ 'v', 'n' }, 'ga', ':AiderEdit<CR>', { noremap = true, silent = true }) + end + } +} diff --git a/neovim/.config/nvim/lua/plugins/cspell.lua b/neovim/.config/nvim/lua/plugins/cspell.lua new file mode 100644 index 0000000..33931b5 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/cspell.lua @@ -0,0 +1,23 @@ +return { + { + 'nvimtools/none-ls.nvim', + dependencies = { + { + 'davidmh/cspell.nvim', + }, + }, + config = function () + local cspell = require('cspell') + require('null-ls').setup { + sources = { + cspell.diagnostics, + cspell.code_actions, + }, + should_attach = function(bufnr) + local bufname = vim.api.nvim_buf_get_name(bufnr) + return not bufname == 'gen.nvim' + end, + } + end, + } +} diff --git a/neovim/.config/nvim/lua/plugins/gen.lua b/neovim/.config/nvim/lua/plugins/gen.lua new file mode 100644 index 0000000..2fa89a5 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/gen.lua @@ -0,0 +1,7 @@ +return { + 'David-Kunz/gen.nvim', + opts = { + model = 'qwen2.5-coder:7b', + display_mode = 'split', + } +} diff --git a/neovim/.config/nvim/lua/plugins/goyo.lua b/neovim/.config/nvim/lua/plugins/goyo.lua index bfe797a..5f70048 100644 --- a/neovim/.config/nvim/lua/plugins/goyo.lua +++ b/neovim/.config/nvim/lua/plugins/goyo.lua @@ -17,14 +17,12 @@ return { vim.opt.scrolloff = 999 vim.opt.laststatus = 0 - local gl = require('galaxyline') - local gls = gl.section - gls.left = {} - gls.mid = {} - gls.right = {} + require('lualine').hide() vim.cmd('Limelight') - vim.cmd('VimRToggleFullscreen') + if vim.fn.exists('g:gui_vimr') == 1 then + vim.cmd('VimRToggleFullscreen') + end end local goyo_leave = function() @@ -36,10 +34,12 @@ return { vim.opt.showmode = true vim.opt.showcmd = true vim.opt.scrolloff = 5 - dofile(script_path() .. '../config/galaxyline.lua') + require('lualine').hide({ unhide = true }) vim.opt.laststatus = 3 vim.cmd('Limelight!') - vim.cmd('VimRToggleFullscreen') + if vim.fn.exists('g:gui_vimr') == 1 then + vim.cmd('VimRToggleFullscreen') + end end local goyo_augroup = vim.api.nvim_create_augroup('Goyo', { clear = true }) diff --git a/neovim/.config/nvim/lua/plugins/lspsaga.lua b/neovim/.config/nvim/lua/plugins/lspsaga.lua index 53bff94..27173ec 100644 --- a/neovim/.config/nvim/lua/plugins/lspsaga.lua +++ b/neovim/.config/nvim/lua/plugins/lspsaga.lua @@ -11,7 +11,11 @@ return { }, lightbulb = { virtual_text = false, - } + }, + diagnostic = { + diagnostic_only_current = true, + border_follow = false, + }, }, keys = { { "gh", "<cmd>Lspsaga finder<CR>", desc = "Lspsaga finder" }, diff --git a/neovim/.config/nvim/lua/plugins/galaxyline.lua b/neovim/.config/nvim/lua/plugins/lualine.lua index d3f8ba7..f1647b2 100644 --- a/neovim/.config/nvim/lua/plugins/galaxyline.lua +++ b/neovim/.config/nvim/lua/plugins/lualine.lua @@ -1,13 +1,12 @@ return { { - 'nvimdev/galaxyline.nvim', - branch = 'main', + 'nvim-lualine/lualine.nvim', dependencies = { { 'nvim-tree/nvim-web-devicons', }, { - "catppuccin/nvim", + 'catppuccin/nvim', name = "catppuccin", priority = 1000, lazy = false, @@ -16,6 +15,11 @@ return { }, }, { + 'neanias/everforest-nvim', + priority = 1000, + lazy = false, + }, + { 'navarasu/onedark.nvim', lazy = false, priority = 1000, @@ -66,7 +70,7 @@ return { }, event = { 'BufEnter', 'VimEnter' }, config = function() - require('config.galaxyline') + require('config.lualine') end, - }, + } } diff --git a/neovim/.config/nvim/lua/plugins/neogit.lua b/neovim/.config/nvim/lua/plugins/neogit.lua index a0a3f90..43dcf02 100644 --- a/neovim/.config/nvim/lua/plugins/neogit.lua +++ b/neovim/.config/nvim/lua/plugins/neogit.lua @@ -7,11 +7,8 @@ return { 'sindrets/diffview.nvim', }, opts = { - disable_commit_confirmation = true, - auto_refresh = true, - kind = 'tab', commit_editor = { - kind = 'auto', + staged_diff_split_kind = "auto", }, integrations = { -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. @@ -26,7 +23,8 @@ return { -- } -- } -- - diffview = true + diffview = true, + telescope = true, } }, keys = { diff --git a/neovim/.config/nvim/lua/plugins/noice.lua b/neovim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..004b868 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,94 @@ +return { + { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + progress = { + enabled = false, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + popupmenu = { + enabled = true, + backend = "cmp", + }, + views = { + cmdline_popup = { + position = { + row = 5, + col = '50%', + }, + size = { + width = 60, + height = 'auto', + }, + }, + popupmenu = { + relative = 'editor', + position = { + row = 8, + col = '50%', + }, + size = { + width = 60, + height = 10, + }, + border = { + style = 'rounded', + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = 'Normal', FloatBorder = 'DiagnosticInfo' }, + }, + }, + }, + routes = { + { + filter = { + event = 'lsp', + kind = 'progress', + cond = function(message) + local client = vim.tbl_get(message.opts, 'progress', 'client') + return client == 'null-ls' + end, + }, + opts = { + skip = true, + }, + }, + { + filter = { + event = 'msg_show', + kind = '', + find = 'written', + }, + opts = { + skip = true, + }, + }, + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, + }, +} diff --git a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua index f0a4f95..320b684 100644 --- a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua +++ b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua @@ -40,6 +40,17 @@ return { local cmp = require('cmp') local lspkind = require('lspkind') cmp.setup({ + enabled = function() + -- disable completion in comments + local context = require 'cmp.config.context' + -- keep command mode completion enabled when cursor is in a comment + if vim.api.nvim_get_mode().mode == 'c' then + return true + else + return not context.in_treesitter_capture("comment") + and not context.in_syntax_group("Comment") + end + end, snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) @@ -91,7 +102,12 @@ return { sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline' } + { + name = 'cmdline', + option = { + ignore_cmds = { 'Man', '!' }, + }, + }, }) }) end, diff --git a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua index 48a86c6..fbae976 100644 --- a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua +++ b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua @@ -1,15 +1,21 @@ return { { + dependencies = { + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + }, 'neovim/nvim-lspconfig', lazy = false, priority = 800, config = function() + require("mason").setup() + require("mason-lspconfig").setup() local nvim_lsp = require('lspconfig') local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { "bashls", "clangd", "cssls", "dockerls", "gopls", "htmx", "jsonls", "marksman", - "phpactor", "psalm", "ruff", "rust_analyzer", "taplo", "yamlls" } + "ruff", "rust_analyzer", "taplo", "ts_ls", "yamlls" } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, @@ -19,6 +25,25 @@ return { } end + require 'lspconfig'.basedpyright.setup { + settings = { + basedpyright = { + -- Using Ruff's import organizer + disableOrganizeImports = true, + }, + python = { + analysis = { + -- Ignore all files for analysis to exclusively use Ruff for linting + ignore = { '*' }, + }, + }, + }, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, + } + require 'lspconfig'.lua_ls.setup { on_init = function(client) local path = client.workspace_folders[1].name @@ -69,48 +94,14 @@ return { }, } - require 'lspconfig'.ts_ls.setup { - filetypes = { 'typescript', 'typescriptreact', 'typescript.tsx' }, + require 'lspconfig'.intelephense.setup { + filetypes = { 'php' }, capabilities = capabilities, flags = { debounce_text_changes = 150, }, - } - - require 'lspconfig'.pylsp.setup { - settings = { - pylsp = { - plugins = { - autopep8 = { - enabled = false, - }, - black = { - enabled = false, - }, - mccabe = { - enabled = false, - }, - pycodestyle = { - enabled = false, - }, - pyflakes = { - enabled = false, - }, - pylsp_mypy = { - enabled = true, - }, - ruff = { - enabled = false, - }, - yapf = { - enabled = false, - }, - } - } - }, - capabilities = capabilities, - flags = { - debounce_text_changes = 150, + init_options = { + licenceKey = '~/.config/intelephense/licence.txt', }, } @@ -145,6 +136,15 @@ return { end, desc = 'LSP: Disable hover capability from Ruff', }) + + -- Disable diagnostics for gen.nvim + vim.api.nvim_create_autocmd({ "LspAttach" }, { + group = vim.api.nvim_create_augroup("lsp_disable", { clear = true }), + pattern = 'gen.nvim', + callback = function(args) + vim.diagnostic.enable(false, { bufnr = args.buf }) + end, + }) end, }, } diff --git a/neovim/.config/nvim/lua/plugins/tabby.lua b/neovim/.config/nvim/lua/plugins/tabby.lua index 0aa271e..b51c859 100644 --- a/neovim/.config/nvim/lua/plugins/tabby.lua +++ b/neovim/.config/nvim/lua/plugins/tabby.lua @@ -4,6 +4,7 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons', }, + cond = function() return vim.fn.has('gui_running') == 0 end, config = function() local theme = { fill = 'TabLineFill', diff --git a/neovim/.config/nvim/lua/plugins/telescope.lua b/neovim/.config/nvim/lua/plugins/telescope.lua index 6a81359..08729ca 100644 --- a/neovim/.config/nvim/lua/plugins/telescope.lua +++ b/neovim/.config/nvim/lua/plugins/telescope.lua @@ -1,13 +1,52 @@ return { { 'nvim-telescope/telescope.nvim', + tag = '0.1.8', dependencies = { - 'nvim-lua/plenary.nvim', + { + 'nvim-lua/plenary.nvim', + }, + { + "nvim-telescope/telescope-live-grep-args.nvim", + -- This will not install any breaking changes. + -- For major updates, this must be adjusted manually. + version = "^1.0.0", + }, }, + cmd = "Telescope", keys = { - { '<F3>', '<cmd>Telescope buffers<CR>', desc = 'Telescope buffers' }, + { '<F3>', '<cmd>Telescope buffers<CR>', desc = 'Telescope buffers' }, { '<F4>', '<cmd>Telescope find_files<CR>', desc = 'Telescope find files' }, - { '<F6>', '<cmd>Telescope live_grep<CR>', desc = 'Telescope live grep' }, + { '<F6>', '<cmd>Telescope live_grep<CR>', desc = 'Telescope live grep' }, }, + config = function() + local telescope = require("telescope") + local lga_actions = require("telescope-live-grep-args.actions") + + -- first setup telescope + telescope.setup({ + extensions = { + live_grep_args = { + auto_quoting = true, -- enable/disable auto-quoting + -- define mappings, e.g. + mappings = { -- extend mappings + i = { + ["<C-k>"] = lga_actions.quote_prompt(), + ["<C-i>"] = lga_actions.quote_prompt({ postfix = " --iglob " }), + -- freeze the current list and start a fuzzy search in the frozen list + ["<C-space>"] = lga_actions.to_fuzzy_refine, + }, + }, + -- ... also accepts theme settings, for example: + -- theme = "dropdown", -- use dropdown theme + -- theme = { }, -- use own theme spec + -- layout_config = { mirror=true }, -- mirror preview pane + } + } + }) + + -- then load the extension + telescope.load_extension("live_grep_args") + end }, } diff --git a/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua new file mode 100644 index 0000000..edcf7b6 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua @@ -0,0 +1,6 @@ +return { + { + 'leafOfTree/vim-svelte-plugin', + ft = 'svelte', + } +} |