From 00ec5eca125c1c9dbc419afaa81cf22938f96a08 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 14 Feb 2023 00:19:02 +0100 Subject: [PATCH 01/81] Update LSP config and DAP support --- init.vim | 1 - lua/conf/cmp.lua | 2 +- lua/conf/telescope.lua | 2 +- lua/debug.lua | 45 ++++++++++++++ lua/lsp/metals.lua | 79 +++++++++++++----------- lua/lsputils.lua | 44 ------------- lua/my-lsp.lua | 88 ++++++++++++-------------- lua/my-lsp.lua.orig | 137 +++++++++++++++++++++++++++++++++++++++++ packages.vim | 3 +- 9 files changed, 267 insertions(+), 134 deletions(-) create mode 100644 lua/debug.lua delete mode 100644 lua/lsputils.lua create mode 100644 lua/my-lsp.lua.orig diff --git a/init.vim b/init.vim index 8d2cd3e..c740963 100644 --- a/init.vim +++ b/init.vim @@ -188,7 +188,6 @@ let g:localvimrc_whitelist='/home/crater2150/work/.*' let g:localvimrc_sandbox=0 lua require("my-lsp") -lua require("lsputils") lua require("conf.cmp") lua require("conf.trouble") lua require("conf.treesitter") diff --git a/lua/conf/cmp.lua b/lua/conf/cmp.lua index 44c3e9a..45211a5 100644 --- a/lua/conf/cmp.lua +++ b/lua/conf/cmp.lua @@ -1,4 +1,4 @@ -local cmp = require'cmp' +local cmp = require('cmp') cmp.setup({ snippet = { diff --git a/lua/conf/telescope.lua b/lua/conf/telescope.lua index bbb5f71..3b07fc0 100644 --- a/lua/conf/telescope.lua +++ b/lua/conf/telescope.lua @@ -1,3 +1,3 @@ telescope = require('telescope') telescope.load_extension('fzf_native') -telescope.load_extension('lsp_handlers') +--telescope.load_extension('lsp_handlers') diff --git a/lua/debug.lua b/lua/debug.lua new file mode 100644 index 0000000..5b5b393 --- /dev/null +++ b/lua/debug.lua @@ -0,0 +1,45 @@ +-- Setup nvim-cmp. +local cmp = require'cmp' + +cmp.setup({ + snippet = { + expand = function(args) + -- For `vsnip` user. + vim.fn["vsnip#anonymous"](args.body) + + -- For `luasnip` user. + -- require('luasnip').lsp_expand(args.body) + + -- For `ultisnips` user. + -- vim.fn["UltiSnips#Anon"](args.body) + end, + }, + mapping = { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ select = true }), + }, + sources = { + { name = 'nvim_lsp' }, + + -- For vsnip user. + { name = 'vsnip' }, + + -- For luasnip user. + -- { name = 'luasnip' }, + + -- For ultisnips user. + -- { name = 'ultisnips' }, + + { name = 'buffer' }, + } +}) + +-- Setup lsp. +metals_config = require("metals").bare_config +metals_config.init_options.statusBarProvider = "on" +metals_config.settings = { showImplicitArguments = true } +metals_config.on_attach = on_attach +metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) diff --git a/lua/lsp/metals.lua b/lua/lsp/metals.lua index a9a4143..6d13c40 100644 --- a/lua/lsp/metals.lua +++ b/lua/lsp/metals.lua @@ -2,45 +2,52 @@ local status, metals = pcall(require, "metals") if (not status) then return function() end end return function(on_attach) - metals_config = metals.bare_config() - metals_config.init_options.statusBarProvider = "on" - metals_config.settings = { - showImplicitArguments = true, - superMethodLensesEnabled = true, - } - metals_config.on_attach = function(client, bufnr) - require("metals").setup_dap() - on_attach(client, bufnr) - end - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() - -- Debug settings if you're using nvim-dap - local dap = require("dap") - dap.configurations.scala = { - { - type = "scala", - request = "launch", - name = "RunOrTest", - metals = { - runType = "runOrTestFile", - --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example - }, + metals_config = metals.bare_config() + metals_config.init_options.statusBarProvider = "on" + metals_config.settings = { + showImplicitArguments = true, + superMethodLensesEnabled = true, + } + metals_config.on_attach = function(client, bufnr) + require("metals").setup_dap() + on_attach(client, bufnr) + end + metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() + -- Debug settings if you're using nvim-dap + local dap = require("dap") + dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example }, - { - type = "scala", - request = "launch", - name = "Test Target", - metals = { - runType = "testTarget", - }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", }, - } + }, + } - vim.cmd [[augroup lsp]] - vim.cmd [[au!]] - vim.cmd([[autocmd FileType scala setlocal omnifunc=v:lua.vim.lsp.omnifunc]]) - vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]] - vim.cmd [[augroup end]] + -- Autocmd that will actually be in charging of starting the whole thing + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + -- NOTE: You may or may not want java included here. You will need it if you + -- want basic Java support but it may also conflict if you are using + -- something like nvim-jdtls which also works on a java filetype autocmd. + pattern = { "scala", "sbt", "java" }, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) - return metals_config + return metals_config end diff --git a/lua/lsputils.lua b/lua/lsputils.lua deleted file mode 100644 index 765578b..0000000 --- a/lua/lsputils.lua +++ /dev/null @@ -1,44 +0,0 @@ -if vim.fn.has('nvim-0.5.1') == 1 then - vim.lsp.handlers['textDocument/codeAction'] = require'lsputil.codeAction'.code_action_handler - vim.lsp.handlers['textDocument/references'] = require'lsputil.locations'.references_handler - vim.lsp.handlers['textDocument/definition'] = require'lsputil.locations'.definition_handler - vim.lsp.handlers['textDocument/declaration'] = require'lsputil.locations'.declaration_handler - vim.lsp.handlers['textDocument/typeDefinition'] = require'lsputil.locations'.typeDefinition_handler - vim.lsp.handlers['textDocument/implementation'] = require'lsputil.locations'.implementation_handler - vim.lsp.handlers['textDocument/documentSymbol'] = require'lsputil.symbols'.document_handler - vim.lsp.handlers['workspace/symbol'] = require'lsputil.symbols'.workspace_handler -else - local bufnr = vim.api.nvim_buf_get_number(0) - - vim.lsp.handlers['textDocument/codeAction'] = function(_, _, actions) - require('lsputil.codeAction').code_action_handler(nil, actions, nil, nil, nil) - end - - vim.lsp.handlers['textDocument/references'] = function(_, _, result) - require('lsputil.locations').references_handler(nil, result, { bufnr = bufnr }, nil) - end - - vim.lsp.handlers['textDocument/definition'] = function(_, method, result) - require('lsputil.locations').definition_handler(nil, result, { bufnr = bufnr, method = method }, nil) - end - - vim.lsp.handlers['textDocument/declaration'] = function(_, method, result) - require('lsputil.locations').declaration_handler(nil, result, { bufnr = bufnr, method = method }, nil) - end - - vim.lsp.handlers['textDocument/typeDefinition'] = function(_, method, result) - require('lsputil.locations').typeDefinition_handler(nil, result, { bufnr = bufnr, method = method }, nil) - end - - vim.lsp.handlers['textDocument/implementation'] = function(_, method, result) - require('lsputil.locations').implementation_handler(nil, result, { bufnr = bufnr, method = method }, nil) - end - - vim.lsp.handlers['textDocument/documentSymbol'] = function(_, _, result, _, bufn) - require('lsputil.symbols').document_handler(nil, result, { bufnr = bufn }, nil) - end - - vim.lsp.handlers['textDocument/symbol'] = function(_, _, result, _, bufn) - require('lsputil.symbols').workspace_handler(nil, result, { bufnr = bufn }, nil) - end - end diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua index e53e3f9..6e3ebce 100644 --- a/lua/my-lsp.lua +++ b/lua/my-lsp.lua @@ -1,60 +1,52 @@ -local lsp_status = require('lsp-status') +--local lsp_status = require('lsp-status') -lsp_status.register_progress() - --- enable snippet support ---local capabilities = vim.lsp.protocol.make_client_capabilities() ---capabilities.textDocument.completion.completionItem.snippetSupport = true ---capabilities.textDocument.completion.completionItem.resolveSupport = { --- properties = { --- 'documentation', --- 'detail', --- 'additionalTextEdits', --- } ---} ---capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities) +--lsp_status.register_progress() -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - local function buf_set_keymap(...) vim.keymap.set(...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + local map = vim.keymap.set + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - --Enable completion triggered by - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' + --Enable completion triggered by + vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' - -- Mappings. - local opts = { noremap=true, silent=true, buffer=bufnr } - local loud = { noremap=true, buffer=bufnr } + -- Mappings. + local opts = { silent=true, buffer=bufnr } + local loud = { buffer=bufnr } - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('v', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.code_action()', loud) - buf_set_keymap('n', '', 'lua vim.codelens.run()', loud) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', '', 'lua vim.diagnostic.open_float()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.diagnostic.set_loclist()', opts) - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - buf_set_keymap("n", "dc", function() require("dap").continue() end, opts) - buf_set_keymap("n", "dr", function() require("dap").repl.toggle() end, opts) - buf_set_keymap("n", "dK", function() require("dap.ui.widgets").hover() end, opts) - buf_set_keymap("n", "dt", function() require("dap").toggle_breakpoint() end, opts) - buf_set_keymap("n", "dso", function() require("dap").step_over() end, opts) - buf_set_keymap("n", "dsi", function() require("dap").step_into() end, opts) - buf_set_keymap("n", "dl", function() require("dap").run_last() end, opts) + -- See `:help vim.lsp.*` for documentation on any of the below functions + map('n', 'gD', vim.lsp.buf.declaration, opts) + map('n', 'gd', vim.lsp.buf.definition, opts) + map('n', 'K', vim.lsp.buf.hover, opts) + map('v', 'K', vim.lsp.buf.hover, opts) + map('n', 'gi', vim.lsp.buf.implementation, opts) + map('n', '', vim.lsp.buf.signature_help, opts) + map('n', 'D', vim.lsp.buf.type_definition, opts) + map('n', 'rn', vim.lsp.buf.rename, opts) + map('n', '', vim.lsp.buf.code_action, loud) + map('n', '', vim.lsp.codelens.run, loud) + map('n', 'gr', vim.lsp.buf.references, opts) + map('n', '', vim.diagnostic.open_float, opts) + map('n', '[d', vim.diagnostic.goto_prev, opts) + map('n', ']d', vim.diagnostic.goto_next, opts) + map('n', '', vim.diagnostic.setloclist, opts) + map("n", "f", vim.lsp.buf.formatting, opts) + map("n", "dc", function() require("dap").continue() end, opts) + map("n", "dr", function() require("dap").repl.toggle() end, opts) + map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) + map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) + map("n", "dso", function() require("dap").step_over() end, opts) + map("n", "dsi", function() require("dap").step_into() end, opts) + map("n", "dl", function() require("dap").run_last() end, opts) - lsp_status.on_attach(client) + map("n", "aa", vim.diagnostic.setqflist, opts) + map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) + map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) - --require'completion'.on_attach(client, bufnr) + vim.cmd [[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh()]] + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] end require("lsp.metals")(on_attach) @@ -75,5 +67,3 @@ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( } ) -vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] -vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] diff --git a/lua/my-lsp.lua.orig b/lua/my-lsp.lua.orig new file mode 100644 index 0000000..ab74b7a --- /dev/null +++ b/lua/my-lsp.lua.orig @@ -0,0 +1,137 @@ +<<<<<<< Updated upstream +local lspconfig = require('lspconfig') +local configs = require('lspconfig.configs') +======= +local lsp_status = require('lsp-status') + +lsp_status.register_progress() +>>>>>>> Stashed changes + +-- enable snippet support +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true +capabilities.textDocument.completion.completionItem.resolveSupport = { + properties = { + 'documentation', + 'detail', + 'additionalTextEdits', + } +} +capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + + --Enable completion triggered by + buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + local opts = { noremap=true, silent=true } + + -- See `:help vim.lsp.*` for documentation on any of the below functions + buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('v', 'K', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) + buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.code_action()', opts) + buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) + buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.diagnostic.set_loclist()', opts) + buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + + lsp_status.on_attach(client) + + --require'completion'.on_attach(client, bufnr) +end + +local lsp_installer = require("nvim-lsp-installer") +lsp_installer.on_server_ready(function(server) + local opts = {} + +<<<<<<< Updated upstream + -- (optional) Customize the options passed to the server + -- if server.name == "tsserver" then + -- opts.root_dir = function() ... end + -- end +======= +require'lspinstall'.setup() -- important + +local servers = require'lspinstall'.installed_servers() +for _, server in pairs(servers) do + require'lspconfig'[server].setup{ + on_attach = on_attach, + capabilities = capabilities, + } +end +>>>>>>> Stashed changes + + -- This setup() function is exactly the same as lspconfig's setup function. + -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md + server:setup(opts) +end) + +metals_config = require("metals").bare_config() +metals_config.init_options.statusBarProvider = "on" +metals_config.settings = { showImplicitArguments = true } +metals_config.on_attach = on_attach +metals_config.capabilities = capabilities + +vim.cmd [[augroup lsp]] +vim.cmd [[au!]] +vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]] +vim.cmd [[augroup end]] + +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +<<<<<<< Updated upstream +local servers = { "lemminx" } +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = on_attach, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + } + } +end +======= +--local nvim_lsp = require('lspconfig') +--local servers = { "lemminx" } +--for _, lsp in ipairs(servers) do +-- nvim_lsp[lsp].setup { +-- on_attach = on_attach, +-- capabilities = capabilities, +-- flags = { +-- debounce_text_changes = 150, +-- } +-- } +--end +>>>>>>> Stashed changes + +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = false, + underline = true, + signs = true, + } +) + +vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + silent = true, focusable = false + } +) + +-- vim.cmd [[autocmd CursorMoved * lua vim.lsp.diagnostic.show_line_diagnostics()]] +-- vim.cmd [[autocmd CursorMoved * lua vim.lsp.diagnostic.show_line_diagnostics()]] +vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] +vim.cmd [[autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({max_width = 100, focusable = false})]] diff --git a/packages.vim b/packages.vim index 28c9ceb..0ef590c 100644 --- a/packages.vim +++ b/packages.vim @@ -31,6 +31,7 @@ Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-path' +Plug 'hrsh7th/cmp-cmdline' Plug 'hrsh7th/cmp-vsnip' Plug 'hrsh7th/nvim-cmp' Plug 'hrsh7th/vim-vsnip' @@ -41,8 +42,6 @@ Plug 'williamboman/nvim-lsp-installer' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-lua/lsp-status.nvim' -Plug 'RishabhRD/popfix' -Plug 'RishabhRD/nvim-lsputils' Plug 'kyazdani42/nvim-web-devicons' Plug 'folke/trouble.nvim' Plug 'folke/lsp-colors.nvim' From a8e4f7a113cc198ad9f98b3b84bc4718482d241b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 14 Feb 2023 17:36:45 +0100 Subject: [PATCH 02/81] Add deepl mappings to git after moving api key to pass storage --- after/plugin/deepl.vim | 10 ++++++++++ packages.vim | 1 + 2 files changed, 11 insertions(+) create mode 100644 after/plugin/deepl.vim diff --git a/after/plugin/deepl.vim b/after/plugin/deepl.vim new file mode 100644 index 0000000..a1add28 --- /dev/null +++ b/after/plugin/deepl.vim @@ -0,0 +1,10 @@ +let g:deepl#endpoint = "https://api-free.deepl.com/v2/translate" +function TranslateSelection(lang) + if !exists('g:deepl#auth_key') + let g:deepl#auth_key = pass#get('web/deepl.com', 'apikey') + endif + call deepl#v(a:lang) +endfun + +vmap call TranslateSelection("EN") +vmap call TranslateSelection("DE") diff --git a/packages.vim b/packages.vim index 0ef590c..4c67172 100644 --- a/packages.vim +++ b/packages.vim @@ -10,6 +10,7 @@ Plug 'fladson/vim-kitty' " generic Plug 'ryicoh/deepl.vim' +Plug 'tsuyoshicho/vim-pass' " tim pope stuff Plug 'tpope/vim-repeat' " . for commands from plugins From 3a1ab705cbbf35117f7f105ea55157e954053efd Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sat, 25 Feb 2023 15:22:32 +0100 Subject: [PATCH 03/81] Add signature help plugin --- lua/my-lsp.lua | 4 +++- packages.vim | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua index 6e3ebce..c9c3602 100644 --- a/lua/my-lsp.lua +++ b/lua/my-lsp.lua @@ -45,7 +45,7 @@ local on_attach = function(client, bufnr) map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) vim.cmd [[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh()]] - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] +-- vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] end @@ -67,3 +67,5 @@ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( } ) +local signature_help_cfg = {} +require "lsp_signature".setup(signature_help_cfg) diff --git a/packages.vim b/packages.vim index 4c67172..1ec69ce 100644 --- a/packages.vim +++ b/packages.vim @@ -51,6 +51,7 @@ Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' +Plug 'ray-x/lsp_signature.nvim' Plug 'mfussenegger/nvim-dap' From 59ec8d490bf83aa6843f4f172d1acca2665614ef Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 26 Feb 2023 22:07:32 +0100 Subject: [PATCH 04/81] Migrate to mason.nvim and setup jdtls --- after/ftplugin/java.vim | 13 +++++++++---- ftplugin/java.lua | 22 +++++++++++++++++++++ lua/lsp/installer.lua | 43 +++++++++++++++++++++++++++++++++++------ lua/lsp/metals.lua | 2 +- lua/my-lsp.lua | 35 +++++++++++++++++++-------------- packages.vim | 4 +++- 6 files changed, 92 insertions(+), 27 deletions(-) create mode 100644 ftplugin/java.lua diff --git a/after/ftplugin/java.vim b/after/ftplugin/java.vim index 5beb8f9..fd1c415 100644 --- a/after/ftplugin/java.vim +++ b/after/ftplugin/java.vim @@ -4,13 +4,18 @@ setlocal foldmethod=syntax setlocal foldenable setlocal textwidth=120 -nnoremap jc :JavaCorrect nnoremap jd :JavaDocComment nnoremap :JavaDocPreview nnoremap :JavaSearchContext -nnoremap jf :%JavaFormat -nnoremap ji :JavaImportOrganize -nnoremap jr :JavaRename +nnoremap ev lua require('jdtls').extract_variable() +vnoremap ev lua require('jdtls').extract_variable(true) +nnoremap ec lua require('jdtls').extract_constant() +vnoremap ec lua require('jdtls').extract_constant(true) +vnoremap em lua require('jdtls').extract_method(true) +nnoremap ro lua require('jdtls').organize_imports() + +nnoremap tc lua require'jdtls'.test_class() +nnoremap tm lua require'jdtls'.test_nearest_method() inoremap pumvisible() \|\| &omnifunc == '' ? \ "\C-n>" : diff --git a/ftplugin/java.lua b/ftplugin/java.lua new file mode 100644 index 0000000..cf81c69 --- /dev/null +++ b/ftplugin/java.lua @@ -0,0 +1,22 @@ +local mylsp = require("my-lsp") +local path = require("mason-core.path") + +local function mason_package(...) + return path.concat{vim.fn.stdpath("data"), "mason", "packages", ...} +end + +local bundles = vim.fn.glob(mason_package("java-debug-adapter", "extension", "server", "com.microsoft.java.debug.plugin-*.jar"), true, true) +local extra_bundles = vim.fn.glob(mason_package("java-test", "extension", "server", "*.jar"), true, true) +vim.list_extend(bundles, extra_bundles) + +require('jdtls').start_or_attach({ + cmd = {mason_package("jdtls", "bin", "jdtls") }, + on_attach = function(client, bufnr) + require'jdtls.setup'.add_commands() + require'jdtls'.setup_dap() + mylsp.on_attach(client, bufnr) + end, + init_options = { + bundles = extra_bundles + } +}) diff --git a/lua/lsp/installer.lua b/lua/lsp/installer.lua index 6214255..e0da00c 100644 --- a/lua/lsp/installer.lua +++ b/lua/lsp/installer.lua @@ -1,8 +1,39 @@ -local status, lsp_installer = pcall(require,"nvim-lsp-installer") -if (not status) then return end +local status1, mason = pcall(require, "mason") +local status2, mason_lspconfig = pcall(require, "mason-lspconfig") +if (not (status1 and status2)) then return end -lsp_installer.on_server_ready(function(server) - local opts = {} +return function(on_attach) + mason.setup {} + mason_lspconfig.setup { + ensure_installed = { 'jdtls', 'lua_ls' } + } - server:setup(opts) -end) + local no_autosetup = { + jdtls = true + } + + local extra_config = { + lua_ls = { + on_attach = on_attach, + settings = { + Lua = { + diagnostics = { globals = { 'vim' } }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { enable = false }, + }, + }, + } + } + + mason_lspconfig.setup_handlers { + function(server_name) + if (not no_autosetup[server_name]) then + require("lspconfig")[server_name].setup( + extra_config[server_name] or { on_attach = on_attach } + ) + end + end, + } +end diff --git a/lua/lsp/metals.lua b/lua/lsp/metals.lua index 6d13c40..fe7416d 100644 --- a/lua/lsp/metals.lua +++ b/lua/lsp/metals.lua @@ -42,7 +42,7 @@ return function(on_attach) -- NOTE: You may or may not want java included here. You will need it if you -- want basic Java support but it may also conflict if you are using -- something like nvim-jdtls which also works on a java filetype autocmd. - pattern = { "scala", "sbt", "java" }, + pattern = { "scala", "sbt" }, callback = function() require("metals").initialize_or_attach(metals_config) end, diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua index c9c3602..01be8fe 100644 --- a/lua/my-lsp.lua +++ b/lua/my-lsp.lua @@ -2,18 +2,20 @@ --lsp_status.register_progress() +local map = vim.keymap.set +map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) + -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - local map = vim.keymap.set local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end --Enable completion triggered by vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' -- Mappings. - local opts = { silent=true, buffer=bufnr } - local loud = { buffer=bufnr } + local opts = { silent = true, buffer = bufnr } + local loud = { buffer = bufnr } -- See `:help vim.lsp.*` for documentation on any of the below functions map('n', 'gD', vim.lsp.buf.declaration, opts) @@ -24,16 +26,15 @@ local on_attach = function(client, bufnr) map('n', '', vim.lsp.buf.signature_help, opts) map('n', 'D', vim.lsp.buf.type_definition, opts) map('n', 'rn', vim.lsp.buf.rename, opts) - map('n', '', vim.lsp.buf.code_action, loud) + map('n', '', vim.lsp.buf.code_action, loud) map('n', '', vim.lsp.codelens.run, loud) map('n', 'gr', vim.lsp.buf.references, opts) map('n', '', vim.diagnostic.open_float, opts) map('n', '[d', vim.diagnostic.goto_prev, opts) map('n', ']d', vim.diagnostic.goto_next, opts) map('n', '', vim.diagnostic.setloclist, opts) - map("n", "f", vim.lsp.buf.formatting, opts) + map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) map("n", "dc", function() require("dap").continue() end, opts) - map("n", "dr", function() require("dap").repl.toggle() end, opts) map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) map("n", "dso", function() require("dap").step_over() end, opts) @@ -44,28 +45,32 @@ local on_attach = function(client, bufnr) map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) - vim.cmd [[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh()]] --- vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd BufEnter,BufWrite lua vim.lsp.codelens.refresh()]] + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + + vim.lsp.codelens.refresh() end +require("lsp.installer")(on_attach) require("lsp.metals")(on_attach) - require("lsp.typescript")(on_attach) vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, - } + virtual_text = false, + underline = true, + signs = true, +} ) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( vim.lsp.handlers.signature_help, { - silent = true, focusable = false - } + silent = true, focusable = false +} ) local signature_help_cfg = {} require "lsp_signature".setup(signature_help_cfg) + +return { on_attach = on_attach } diff --git a/packages.vim b/packages.vim index 1ec69ce..a8e8d94 100644 --- a/packages.vim +++ b/packages.vim @@ -39,7 +39,8 @@ Plug 'hrsh7th/vim-vsnip' Plug 'hrsh7th/vim-vsnip-integ' Plug 'nvim-lua/plenary.nvim' Plug 'scalameta/nvim-metals' -Plug 'williamboman/nvim-lsp-installer' +Plug 'williamboman/mason.nvim' +Plug 'williamboman/mason-lspconfig.nvim' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-lua/lsp-status.nvim' @@ -52,6 +53,7 @@ Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' Plug 'ray-x/lsp_signature.nvim' +Plug 'mfussenegger/nvim-jdtls' Plug 'mfussenegger/nvim-dap' From c86636a697737cb58a3718cd6456066ff1f786dd Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 26 Feb 2023 22:08:23 +0100 Subject: [PATCH 05/81] Replace fzf.vim functionality with telescope --- after/plugin/fzf.vim | 7 ------- init.vim | 1 + lua/conf/telescope.lua | 34 +++++++++++++++++++++++++++++++++- packages.vim | 2 +- 4 files changed, 35 insertions(+), 9 deletions(-) delete mode 100644 after/plugin/fzf.vim diff --git a/after/plugin/fzf.vim b/after/plugin/fzf.vim deleted file mode 100644 index 04caade..0000000 --- a/after/plugin/fzf.vim +++ /dev/null @@ -1,7 +0,0 @@ -map gf :GFiles -map gf :Files -map gb :Buffers -map gs :GFiles? -map ag :Ag - -imap (fzf-complete-file) diff --git a/init.vim b/init.vim index c740963..b5b93e2 100644 --- a/init.vim +++ b/init.vim @@ -194,5 +194,6 @@ lua require("conf.treesitter") set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() set nofoldenable " Disable folding at startup. +lua require("conf.telescope") lua require("conf.indent-blankline") " vi:foldmethod=marker sw=2 diff --git a/lua/conf/telescope.lua b/lua/conf/telescope.lua index 3b07fc0..82d2e47 100644 --- a/lua/conf/telescope.lua +++ b/lua/conf/telescope.lua @@ -1,3 +1,35 @@ +local map = vim.keymap.set telescope = require('telescope') -telescope.load_extension('fzf_native') +telescope.builtin = require('telescope.builtin') + +telescope.setup { + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown { + -- even more opts + } + } + } +} +telescope.load_extension('fzf') +telescope.load_extension("ui-select") + + --telescope.load_extension('lsp_handlers') +-- +map('n', 'gff', telescope.builtin.fd) +map('n', 'gfg', telescope.builtin.git_files) +map('n', 'gfs', telescope.builtin.git_status) +map('n', 'gs', telescope.builtin.git_status) +map('n', 'gs', telescope.builtin.lsp_dynamic_workspace_symbols) +map('n', 'g/', telescope.builtin.live_grep) +map('n', '', telescope.builtin.current_buffer_fuzzy_find) +map('n', '*', telescope.builtin.grep_string) +map('n', 'gb', telescope.builtin.buffers) diff --git a/packages.vim b/packages.vim index a8e8d94..7c65fc5 100644 --- a/packages.vim +++ b/packages.vim @@ -52,6 +52,7 @@ Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' +Plug 'nvim-telescope/telescope-ui-select.nvim' Plug 'ray-x/lsp_signature.nvim' Plug 'mfussenegger/nvim-jdtls' @@ -64,7 +65,6 @@ Plug 'junegunn/vim-easy-align' " for stuff installed via disto package manager, e.g. fzf's bundled vim plugin Plug '/usr/share/vim/vimfiles' -Plug 'junegunn/fzf.vim' Plug 'vim-airline/vim-airline' Plug 'lambdalisue/suda.vim' From 3aeea26b730cc922bbae193b6197109fa0784250 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 2 Mar 2023 16:11:37 +0100 Subject: [PATCH 06/81] Disable cmp for command line --- lua/conf/cmp.lua | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/lua/conf/cmp.lua b/lua/conf/cmp.lua index 45211a5..71e2a7f 100644 --- a/lua/conf/cmp.lua +++ b/lua/conf/cmp.lua @@ -33,19 +33,17 @@ cmp.setup({ }), }) -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' } - }) -}) +--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 = 'cmdline' } +-- }) +--}) From 5feb871a98fc0632f89ff8fa43e42355f8e75584 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 8 Mar 2023 18:25:14 +0100 Subject: [PATCH 07/81] Move lua files for automatic loading --- {lua/conf => after/plugin}/cmp.lua | 1 + .../plugin}/indent-blankline.lua | 0 {lua/conf => after/plugin}/telescope.lua | 0 {lua/conf => after/plugin}/treesitter.lua | 0 {lua/conf => after/plugin}/trouble.lua | 0 init.vim | 6 - lua/my-lsp.lua.orig | 137 ------------------ {lua => plugin}/my-lsp.lua | 0 8 files changed, 1 insertion(+), 143 deletions(-) rename {lua/conf => after/plugin}/cmp.lua (97%) rename {lua/conf => after/plugin}/indent-blankline.lua (100%) rename {lua/conf => after/plugin}/telescope.lua (100%) rename {lua/conf => after/plugin}/treesitter.lua (100%) rename {lua/conf => after/plugin}/trouble.lua (100%) delete mode 100644 lua/my-lsp.lua.orig rename {lua => plugin}/my-lsp.lua (100%) diff --git a/lua/conf/cmp.lua b/after/plugin/cmp.lua similarity index 97% rename from lua/conf/cmp.lua rename to after/plugin/cmp.lua index 71e2a7f..ed891c9 100644 --- a/lua/conf/cmp.lua +++ b/after/plugin/cmp.lua @@ -27,6 +27,7 @@ cmp.setup({ sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, + { name = "copilot"}, },{ { name = 'buffer' }, --{ name = 'path' }, diff --git a/lua/conf/indent-blankline.lua b/after/plugin/indent-blankline.lua similarity index 100% rename from lua/conf/indent-blankline.lua rename to after/plugin/indent-blankline.lua diff --git a/lua/conf/telescope.lua b/after/plugin/telescope.lua similarity index 100% rename from lua/conf/telescope.lua rename to after/plugin/telescope.lua diff --git a/lua/conf/treesitter.lua b/after/plugin/treesitter.lua similarity index 100% rename from lua/conf/treesitter.lua rename to after/plugin/treesitter.lua diff --git a/lua/conf/trouble.lua b/after/plugin/trouble.lua similarity index 100% rename from lua/conf/trouble.lua rename to after/plugin/trouble.lua diff --git a/init.vim b/init.vim index b5b93e2..fddbedf 100644 --- a/init.vim +++ b/init.vim @@ -187,13 +187,7 @@ let g:signify_vcs_list = [ 'git', 'hg' ] let g:localvimrc_whitelist='/home/crater2150/work/.*' let g:localvimrc_sandbox=0 -lua require("my-lsp") -lua require("conf.cmp") -lua require("conf.trouble") -lua require("conf.treesitter") set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() set nofoldenable " Disable folding at startup. -lua require("conf.telescope") -lua require("conf.indent-blankline") " vi:foldmethod=marker sw=2 diff --git a/lua/my-lsp.lua.orig b/lua/my-lsp.lua.orig deleted file mode 100644 index ab74b7a..0000000 --- a/lua/my-lsp.lua.orig +++ /dev/null @@ -1,137 +0,0 @@ -<<<<<<< Updated upstream -local lspconfig = require('lspconfig') -local configs = require('lspconfig.configs') -======= -local lsp_status = require('lsp-status') - -lsp_status.register_progress() ->>>>>>> Stashed changes - --- enable snippet support -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true -capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { - 'documentation', - 'detail', - 'additionalTextEdits', - } -} -capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - --Enable completion triggered by - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - local opts = { noremap=true, silent=true } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('v', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.diagnostic.set_loclist()', opts) - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - - lsp_status.on_attach(client) - - --require'completion'.on_attach(client, bufnr) -end - -local lsp_installer = require("nvim-lsp-installer") -lsp_installer.on_server_ready(function(server) - local opts = {} - -<<<<<<< Updated upstream - -- (optional) Customize the options passed to the server - -- if server.name == "tsserver" then - -- opts.root_dir = function() ... end - -- end -======= -require'lspinstall'.setup() -- important - -local servers = require'lspinstall'.installed_servers() -for _, server in pairs(servers) do - require'lspconfig'[server].setup{ - on_attach = on_attach, - capabilities = capabilities, - } -end ->>>>>>> Stashed changes - - -- This setup() function is exactly the same as lspconfig's setup function. - -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md - server:setup(opts) -end) - -metals_config = require("metals").bare_config() -metals_config.init_options.statusBarProvider = "on" -metals_config.settings = { showImplicitArguments = true } -metals_config.on_attach = on_attach -metals_config.capabilities = capabilities - -vim.cmd [[augroup lsp]] -vim.cmd [[au!]] -vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]] -vim.cmd [[augroup end]] - --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -<<<<<<< Updated upstream -local servers = { "lemminx" } -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - on_attach = on_attach, - capabilities = capabilities, - flags = { - debounce_text_changes = 150, - } - } -end -======= ---local nvim_lsp = require('lspconfig') ---local servers = { "lemminx" } ---for _, lsp in ipairs(servers) do --- nvim_lsp[lsp].setup { --- on_attach = on_attach, --- capabilities = capabilities, --- flags = { --- debounce_text_changes = 150, --- } --- } ---end ->>>>>>> Stashed changes - -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, - } -) - -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - silent = true, focusable = false - } -) - --- vim.cmd [[autocmd CursorMoved * lua vim.lsp.diagnostic.show_line_diagnostics()]] --- vim.cmd [[autocmd CursorMoved * lua vim.lsp.diagnostic.show_line_diagnostics()]] -vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] -vim.cmd [[autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({max_width = 100, focusable = false})]] diff --git a/lua/my-lsp.lua b/plugin/my-lsp.lua similarity index 100% rename from lua/my-lsp.lua rename to plugin/my-lsp.lua From c303fa0cec3bf520f8e581611b947def67b3b633 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 8 Mar 2023 18:26:12 +0100 Subject: [PATCH 08/81] Add copilot --- packages.vim | 2 ++ plugin/copilot.lua | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 plugin/copilot.lua diff --git a/packages.vim b/packages.vim index 7c65fc5..15ab6ef 100644 --- a/packages.vim +++ b/packages.vim @@ -58,6 +58,8 @@ Plug 'mfussenegger/nvim-jdtls' Plug 'mfussenegger/nvim-dap' +Plug 'zbirenbaum/copilot.lua' +Plug 'zbirenbaum/copilot-cmp' Plug 'machakann/vim-highlightedyank' diff --git a/plugin/copilot.lua b/plugin/copilot.lua new file mode 100644 index 0000000..0ffdc42 --- /dev/null +++ b/plugin/copilot.lua @@ -0,0 +1,5 @@ +require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, +}) +require("copilot_cmp").setup() From 6f90d902b9f415e02fb0510d27e2f95bd7ede09c Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 8 Mar 2023 18:44:47 +0100 Subject: [PATCH 09/81] Nice icons for completions --- after/plugin/cmp.lua | 9 +++++++++ packages.vim | 2 ++ 2 files changed, 11 insertions(+) diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua index ed891c9..885d28e 100644 --- a/after/plugin/cmp.lua +++ b/after/plugin/cmp.lua @@ -1,4 +1,5 @@ local cmp = require('cmp') +local lspkind = require('lspkind') cmp.setup({ snippet = { @@ -32,6 +33,14 @@ cmp.setup({ { name = 'buffer' }, --{ name = 'path' }, }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + symbol_map = { Copilot = "" }, + }) + }, }) --cmp.setup.cmdline({ '/', '?' }, { diff --git a/packages.vim b/packages.vim index 15ab6ef..04ef77a 100644 --- a/packages.vim +++ b/packages.vim @@ -41,6 +41,8 @@ Plug 'nvim-lua/plenary.nvim' Plug 'scalameta/nvim-metals' Plug 'williamboman/mason.nvim' Plug 'williamboman/mason-lspconfig.nvim' +Plug 'onsails/lspkind.nvim' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-lua/lsp-status.nvim' From 85112244f636aad68040c9d79b0b4900cd1feea5 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 31 Mar 2023 12:16:59 +0200 Subject: [PATCH 10/81] telescope bindings and lua ls options --- after/plugin/telescope.lua | 9 ++++----- after/plugin/telescope.vim | 3 --- lua/lsp/installer.lua | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 after/plugin/telescope.vim diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 82d2e47..fde5ea6 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -24,11 +24,10 @@ telescope.load_extension("ui-select") --telescope.load_extension('lsp_handlers') -- -map('n', 'gff', telescope.builtin.fd) -map('n', 'gfg', telescope.builtin.git_files) -map('n', 'gfs', telescope.builtin.git_status) -map('n', 'gs', telescope.builtin.git_status) -map('n', 'gs', telescope.builtin.lsp_dynamic_workspace_symbols) +map('n', ',ff', telescope.builtin.fd) +map('n', ',fg', telescope.builtin.git_files) +map('n', ',gs', telescope.builtin.git_status) +map('n', ',s', telescope.builtin.lsp_dynamic_workspace_symbols) map('n', 'g/', telescope.builtin.live_grep) map('n', '', telescope.builtin.current_buffer_fuzzy_find) map('n', '*', telescope.builtin.grep_string) diff --git a/after/plugin/telescope.vim b/after/plugin/telescope.vim deleted file mode 100644 index 5243adb..0000000 --- a/after/plugin/telescope.vim +++ /dev/null @@ -1,3 +0,0 @@ - -" search for symbols -map gs :Telescope lsp_dynamic_workspace_symbols diff --git a/lua/lsp/installer.lua b/lua/lsp/installer.lua index e0da00c..da84470 100644 --- a/lua/lsp/installer.lua +++ b/lua/lsp/installer.lua @@ -20,6 +20,7 @@ return function(on_attach) diagnostics = { globals = { 'vim' } }, workspace = { library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, }, telemetry = { enable = false }, }, From 499580fee273d9a851d78a5665391d61fd4ba10b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 2 Apr 2023 22:22:45 +0200 Subject: [PATCH 11/81] Move lsp config back to lua folder so it can be accessed in other config files --- lua/my-lsp.lua | 76 ++++++++++++++++++++++++++++++++++++++++++++++ plugin/my-lsp.lua | 77 +---------------------------------------------- 2 files changed, 77 insertions(+), 76 deletions(-) create mode 100644 lua/my-lsp.lua diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua new file mode 100644 index 0000000..01be8fe --- /dev/null +++ b/lua/my-lsp.lua @@ -0,0 +1,76 @@ +--local lsp_status = require('lsp-status') + +--lsp_status.register_progress() + +local map = vim.keymap.set +map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + + --Enable completion triggered by + vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Mappings. + local opts = { silent = true, buffer = bufnr } + local loud = { buffer = bufnr } + + -- See `:help vim.lsp.*` for documentation on any of the below functions + map('n', 'gD', vim.lsp.buf.declaration, opts) + map('n', 'gd', vim.lsp.buf.definition, opts) + map('n', 'K', vim.lsp.buf.hover, opts) + map('v', 'K', vim.lsp.buf.hover, opts) + map('n', 'gi', vim.lsp.buf.implementation, opts) + map('n', '', vim.lsp.buf.signature_help, opts) + map('n', 'D', vim.lsp.buf.type_definition, opts) + map('n', 'rn', vim.lsp.buf.rename, opts) + map('n', '', vim.lsp.buf.code_action, loud) + map('n', '', vim.lsp.codelens.run, loud) + map('n', 'gr', vim.lsp.buf.references, opts) + map('n', '', vim.diagnostic.open_float, opts) + map('n', '[d', vim.diagnostic.goto_prev, opts) + map('n', ']d', vim.diagnostic.goto_next, opts) + map('n', '', vim.diagnostic.setloclist, opts) + map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) + map("n", "dc", function() require("dap").continue() end, opts) + map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) + map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) + map("n", "dso", function() require("dap").step_over() end, opts) + map("n", "dsi", function() require("dap").step_into() end, opts) + map("n", "dl", function() require("dap").run_last() end, opts) + + map("n", "aa", vim.diagnostic.setqflist, opts) + map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) + map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) + + vim.cmd [[autocmd BufEnter,BufWrite lua vim.lsp.codelens.refresh()]] + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + + vim.lsp.codelens.refresh() +end + +require("lsp.installer")(on_attach) +require("lsp.metals")(on_attach) +require("lsp.typescript")(on_attach) + +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = false, + underline = true, + signs = true, +} +) + +vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + silent = true, focusable = false +} +) + +local signature_help_cfg = {} +require "lsp_signature".setup(signature_help_cfg) + +return { on_attach = on_attach } diff --git a/plugin/my-lsp.lua b/plugin/my-lsp.lua index 01be8fe..3758e51 100644 --- a/plugin/my-lsp.lua +++ b/plugin/my-lsp.lua @@ -1,76 +1 @@ ---local lsp_status = require('lsp-status') - ---lsp_status.register_progress() - -local map = vim.keymap.set -map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - --Enable completion triggered by - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' - - -- Mappings. - local opts = { silent = true, buffer = bufnr } - local loud = { buffer = bufnr } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - map('n', 'gD', vim.lsp.buf.declaration, opts) - map('n', 'gd', vim.lsp.buf.definition, opts) - map('n', 'K', vim.lsp.buf.hover, opts) - map('v', 'K', vim.lsp.buf.hover, opts) - map('n', 'gi', vim.lsp.buf.implementation, opts) - map('n', '', vim.lsp.buf.signature_help, opts) - map('n', 'D', vim.lsp.buf.type_definition, opts) - map('n', 'rn', vim.lsp.buf.rename, opts) - map('n', '', vim.lsp.buf.code_action, loud) - map('n', '', vim.lsp.codelens.run, loud) - map('n', 'gr', vim.lsp.buf.references, opts) - map('n', '', vim.diagnostic.open_float, opts) - map('n', '[d', vim.diagnostic.goto_prev, opts) - map('n', ']d', vim.diagnostic.goto_next, opts) - map('n', '', vim.diagnostic.setloclist, opts) - map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) - map("n", "dc", function() require("dap").continue() end, opts) - map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) - map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) - map("n", "dso", function() require("dap").step_over() end, opts) - map("n", "dsi", function() require("dap").step_into() end, opts) - map("n", "dl", function() require("dap").run_last() end, opts) - - map("n", "aa", vim.diagnostic.setqflist, opts) - map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) - map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) - - vim.cmd [[autocmd BufEnter,BufWrite lua vim.lsp.codelens.refresh()]] - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] - vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] - - vim.lsp.codelens.refresh() -end - -require("lsp.installer")(on_attach) -require("lsp.metals")(on_attach) -require("lsp.typescript")(on_attach) - -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, -} -) - -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - silent = true, focusable = false -} -) - -local signature_help_cfg = {} -require "lsp_signature".setup(signature_help_cfg) - -return { on_attach = on_attach } +require('my-lsp') From 555629aa41952ebfeed6f51dca4e3b1694430bb9 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 18 Apr 2023 14:41:17 +0200 Subject: [PATCH 12/81] Disable copilot in mails --- plugin/copilot.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/copilot.lua b/plugin/copilot.lua index 0ffdc42..c644093 100644 --- a/plugin/copilot.lua +++ b/plugin/copilot.lua @@ -1,5 +1,8 @@ require("copilot").setup({ suggestion = { enabled = false }, panel = { enabled = false }, + filetypes = { + mail = false, + } }) require("copilot_cmp").setup() From 6c48210006e3b061b643a89ec1e10e2206e62ba2 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 22 Mar 2023 14:35:50 +0100 Subject: [PATCH 13/81] Add pylsp config --- lua/lsp/installer.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lsp/installer.lua b/lua/lsp/installer.lua index da84470..f0fa06f 100644 --- a/lua/lsp/installer.lua +++ b/lua/lsp/installer.lua @@ -25,6 +25,17 @@ return function(on_attach) telemetry = { enable = false }, }, }, + }, + ["pylsp"] = { + on_attach = on_attach, + settings = { + pylsp = { + plugins = { + rope_autoimport = { enabled = true, }, + isort = { enabled = true, }, + } + } + } } } From d7aa29354cda58ca86a1bb1bb30a7c076977d794 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 19 Jun 2023 11:52:25 +0200 Subject: [PATCH 14/81] Remove ==A From be6559c1b622e75c077387436fd3c4fdc31678db Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 19 Jun 2023 11:54:39 +0200 Subject: [PATCH 15/81] Migrate to lazy.nvim with more lua config --- after/ftplugin/mail.vim | 4 +- after/plugin/cmp.lua | 59 ---------- coc-settings.json | 8 -- ftdetect/cocor.vim | 2 - ftdetect/extensions.lua | 18 +++ ftdetect/hocon.vim | 1 - ftdetect/kitty.vim | 8 -- ftdetect/sc.lua | 24 ++++ ftdetect/sieve.vim | 1 - ftdetect/tolua.vim | 1 - ftdetect/xwiki.vim | 2 - ftplugin/java.lua | 2 - init.lua | 110 +++++++++++++++++++ init.vim | 193 -------------------------------- lua/common.lua | 61 +++++++++++ lua/plugins/chroma.lua | 5 + lua/plugins/cmp.lua | 65 +++++++++++ lua/plugins/deepl.lua | 12 ++ lua/plugins/init.lua | 64 +++++++++++ lua/plugins/lspconfig.lua | 200 ++++++++++++++++++++++++++++++++++ lua/plugins/markdown.lua | 4 + lua/plugins/metals.lua | 58 ++++++++++ lua/plugins/telescope.lua | 54 +++++++++ lua/plugins/text-to-color.lua | 12 ++ lua/plugins/treesitter.lua | 88 +++++++++++++++ packages.vim | 125 --------------------- plugin/on-attach.lua | 46 ++++++++ syntax/tolua.vim | 41 ------- 28 files changed, 823 insertions(+), 445 deletions(-) delete mode 100644 after/plugin/cmp.lua delete mode 100644 coc-settings.json delete mode 100644 ftdetect/cocor.vim create mode 100644 ftdetect/extensions.lua delete mode 100644 ftdetect/hocon.vim delete mode 100644 ftdetect/kitty.vim create mode 100644 ftdetect/sc.lua delete mode 100644 ftdetect/sieve.vim delete mode 100644 ftdetect/tolua.vim delete mode 100644 ftdetect/xwiki.vim create mode 100644 init.lua delete mode 100644 init.vim create mode 100644 lua/common.lua create mode 100644 lua/plugins/chroma.lua create mode 100644 lua/plugins/cmp.lua create mode 100644 lua/plugins/deepl.lua create mode 100644 lua/plugins/init.lua create mode 100644 lua/plugins/lspconfig.lua create mode 100644 lua/plugins/markdown.lua create mode 100644 lua/plugins/metals.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/text-to-color.lua create mode 100644 lua/plugins/treesitter.lua delete mode 100644 packages.vim create mode 100644 plugin/on-attach.lua delete mode 100644 syntax/tolua.vim diff --git a/after/ftplugin/mail.vim b/after/ftplugin/mail.vim index 1eb4bff..36fc8aa 100644 --- a/after/ftplugin/mail.vim +++ b/after/ftplugin/mail.vim @@ -1,3 +1,3 @@ iabbr mfg Mit freundlichen Grüßen - -set fdl=99 +setlocal spell +setlocal fdl=99 diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua deleted file mode 100644 index 885d28e..0000000 --- a/after/plugin/cmp.lua +++ /dev/null @@ -1,59 +0,0 @@ -local cmp = require('cmp') -local lspkind = require('lspkind') - -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = { - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [''] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, - { name = "copilot"}, - },{ - { name = 'buffer' }, - --{ name = 'path' }, - }), - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', -- show only symbol annotations - maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - symbol_map = { Copilot = "" }, - }) - }, -}) - ---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 = 'cmdline' } --- }) ---}) diff --git a/coc-settings.json b/coc-settings.json deleted file mode 100644 index 645c346..0000000 --- a/coc-settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "languageserver": { - "turtle": { - "command": "turtle_lsp", - "filetypes": ["ttl", "turtle"] - } - } -} diff --git a/ftdetect/cocor.vim b/ftdetect/cocor.vim deleted file mode 100644 index 4f00515..0000000 --- a/ftdetect/cocor.vim +++ /dev/null @@ -1,2 +0,0 @@ -au! BufRead,BufNewFile *.atg setfiletype coco -au! BufRead,BufNewFile *.wili setfiletype wili diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua new file mode 100644 index 0000000..1098681 --- /dev/null +++ b/ftdetect/extensions.lua @@ -0,0 +1,18 @@ +vim.filetype.add({ + extension = { + }, + filename = { + ['.scalafmt.conf'] = 'hocon', + ['kitty.conf'] = 'kitty', + ['neomuttrc'] = 'neomutt', + ['template'] = 'sh', + }, + pattern = { + ['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty', + ['${XDG_CONFIG_HOME}/kitty/*.session'] = 'kitty-session', + }, +}) + +-- au BufRead,BufNewFile *.ttl set filetype=rdf-turtle +-- au! BufNewFile,BufRead *.xwiki set ft=xwiki syntax=xwiki +-- diff --git a/ftdetect/hocon.vim b/ftdetect/hocon.vim deleted file mode 100644 index 7e9a1e6..0000000 --- a/ftdetect/hocon.vim +++ /dev/null @@ -1 +0,0 @@ -au! BufNewFile,BufRead .scalafmt.conf set ft=hocon syntax=hocon diff --git a/ftdetect/kitty.vim b/ftdetect/kitty.vim deleted file mode 100644 index 38d8d04..0000000 --- a/ftdetect/kitty.vim +++ /dev/null @@ -1,8 +0,0 @@ -au! BufNewFile,BufRead kitty.conf set ft=kitty syntax=kitty -if exists("$XDG_CONFIG_HOME") - au! BufNewFile,BufRead $XDG_CONFIG_HOME/kitty/*.conf set ft=kitty syntax=kitty - au! BufRead,BufNewFile $XDG_CONFIG_HOME/kitty/*.session set ft=kitty-session syntax=kitty-session -else - au! BufNewFile,BufRead ~/.config/kitty/*.conf set ft=kitty syntax=kitty - au! BufRead,BufNewFile ~/.config/kitty/*.session set ft=kitty-session syntax=kitty-session -endif diff --git a/ftdetect/sc.lua b/ftdetect/sc.lua new file mode 100644 index 0000000..422a4f8 --- /dev/null +++ b/ftdetect/sc.lua @@ -0,0 +1,24 @@ +-- Override detection from lua/vim/filetype/detect.lua +-- removes match on |%w+| for SuperCollider +vim.filetype.add({ + extension = { + -- This function checks the first 25 lines of file extension "sc" to resolve + -- detection between scala and SuperCollider + sc = function(path, bufnr) + for _, line in ipairs(vim.filetype.getlines(bufnr, 1, 25)) do + if + vim.filetype.findany(line, { + 'var%s<', + 'classvar%s<', + '%^this.*', + '%+%s%w*%s{', + '%*ar%s', + }) + then + return 'supercollider' + end + end + return 'scala' + end + } +}) diff --git a/ftdetect/sieve.vim b/ftdetect/sieve.vim deleted file mode 100644 index 4c68082..0000000 --- a/ftdetect/sieve.vim +++ /dev/null @@ -1 +0,0 @@ -au! BufNewFile,BufRead *.sieve set ft=sieve syntax=sieve diff --git a/ftdetect/tolua.vim b/ftdetect/tolua.vim deleted file mode 100644 index 87cb3fd..0000000 --- a/ftdetect/tolua.vim +++ /dev/null @@ -1 +0,0 @@ -au! BufRead,BufNewFile tolua_*.pkg set ft=tolua syntax=tolua diff --git a/ftdetect/xwiki.vim b/ftdetect/xwiki.vim deleted file mode 100644 index b6a1640..0000000 --- a/ftdetect/xwiki.vim +++ /dev/null @@ -1,2 +0,0 @@ -au! BufNewFile,BufRead *.xwiki set ft=xwiki syntax=xwiki - diff --git a/ftplugin/java.lua b/ftplugin/java.lua index cf81c69..70a70bd 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,4 +1,3 @@ -local mylsp = require("my-lsp") local path = require("mason-core.path") local function mason_package(...) @@ -14,7 +13,6 @@ require('jdtls').start_or_attach({ on_attach = function(client, bufnr) require'jdtls.setup'.add_commands() require'jdtls'.setup_dap() - mylsp.on_attach(client, bufnr) end, init_options = { bundles = extra_bundles diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..6e69387 --- /dev/null +++ b/init.lua @@ -0,0 +1,110 @@ +if vim.env['VIRTUAL_ENV'] ~= nil then + vim.g.python3_host_prog = vim.fn.system("which -a python3 | sed -n 2p | tr -d '\n'") +else + vim.g.python3_host_prog = vim.fn.system("which python3 | tr -d '\n'") +end + +-- lazy.nvim bootstrap +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, + }) +end +vim.opt.rtp:prepend(lazypath) +require("lazy").setup("plugins") + +vim.opt.background = "dark" +vim.g.chroma_italic_style = "bold" +vim.g.chroma_nontext_dark = 1 + +vim.opt.number = true + +vim.opt.colorcolumn = "+1" +vim.opt.textwidth = 80 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 + +vim.opt.whichwrap = "b,s,<,>,[,],h,l" + +vim.opt.timeout = false + +vim.opt.foldmethod = "expr" +vim.opt.foldlevelstart = 99 +vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.opt.foldenable = false + +-- todo visualbell needed? + +vim.opt.shell = "/bin/zsh" +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.inccommand = "split" + +vim.opt.wildmode = { "list:longest", "list:full" } +vim.opt.wildignore = { "*.so", "*.swp", "*.zip", "*.o" } +vim.opt.suffixes = { + ".bak", "~", ".h", ".info", ".swp", ".obj", ".info", ".aux", ".dvi", ".bbl", ".out", ".o", ".lo", + "\\.class", ".pdf" } + +vim.opt.completeopt = "menu,menuone,noselect" +vim.opt.mouse = '' +vim.opt.shortmess = vim.o.shortmess .. "c" + +vim.opt.cursorline = true +vim.opt.undofile = true + +vim.opt.spelllang = 'de' + +vim.opt.termguicolors = true +vim.opt.pumblend = 10 + +vim.opt.updatetime = 300 + +local command = vim.api.nvim_create_user_command +local initlua = vim.fn.stdpath('config') .. '/init.lua' +command('RC', function() vim.cmd.edit(initlua) end, { desc = 'edit init.lua' }) +command('CD', ':cd %:h', { desc = 'cd to current file' }) +command('TrailingSpace', '%s/\\s*$//g', { desc = 'remove trailing spaces' }) + +vim.g.tex_flavor = 'latex' + +local key = vim.keymap.set + +key('n', '', 'za', { desc = 'toggle fold' }) +key('v', '.', 'normal .', { desc = 'repeat last command in visual mode' }) +key('n', 'cy', '"*y', { desc = 'copy to system clipboard' }) + +key('t', '', '', { desc = 'exit terminal mode' }) + +-- Arrow keys for window movement and resizing +key('n', '', 'h') +key('n', '', 'j') +key('n', '', 'k') +key('n', '', 'l') +-- +key('n', '', "',<") +key('n', '', "',>',") +key('n', '', "',-") +key('n', '', "',+") + +key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' }) +key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' }) + +key('i', '', 'u') +key('n', '&', ':&&') +key('x', '&', ':&&') +key('n', 'Y', 'y$') + + +key('i', '', '', { desc = 'completion' }) +key('n', '', 'nohredraw!', { desc = 'clear search highlight' }) +key('v', 'gs', "'<,'>sort", { desc = 'sort selection' }) + + +key({ 'n', 'x' }, '', "(EasyAlign)", { desc = 'align selection' }) diff --git a/init.vim b/init.vim deleted file mode 100644 index fddbedf..0000000 --- a/init.vim +++ /dev/null @@ -1,193 +0,0 @@ -if exists("$VIRTUAL_ENV") - let g:python3_host_prog=substitute(system("which -a python3 | head -n2 | tail -n1"), "\n", '', 'g') -else - let g:python3_host_prog=substitute(system("which python3"), "\n", '', 'g') -endif - -runtime packages.vim - -let $MYVIMDIR=split(&rtp, ',')[0] - -set exrc - -set background=dark -let g:chroma_italic_style="bold" -let g:chroma_nontext_dark=1 -colo chroma - -if exists("&cc") - set cc=+1 -endif - -set number - -set textwidth=80 -set tabstop=2 -set shiftwidth=2 - -set whichwrap+=<,>,h,l - -set notimeout -set ttimeout -set ttimeoutlen=50 - -set foldmethod=syntax -set foldlevelstart=99 - -" disables visualbell -set vb t_vb= - -set shellcmdflag=-c -set shell=/bin/zsh - -set modeline -set showcmd - -set ignorecase smartcase -set inccommand=split -set wildmode=list:longest,list:full -set wildignore+=*.so,*.swp,*.zip,*.o -set suffixes=.bak,~,.h,.info,.swp,.obj,.info,.aux,.dvi,.bbl,.out,.o,.lo,\.class -set suffixes+=.pdf -set wildmenu -set hidden - -"set completeopt=menu,noinsert,preview -"set completeopt=menuone,noinsert,noselect -set completeopt=menu,menuone,noselect -set shortmess+=c -inoremap pumvisible() ? "\" : "\u\" - -set mouse= - -set cursorline -set guicursor= - -set undofile -set undodir=~/.local/share/nvim/undo - -set spelllang=de - -set termguicolors -set pumblend=20 - -set updatetime=300 - -" custom commands -command! RC edit $MYVIMRC -command! SRC source $MYVIMRC -command! CD :cd %:h -command! PlugEdit edit $MYVIMDIR/packages.vim -command! PlugReload source $MYVIMDIR/packages.vim | PlugInstall -command! TrailingSpace %s/\s*$//g - - -"{{{ latex - -" controls filetype setting, therefore not possible to move to ftplugin -let g:tex_flavor = "latex" - -"}}} - -" {{{ misc Autocommands -augroup Misc - au FileType mail setlocal spell - au FileType man setlocal nonu -augroup END - - -augroup Cache - autocmd! - autocmd BufRead,BufNewFile ~/Private/* setlocal directory=. -augroup END - -"{{{ binary editing -augroup Binary - au! - au BufReadPre *.bin let &bin=1 - au BufReadPost *.bin if &bin | %!xxd - au BufReadPost *.bin set ft=xxd | endif - au BufWritePre *.bin if &bin | %!xxd -r - au BufWritePre *.bin endif - au BufWritePost *.bin if &bin | %!xxd - au BufWritePost *.bin set nomod | endif -augroup END -"}}} - -"}}} - -" common mappings {{{ - -nnoremap za -vnoremap . normal . -noremap cy "*y - -tnoremap - -map h -map j -map k -map l - -map < -map > -map - -map + - -" navigate windows with alt+[hjkl] -tnoremap h -tnoremap j -tnoremap k -tnoremap l -inoremap h -inoremap j -inoremap k -inoremap l -nnoremap h -nnoremap j -nnoremap k -nnoremap l - -nnoremap :call search('^[^[:space:])\]}]', 'be') -nnoremap :call search('^[^[:space:])\]}]', 'e') - -inoremap u -nnoremap & :&& -xnoremap & :&& -nnoremap Y y$ - -inoremap - -nmap nohredraw! - -nmap -imap - -vmap gs '<,'>sort - -"}}} - - -"Git {{{ -nmap gu Gina push -nmap gvc !git svn dcommit -nmap gvf !git svn fetch -" Git }}} - -" Start interactive EasyAlign in visual mode (e.g. vipga) -xmap (EasyAlign) - -" Start interactive EasyAlign for a motion/text object (e.g. gaip) -nmap (EasyAlign) - -let g:signify_vcs_list = [ 'git', 'hg' ] -"let g:signify_disable_by_default = 1 - - -let g:localvimrc_whitelist='/home/crater2150/work/.*' -let g:localvimrc_sandbox=0 - -set foldmethod=expr -set foldexpr=nvim_treesitter#foldexpr() -set nofoldenable " Disable folding at startup. -" vi:foldmethod=marker sw=2 diff --git a/lua/common.lua b/lua/common.lua new file mode 100644 index 0000000..7a25f61 --- /dev/null +++ b/lua/common.lua @@ -0,0 +1,61 @@ +-- Adapted from https://github.com/LazyVim/LazyVim/ +-- SPDX-License-Identifier: Apache-2.0 +return { + icons = { + dap = { + Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, + Breakpoint = " ", + BreakpointCondition = " ", + BreakpointRejected = { " ", "DiagnosticError" }, + LogPoint = ".>", + }, + diagnostics = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + }, + git = { + added = " ", + modified = " ", + removed = " ", + }, + kinds = { + Array = " ", + Boolean = " ", + Class = " ", + Color = " ", + Constant = " ", + Constructor = " ", + Copilot = " ", + Enum = " ", + EnumMember = " ", + Event = " ", + Field = " ", + File = " ", + Folder = " ", + Function = " ", + Interface = " ", + Key = " ", + Keyword = " ", + Method = " ", + Module = " ", + Namespace = " ", + Null = " ", + Number = " ", + Object = " ", + Operator = " ", + Package = " ", + Property = " ", + Reference = " ", + Snippet = " ", + String = " ", + Struct = " ", + Text = " ", + TypeParameter = " ", + Unit = " ", + Value = " ", + Variable = " ", + }, + }, +} diff --git a/lua/plugins/chroma.lua b/lua/plugins/chroma.lua new file mode 100644 index 0000000..daad375 --- /dev/null +++ b/lua/plugins/chroma.lua @@ -0,0 +1,5 @@ +return { + 'crater2150/vim-theme-chroma', + lazy = false, priority = 1000, + config = function() vim.cmd.colorscheme("chroma") end +} diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..5de5c8d --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,65 @@ +return { + "hrsh7th/nvim-cmp", + -- load cmp on InsertEnter + event = "InsertEnter", + -- these dependencies will only be loaded when cmp loads + -- dependencies are always lazy-loaded unless specified otherwise + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/vim-vsnip', + 'hrsh7th/vim-vsnip-integ', + 'onsails/lspkind.nvim', + }, + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') + + cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = { + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + { name = "copilot"}, + },{ + { name = 'buffer' }, + --{ name = 'path' }, + }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + symbol_map = { Copilot = "" }, + }) + }, + }) + end, +} diff --git a/lua/plugins/deepl.lua b/lua/plugins/deepl.lua new file mode 100644 index 0000000..2ee6c3d --- /dev/null +++ b/lua/plugins/deepl.lua @@ -0,0 +1,12 @@ +return { 'ryicoh/deepl.vim', + keys = { + + { '', function() vim.fn['deepl#v']("EN") end, mode = 'v' }, + { '', function() vim.fn['deepl#v']("DE") end, mode = 'v' }, + }, + dependencies = { 'tsuyoshicho/vim-pass' }, + config = function () + vim.g['deepl#endpoint'] = "https://api-free.deepl.com/v2/translate" + vim.g['deepl#auth_key'] = vim.fn['pass#get']('web/deepl.com', 'apikey') + end +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..efd9714 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,64 @@ +return { + "folke/which-key.nvim", + 'pbrisbin/vim-mkdir', + 'fladson/vim-kitty', + + 'tpope/vim-repeat', + 'tpope/vim-surround', + 'tpope/vim-characterize', + 'tpope/vim-eunuch', + 'tpope/vim-commentary', + 'tpope/vim-sleuth', + + -- ic / ac + {'glts/vim-textobj-comment', + dependencies = { 'kana/vim-textobj-user' } + }, + -- ii / ai + 'michaeljsmith/vim-indent-object', + 'airblade/vim-gitgutter', + + 'neovim/nvim-lspconfig', + + { 'nvim-telescope/telescope.nvim', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + + { 'ray-x/lsp_signature.nvim', + config = function() + require('lsp_signature').setup({}) + end + }, + 'nvim-lua/lsp-status.nvim', + 'kyazdani42/nvim-web-devicons', + 'folke/trouble.nvim', + 'folke/lsp-colors.nvim', + 'nvim-lua/popup.nvim', + + 'zbirenbaum/copilot.lua', + {'zbirenbaum/copilot-cmp', + dependencies = { "hrsh7th/nvim-cmp" }, + }, + 'junegunn/vim-easy-align', + 'machakann/vim-highlightedyank', + 'vim-airline/vim-airline', + 'lukas-reineke/indent-blankline.nvim', + 'lambdalisue/suda.vim', + -- git + 'lambdalisue/gina.vim', + 'gregsexton/gitv', + 'gisphm/vim-gitignore', + 'sjl/splice.vim', + 'jamessan/vim-gnupg', + + 'lervag/vimtex', + 'ledger/vim-ledger', + 'anekos/hledger-vim', + + 'vim-pandoc/vim-pandoc', + 'vim-pandoc/vim-pandoc-syntax', + 'isobit/vim-caddyfile', + 'GEverding/vim-hocon', + 'nfnty/vim-nftables', +} +-- 'powerman/vim-plugin-AnsiEsc', diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..147bec8 --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,200 @@ +return { + -- lspconfig + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, + { "folke/neodev.nvim", opts = {} }, + "mason.nvim", + "williamboman/mason-lspconfig.nvim", + { + "hrsh7th/cmp-nvim-lsp", + cond = function() + return require("lazy.core.config").plugins["nvim-cmp"] ~= nil + end, + }, + }, + ---@class PluginLspOpts + opts = { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + }, + severity_sort = true, + }, + -- add any global capabilities here + capabilities = {}, + servers = { + jsonls = {}, + lua_ls = { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = "Replace", + }, + telemetry = { enable = false }, + }, + }, + }, + pylsp = { + settings = { + pylsp = { + plugins = { + rope_autoimport = { enabled = true, }, + isort = { enabled = true, }, + } + } + } + } + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + -- tsserver = function(_, opts) + -- require("typescript").setup({ server = opts }) + -- return true + -- end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + ---@param opts PluginLspOpts + config = function(_, opts) + -- diagnostics + for name, icon in pairs(require("common").icons.diagnostics) do + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end + + if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then + opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" + or function(diagnostic) + local icons = require("common").icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon + end + end + end + end + + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) + + local servers = opts.servers + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + require("cmp_nvim_lsp").default_capabilities(), + opts.capabilities or {} + ) + + local function setup(server) + local server_opts = vim.tbl_deep_extend("force", { + capabilities = vim.deepcopy(capabilities), + }, servers[server] or {}) + + if opts.setup[server] then + if opts.setup[server](server, server_opts) then + return + end + elseif opts.setup["*"] then + if opts.setup["*"](server, server_opts) then + return + end + end + require("lspconfig")[server].setup(server_opts) + end + + -- get all the servers that are available thourgh mason-lspconfig + local have_mason, mlsp = pcall(require, "mason-lspconfig") + local all_mslp_servers = {} + if have_mason then + all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) + end + + local ensure_installed = {} ---@type string[] + for server, server_opts in pairs(servers) do + if server_opts then + server_opts = server_opts == true and {} or server_opts + -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + setup(server) + else + ensure_installed[#ensure_installed + 1] = server + end + end + end + + if have_mason then + mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) + end + end, + }, + + -- formatters + { + "jose-elias-alvarez/null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "mason.nvim" }, + opts = function() + local nls = require("null-ls") + return { + root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"), + sources = { + nls.builtins.formatting.stylua, + nls.builtins.formatting.shfmt, + nls.builtins.completion.vsnip, + nls.builtins.diagnostics.zsh, + nls.builtins.formatting.beautysh, + }, + } + end, + }, + + -- cmdline tools and lsp servers + { + "williamboman/mason.nvim", + cmd = "Mason", + opts = { + ensure_installed = { + "jdtls", + "lua-language-server", + }, + }, + ---@param opts MasonSettings | {ensure_installed: string[]} + config = function(_, opts) + require("mason").setup(opts) + local mr = require("mason-registry") + local function ensure_installed() + for _, tool in ipairs(opts.ensure_installed) do + local p = mr.get_package(tool) + if not p:is_installed() then + p:install() + end + end + end + if mr.refresh then + mr.refresh(ensure_installed) + else + ensure_installed() + end + end, + }, + 'mfussenegger/nvim-jdtls', +} + diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua new file mode 100644 index 0000000..77a4522 --- /dev/null +++ b/lua/plugins/markdown.lua @@ -0,0 +1,4 @@ +return { + 'euclio/vim-markdown-composer', + build = 'cargo build --release' +} diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua new file mode 100644 index 0000000..8cc94b5 --- /dev/null +++ b/lua/plugins/metals.lua @@ -0,0 +1,58 @@ +return { + 'scalameta/nvim-metals', + dependencies = { + 'nvim-lua/plenary.nvim', + 'mfussenegger/nvim-dap', + "hrsh7th/cmp-nvim-lsp", + }, + config = function() + local metals_config = require('metals').bare_config() + metals_config.init_options.statusBarProvider = "on" + metals_config.settings = { + showImplicitArguments = true, + superMethodLensesEnabled = true, + } + metals_config.on_attach = function(client, bufnr) + require("metals").setup_dap() + require("my_lsp").on_attach(client, bufnr) + end + metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() + -- Debug settings if you're using nvim-dap + local dap = require("dap") + dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example + }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", + }, + }, + } + + + -- Autocmd that will actually be in charging of starting the whole thing + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + -- NOTE: You may or may not want java included here. You will need it if you + -- want basic Java support but it may also conflict if you are using + -- something like nvim-jdtls which also works on a java filetype autocmd. + pattern = { "scala", "sbt" }, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) + + return metals_config + end +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..d1b69f8 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,54 @@ +--Plug 'nvim-telescope/telescope.nvim' + +--Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } +--Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' +--Plug 'nvim-telescope/telescope-ui-select.nvim' +return { + "nvim-telescope/telescope.nvim", + dependencies = { + {'nvim-telescope/telescope-fzf-native.nvim', + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', + }, + 'gbrlsnchs/telescope-lsp-handlers.nvim', + 'nvim-telescope/telescope-ui-select.nvim', +--Plug { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } + }, + cmd = "Telescope", + version = false, + keys = { + {',ff', require("telescope.builtin").fd, desc = "Find files"}, + {',fg', require("telescope.builtin").git_files, desc = "Find files (git)"}, + {',gs', require("telescope.builtin").git_status, desc = "Git status"}, + {',s', require("telescope.builtin").lsp_dynamic_workspace_symbols, desc = "Symbols"}, + {'g/', require("telescope.builtin").live_grep, desc = "Live grep"}, + {'', require("telescope.builtin").current_buffer_fuzzy_find, desc = "Fuzzy find"}, + {'*', require("telescope.builtin").grep_string, desc = "Find at cursor"}, + {'gb', require("telescope.builtin").buffers}, + { ":", require("telescope.builtin").command_history, desc = "Command History" }, + { ";", require("telescope.builtin").commands, desc = "Commands" }, + }, + opts = { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown { } + }, + }, + }, + config = function(_, opts) + local telescope = require('telescope') + telescope.setup(opts) + telescope.load_extension('fzf') + telescope.load_extension('ui-select') + end, + } diff --git a/lua/plugins/text-to-color.lua b/lua/plugins/text-to-color.lua new file mode 100644 index 0000000..ef20908 --- /dev/null +++ b/lua/plugins/text-to-color.lua @@ -0,0 +1,12 @@ +return { + 'svermeulen/text-to-colorscheme', + dependencies = { 'tsuyoshicho/vim-pass' }, + config = function () + require('text-to-colorscheme').setup { + ai = { + gpt_model = "gpt-3.5-turbo", + openai_api_key = vim.fn['pass#get']('apikeys/openai_vim'), + }, + } + end +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..8f77982 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,88 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + version = false, -- last release is way too old and doesn't work on Windows + build = ":TSUpdate", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + { + "nvim-treesitter/nvim-treesitter-textobjects", + init = function() + -- PERF: no need to load the plugin, if we only need its queries for mini.ai + local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"] + local opts = require("lazy.core.plugin").values(plugin, "opts", false) + local enabled = false + if opts.textobjects then + for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do + if opts.textobjects[mod] and opts.textobjects[mod].enable then + enabled = true + break + end + end + end + if not enabled then + require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects") + end + end, + }, + }, + keys = { + { "", desc = "Increment selection" }, + { "", desc = "Decrement selection", mode = "x" }, + }, + ---@type TSConfig + opts = { + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { + "bash", + "gitignore", + "html", + "java", + "json", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "scala", + "tsx", + "typescript", + "vim", + "vimdoc", + "yaml", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }, + ---@param opts TSConfig + config = function(_, opts) + if type(opts.ensure_installed) == "table" then + ---@type table + local added = {} + opts.ensure_installed = vim.tbl_filter(function(lang) + if added[lang] then + return false + end + added[lang] = true + return true + end, opts.ensure_installed) + end + require("nvim-treesitter.configs").setup(opts) + end, + }, + { 'nvim-treesitter/playground', + cmd = 'TSPlaygroundToggle' + }, + +} diff --git a/packages.vim b/packages.vim deleted file mode 100644 index 04ef77a..0000000 --- a/packages.vim +++ /dev/null @@ -1,125 +0,0 @@ -call plug#begin(expand(':p:h') . '/plugged') - -" basic stuff -Plug 'pbrisbin/vim-mkdir' -Plug 'embear/vim-localvimrc' - -Plug 'crater2150/vim-theme-chroma' -"Plug '~/sources/chroma-colors/vim' -Plug 'fladson/vim-kitty' - -" generic -Plug 'ryicoh/deepl.vim' -Plug 'tsuyoshicho/vim-pass' - -" tim pope stuff -Plug 'tpope/vim-repeat' " . for commands from plugins -Plug 'tpope/vim-surround' " add/remove braces,quotes,... -Plug 'tpope/vim-characterize' " More info in ga output -Plug 'tpope/vim-eunuch' " :Delete, :Move, etc. -Plug 'tpope/vim-commentary' " gc operator -Plug 'tpope/vim-sleuth' " detect shiftwidth/expandtab -" -" motions and textobjects -Plug 'kana/vim-textobj-user' | Plug 'glts/vim-textobj-comment' " ic / ac -Plug 'michaeljsmith/vim-indent-object' -Plug 'vim-scripts/argtextobj.vim' - -Plug 'airblade/vim-gitgutter' - -" LSP -Plug 'neovim/nvim-lspconfig' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'hrsh7th/cmp-vsnip' -Plug 'hrsh7th/nvim-cmp' -Plug 'hrsh7th/vim-vsnip' -Plug 'hrsh7th/vim-vsnip-integ' -Plug 'nvim-lua/plenary.nvim' -Plug 'scalameta/nvim-metals' -Plug 'williamboman/mason.nvim' -Plug 'williamboman/mason-lspconfig.nvim' -Plug 'onsails/lspkind.nvim' - - -Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -Plug 'nvim-lua/lsp-status.nvim' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'folke/trouble.nvim' -Plug 'folke/lsp-colors.nvim' -Plug 'nvim-lua/popup.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-telescope/telescope.nvim' -Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' -Plug 'nvim-telescope/telescope-ui-select.nvim' -Plug 'ray-x/lsp_signature.nvim' -Plug 'mfussenegger/nvim-jdtls' - -Plug 'mfussenegger/nvim-dap' - -Plug 'zbirenbaum/copilot.lua' -Plug 'zbirenbaum/copilot-cmp' - -Plug 'machakann/vim-highlightedyank' - -Plug 'junegunn/vim-easy-align' - -" for stuff installed via disto package manager, e.g. fzf's bundled vim plugin -Plug '/usr/share/vim/vimfiles' - -Plug 'vim-airline/vim-airline' -Plug 'lambdalisue/suda.vim' - -Plug 'vim-scripts/SyntaxRange' - -Plug 'lukas-reineke/indent-blankline.nvim' - -" ruby -Plug 'depuracao/vim-rdoc' -Plug 'vim-ruby/vim-ruby' -Plug 'tpope/vim-rails' -Plug 'tpope/vim-rake' - -" git -Plug 'lambdalisue/gina.vim' -Plug 'gregsexton/gitv' -Plug 'gisphm/vim-gitignore' -Plug 'sjl/splice.vim' - - -" other filetype specific plugins -Plug 'jamessan/vim-gnupg' -let g:no_cecutil_maps = 1 -Plug 'powerman/vim-plugin-AnsiEsc' -Plug 'tpope/vim-markdown' -Plug 'lervag/vimtex' -" let g:vimtex_compiler_method = 'arara' -Plug 'ledger/vim-ledger' -Plug 'anekos/hledger-vim' -Plug 'elzr/vim-json' -Plug 'kchmck/vim-coffee-script' -Plug 'gre/play2vim' -Plug 'isobit/vim-caddyfile' -Plug 'vim-pandoc/vim-pandoc' -Plug 'vim-pandoc/vim-pandoc-syntax' -Plug 'GEverding/vim-hocon' -Plug 'nfnty/vim-nftables' - -function! BuildComposer(info) - if a:info.status != 'unchanged' || a:info.force - if has('nvim') - !cargo build --release - else - !cargo build --release --no-default-features --features json-rpc - endif - endif -endfunction - -Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') } - -call plug#end() - -" vim:ft=vim foldmethod=marker diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua new file mode 100644 index 0000000..0fe3a52 --- /dev/null +++ b/plugin/on-attach.lua @@ -0,0 +1,46 @@ +local on_attach = function(args) + local bufnr = args.buf + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + + --Enable completion triggered by + vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Mappings. + local opts = { silent = true, buffer = bufnr } + local loud = { buffer = bufnr } + + local map = vim.keymap.set + -- See `:help vim.lsp.*` for documentation on any of the below functions + map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) + map('n', 'gD', vim.lsp.buf.declaration, opts) + map('n', 'gd', vim.lsp.buf.definition, opts) + map('n', 'K', vim.lsp.buf.hover, opts) + map('v', 'K', vim.lsp.buf.hover, opts) + map('n', 'gi', vim.lsp.buf.implementation, opts) + map('n', '', vim.lsp.buf.signature_help, opts) + map('n', 'D', vim.lsp.buf.type_definition, opts) + map('n', 'rn', vim.lsp.buf.rename, opts) + map('n', '', vim.lsp.buf.code_action, loud) + map('n', '', vim.lsp.codelens.run, loud) + map('n', 'gr', vim.lsp.buf.references, opts) + map('n', '', vim.diagnostic.open_float, opts) + map('n', '[d', vim.diagnostic.goto_prev, opts) + map('n', ']d', vim.diagnostic.goto_next, opts) + map('n', '', vim.diagnostic.setloclist, opts) + map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) + map("n", "dc", function() require("dap").continue() end, opts) + map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) + map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) + map("n", "dso", function() require("dap").step_over() end, opts) + map("n", "dsi", function() require("dap").step_into() end, opts) + map("n", "dl", function() require("dap").run_last() end, opts) + + map("n", "aa", vim.diagnostic.setqflist, opts) + map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) + map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) + + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] +end + +vim.api.nvim_create_autocmd("LspAttach", { callback = on_attach }) diff --git a/syntax/tolua.vim b/syntax/tolua.vim deleted file mode 100644 index 33c1ced..0000000 --- a/syntax/tolua.vim +++ /dev/null @@ -1,41 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syn include @EmbeddedLua syntax/lua.vim -syn include @EmbeddedPreproc syntax/c.vim - -syn match toluaString "\".*\"" -syn match toluaInclude "<.*>" -syn region toluaEmbeddedLua matchgroup=toluaEmbeddedDelimiter - \ start="^\$\[" end="^\$\]" contains=@EmbeddedLua -syn match toluaCInclude "^\$#.*$" contains=toluaString,toluaInclude - -syn keyword toluaStatement module nextgroup=toluaModuleName skipwhite -syn match toluaModuleName "[_a-zA-Z]\+" contained - -syn match toluaRename "@ [_a-zA-Z]\+" - -" from c syntax file -syn keyword cType int long short char void -syn keyword cType signed unsigned float double -syn keyword luaState lua_State - -syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend -syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend -syn keyword cStructure struct union enum typedef -syn keyword cStorageClass static register auto volatile extern const - -let b:current_syntax = "tolua" - -hi def link toluaEmbeddedDelimiter Special -hi def link toluaCInclude PreProc -hi def link toluaString String -hi def link toluaInclude String -hi def link toluaStatement Statement -hi def link toluaModuleName Identifier -hi def link toluaRename Special -hi def link cType Type -hi def link luaState Type -hi def link cStorageClass StorageClass -hi def link cStructure Structure From 9605898edd8304ac426c614e62e3016e7c168b59 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 20 Jun 2023 11:49:37 +0200 Subject: [PATCH 16/81] Remove remaining plug.vim --- autoload/plug.vim | 2812 --------------------------------------------- 1 file changed, 2812 deletions(-) delete mode 100644 autoload/plug.vim diff --git a/autoload/plug.vim b/autoload/plug.vim deleted file mode 100644 index 652caa8..0000000 --- a/autoload/plug.vim +++ /dev/null @@ -1,2812 +0,0 @@ -" vim-plug: Vim plugin manager -" ============================ -" -" Download plug.vim and put it in ~/.vim/autoload -" -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" -" Edit your .vimrc -" -" call plug#begin('~/.vim/plugged') -" -" " Make sure you use single quotes -" -" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align -" Plug 'junegunn/vim-easy-align' -" -" " Any valid git URL is allowed -" Plug 'https://github.com/junegunn/vim-github-dashboard.git' -" -" " Multiple Plug commands can be written in a single line using | separators -" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' -" -" " On-demand loading -" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } -" -" " Using a non-default branch -" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } -" -" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) -" Plug 'fatih/vim-go', { 'tag': '*' } -" -" " Plugin options -" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } -" -" " Plugin outside ~/.vim/plugged with post-update hook -" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -" -" " Unmanaged plugin (manually installed and updated) -" Plug '~/my-prototype-plugin' -" -" " Initialize plugin system -" call plug#end() -" -" Then reload .vimrc and :PlugInstall to install plugins. -" -" Plug options: -" -"| Option | Description | -"| ----------------------- | ------------------------------------------------ | -"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | -"| `rtp` | Subdirectory that contains Vim plugin | -"| `dir` | Custom directory for the plugin | -"| `as` | Use different name for the plugin | -"| `do` | Post-update hook (string or funcref) | -"| `on` | On-demand loading: Commands or ``-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" -" More information: https://github.com/junegunn/vim-plug -" -" -" Copyright (c) 2017 Junegunn Choi -" -" MIT License -" -" Permission is hereby granted, free of charge, to any person obtaining -" a copy of this software and associated documentation files (the -" "Software"), to deal in the Software without restriction, including -" without limitation the rights to use, copy, modify, merge, publish, -" distribute, sublicense, and/or sell copies of the Software, and to -" permit persons to whom the Software is furnished to do so, subject to -" the following conditions: -" -" The above copyright notice and this permission notice shall be -" included in all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -if exists('g:loaded_plug') - finish -endif -let g:loaded_plug = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let s:plug_src = 'https://github.com/junegunn/vim-plug.git' -let s:plug_tab = get(s:, 'plug_tab', -1) -let s:plug_buf = get(s:, 'plug_buf', -1) -let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') -let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) -let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -if s:is_win && &shellslash - set noshellslash - let s:me = resolve(expand(':p')) - set shellslash -else - let s:me = resolve(expand(':p')) -endif -let s:base_spec = { 'branch': '', 'frozen': 0 } -let s:TYPE = { -\ 'string': type(''), -\ 'list': type([]), -\ 'dict': type({}), -\ 'funcref': type(function('call')) -\ } -let s:loaded = get(s:, 'loaded', {}) -let s:triggers = get(s:, 'triggers', {}) - -function! s:is_powershell(shell) - return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$' -endfunction - -function! s:isabsolute(dir) abort - return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)') -endfunction - -function! s:git_dir(dir) abort - let gitdir = s:trim(a:dir) . '/.git' - if isdirectory(gitdir) - return gitdir - endif - if !filereadable(gitdir) - return '' - endif - let gitdir = matchstr(get(readfile(gitdir), 0, ''), '^gitdir: \zs.*') - if len(gitdir) && !s:isabsolute(gitdir) - let gitdir = a:dir . '/' . gitdir - endif - return isdirectory(gitdir) ? gitdir : '' -endfunction - -function! s:git_origin_url(dir) abort - let gitdir = s:git_dir(a:dir) - let config = gitdir . '/config' - if empty(gitdir) || !filereadable(config) - return '' - endif - return matchstr(join(readfile(config)), '\[remote "origin"\].\{-}url\s*=\s*\zs\S*\ze') -endfunction - -function! s:git_revision(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - - let line = get(readfile(head), 0, '') - let ref = matchstr(line, '^ref: \zs.*') - if empty(ref) - return line - endif - - if filereadable(gitdir . '/' . ref) - return get(readfile(gitdir . '/' . ref), 0, '') - endif - - if filereadable(gitdir . '/packed-refs') - for line in readfile(gitdir . '/packed-refs') - if line =~# ' ' . ref - return matchstr(line, '^[0-9a-f]*') - endif - endfor - endif - - return '' -endfunction - -function! s:git_local_branch(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - let branch = matchstr(get(readfile(head), 0, ''), '^ref: refs/heads/\zs.*') - return len(branch) ? branch : 'HEAD' -endfunction - -function! s:git_origin_branch(spec) - if len(a:spec.branch) - return a:spec.branch - endif - - " The file may not be present if this is a local repository - let gitdir = s:git_dir(a:spec.dir) - let origin_head = gitdir.'/refs/remotes/origin/HEAD' - if len(gitdir) && filereadable(origin_head) - return matchstr(get(readfile(origin_head), 0, ''), - \ '^ref: refs/remotes/origin/\zs.*') - endif - - " The command may not return the name of a branch in detached HEAD state - let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir)) - return v:shell_error ? '' : result[-1] -endfunction - -if s:is_win - function! s:plug_call(fn, ...) - let shellslash = &shellslash - try - set noshellslash - return call(a:fn, a:000) - finally - let &shellslash = shellslash - endtry - endfunction -else - function! s:plug_call(fn, ...) - return call(a:fn, a:000) - endfunction -endif - -function! s:plug_getcwd() - return s:plug_call('getcwd') -endfunction - -function! s:plug_fnamemodify(fname, mods) - return s:plug_call('fnamemodify', a:fname, a:mods) -endfunction - -function! s:plug_expand(fmt) - return s:plug_call('expand', a:fmt, 1) -endfunction - -function! s:plug_tempname() - return s:plug_call('tempname') -endfunction - -function! plug#begin(...) - if a:0 > 0 - let s:plug_home_org = a:1 - let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) - elseif exists('g:plug_home') - let home = s:path(g:plug_home) - elseif has('nvim') - let home = stdpath('data') . '/plugged' - elseif !empty(&rtp) - let home = s:path(split(&rtp, ',')[0]) . '/plugged' - else - return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') - endif - if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp - return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') - endif - - let g:plug_home = home - let g:plugs = {} - let g:plugs_order = [] - let s:triggers = {} - - call s:define_commands() - return 1 -endfunction - -function! s:define_commands() - command! -nargs=+ -bar Plug call plug#() - if !executable('git') - return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') - endif - if has('win32') - \ && &shellslash - \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell)) - return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') - endif - if !has('nvim') - \ && (has('win32') || has('win32unix')) - \ && !has('multi_byte') - return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') - endif - command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) - command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) - command! -nargs=0 -bar -bang PlugClean call s:clean(0) - command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif - command! -nargs=0 -bar PlugStatus call s:status() - command! -nargs=0 -bar PlugDiff call s:diff() - command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) -endfunction - -function! s:to_a(v) - return type(a:v) == s:TYPE.list ? a:v : [a:v] -endfunction - -function! s:to_s(v) - return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" -endfunction - -function! s:glob(from, pattern) - return s:lines(globpath(a:from, a:pattern)) -endfunction - -function! s:source(from, ...) - let found = 0 - for pattern in a:000 - for vim in s:glob(a:from, pattern) - execute 'source' s:esc(vim) - let found = 1 - endfor - endfor - return found -endfunction - -function! s:assoc(dict, key, val) - let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) -endfunction - -function! s:ask(message, ...) - call inputsave() - echohl WarningMsg - let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) - echohl None - call inputrestore() - echo "\r" - return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 -endfunction - -function! s:ask_no_interrupt(...) - try - return call('s:ask', a:000) - catch - return 0 - endtry -endfunction - -function! s:lazy(plug, opt) - return has_key(a:plug, a:opt) && - \ (empty(s:to_a(a:plug[a:opt])) || - \ !isdirectory(a:plug.dir) || - \ len(s:glob(s:rtp(a:plug), 'plugin')) || - \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) -endfunction - -function! plug#end() - if !exists('g:plugs') - return s:err('plug#end() called without calling plug#begin() first') - endif - - if exists('#PlugLOD') - augroup PlugLOD - autocmd! - augroup END - augroup! PlugLOD - endif - let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - - if get(g:, 'did_load_filetypes', 0) - filetype off - endif - for name in g:plugs_order - if !has_key(g:plugs, name) - continue - endif - let plug = g:plugs[name] - if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') - let s:loaded[name] = 1 - continue - endif - - if has_key(plug, 'on') - let s:triggers[name] = { 'map': [], 'cmd': [] } - for cmd in s:to_a(plug.on) - if cmd =~? '^.\+' - if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) - call s:assoc(lod.map, cmd, name) - endif - call add(s:triggers[name].map, cmd) - elseif cmd =~# '^[A-Z]' - let cmd = substitute(cmd, '!*$', '', '') - if exists(':'.cmd) != 2 - call s:assoc(lod.cmd, cmd, name) - endif - call add(s:triggers[name].cmd, cmd) - else - call s:err('Invalid `on` option: '.cmd. - \ '. Should start with an uppercase letter or ``.') - endif - endfor - endif - - if has_key(plug, 'for') - let types = s:to_a(plug.for) - if !empty(types) - augroup filetypedetect - call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') - augroup END - endif - for type in types - call s:assoc(lod.ft, type, name) - endfor - endif - endfor - - for [cmd, names] in items(lod.cmd) - execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', - \ cmd, string(cmd), string(names)) - endfor - - for [map, names] in items(lod.map) - for [mode, map_prefix, key_prefix] in - \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] - execute printf( - \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', - \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) - endfor - endfor - - for [ft, names] in items(lod.ft) - augroup PlugLOD - execute printf('autocmd FileType %s call lod_ft(%s, %s)', - \ ft, string(ft), string(names)) - augroup END - endfor - - call s:reorg_rtp() - filetype plugin indent on - if has('vim_starting') - if has('syntax') && !exists('g:syntax_on') - syntax enable - end - else - call s:reload_plugins() - endif -endfunction - -function! s:loaded_names() - return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') -endfunction - -function! s:load_plugin(spec) - call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') -endfunction - -function! s:reload_plugins() - for name in s:loaded_names() - call s:load_plugin(g:plugs[name]) - endfor -endfunction - -function! s:trim(str) - return substitute(a:str, '[\/]\+$', '', '') -endfunction - -function! s:version_requirement(val, min) - for idx in range(0, len(a:min) - 1) - let v = get(a:val, idx, 0) - if v < a:min[idx] | return 0 - elseif v > a:min[idx] | return 1 - endif - endfor - return 1 -endfunction - -function! s:git_version_requirement(...) - if !exists('s:git_version') - let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') - endif - return s:version_requirement(s:git_version, a:000) -endfunction - -function! s:progress_opt(base) - return a:base && !s:is_win && - \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' -endfunction - -function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) -endfunction - -if s:is_win - function! s:path(path) - return s:trim(substitute(a:path, '/', '\', 'g')) - endfunction - - function! s:dirpath(path) - return s:path(a:path) . '\' - endfunction - - function! s:is_local_plug(repo) - return a:repo =~? '^[a-z]:\|^[%~]' - endfunction - - " Copied from fzf - function! s:wrap_cmds(cmds) - let cmds = [ - \ '@echo off', - \ 'setlocal enabledelayedexpansion'] - \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) - \ + ['endlocal'] - if has('iconv') - if !exists('s:codepage') - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) - endif - return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) - endif - return map(cmds, 'v:val."\r"') - endfunction - - function! s:batchfile(cmd) - let batchfile = s:plug_tempname().'.bat' - call writefile(s:wrap_cmds(a:cmd), batchfile) - let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - return [batchfile, cmd] - endfunction -else - function! s:path(path) - return s:trim(a:path) - endfunction - - function! s:dirpath(path) - return substitute(a:path, '[/\\]*$', '/', '') - endfunction - - function! s:is_local_plug(repo) - return a:repo[0] =~ '[/$~]' - endfunction -endif - -function! s:err(msg) - echohl ErrorMsg - echom '[vim-plug] '.a:msg - echohl None -endfunction - -function! s:warn(cmd, msg) - echohl WarningMsg - execute a:cmd 'a:msg' - echohl None -endfunction - -function! s:esc(path) - return escape(a:path, ' ') -endfunction - -function! s:escrtp(path) - return escape(a:path, ' ,') -endfunction - -function! s:remove_rtp() - for name in s:loaded_names() - let rtp = s:rtp(g:plugs[name]) - execute 'set rtp-='.s:escrtp(rtp) - let after = globpath(rtp, 'after') - if isdirectory(after) - execute 'set rtp-='.s:escrtp(after) - endif - endfor -endfunction - -function! s:reorg_rtp() - if !empty(s:first_rtp) - execute 'set rtp-='.s:first_rtp - execute 'set rtp-='.s:last_rtp - endif - - " &rtp is modified from outside - if exists('s:prtp') && s:prtp !=# &rtp - call s:remove_rtp() - unlet! s:middle - endif - - let s:middle = get(s:, 'middle', &rtp) - let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') - let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') - let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') - \ . ','.s:middle.',' - \ . join(map(afters, 'escape(v:val, ",")'), ',') - let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') - let s:prtp = &rtp - - if !empty(s:first_rtp) - execute 'set rtp^='.s:first_rtp - execute 'set rtp+='.s:last_rtp - endif -endfunction - -function! s:doautocmd(...) - if exists('#'.join(a:000, '#')) - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) - endif -endfunction - -function! s:dobufread(names) - for name in a:names - let path = s:rtp(g:plugs[name]) - for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] - if len(finddir(dir, path)) - if exists('#BufRead') - doautocmd BufRead - endif - return - endif - endfor - endfor -endfunction - -function! plug#load(...) - if a:0 == 0 - return s:err('Argument missing: plugin name(s) required') - endif - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 - let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') - if !empty(unknowns) - let s = len(unknowns) > 1 ? 's' : '' - return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) - end - let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') - if !empty(unloaded) - for name in unloaded - call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - endfor - call s:dobufread(unloaded) - return 1 - end - return 0 -endfunction - -function! s:remove_triggers(name) - if !has_key(s:triggers, a:name) - return - endif - for cmd in s:triggers[a:name].cmd - execute 'silent! delc' cmd - endfor - for map in s:triggers[a:name].map - execute 'silent! unmap' map - execute 'silent! iunmap' map - endfor - call remove(s:triggers, a:name) -endfunction - -function! s:lod(names, types, ...) - for name in a:names - call s:remove_triggers(name) - let s:loaded[name] = 1 - endfor - call s:reorg_rtp() - - for name in a:names - let rtp = s:rtp(g:plugs[name]) - for dir in a:types - call s:source(rtp, dir.'/**/*.vim') - endfor - if a:0 - if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) - execute 'runtime' a:1 - endif - call s:source(rtp, a:2) - endif - call s:doautocmd('User', name) - endfor -endfunction - -function! s:lod_ft(pat, names) - let syn = 'syntax/'.a:pat.'.vim' - call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) - execute 'autocmd! PlugLOD FileType' a:pat - call s:doautocmd('filetypeplugin', 'FileType') - call s:doautocmd('filetypeindent', 'FileType') -endfunction - -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction - -function! s:lod_map(map, names, with_prefix, prefix) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - let extra = '' - while 1 - let c = getchar(0) - if c == 0 - break - endif - let extra .= nr2char(c) - endwhile - - if a:with_prefix - let prefix = v:count ? v:count : '' - let prefix .= '"'.v:register.a:prefix - if mode(1) == 'no' - if v:operator == 'c' - let prefix = "\" . prefix - endif - let prefix .= v:operator - endif - call feedkeys(prefix, 'n') - endif - call feedkeys(substitute(a:map, '^', "\", '') . extra) -endfunction - -function! plug#(repo, ...) - if a:0 > 1 - return s:err('Invalid number of arguments (1..2)') - endif - - try - let repo = s:trim(a:repo) - let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) - let spec = extend(s:infer_properties(name, repo), opts) - if !has_key(g:plugs, name) - call add(g:plugs_order, name) - endif - let g:plugs[name] = spec - let s:loaded[name] = get(s:loaded, name, 0) - catch - return s:err(repo . ' ' . v:exception) - endtry -endfunction - -function! s:parse_options(arg) - let opts = copy(s:base_spec) - let type = type(a:arg) - let opt_errfmt = 'Invalid argument for "%s" option of :Plug (expected: %s)' - if type == s:TYPE.string - if empty(a:arg) - throw printf(opt_errfmt, 'tag', 'string') - endif - let opts.tag = a:arg - elseif type == s:TYPE.dict - for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as'] - if has_key(a:arg, opt) - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string') - endif - endfor - for opt in ['on', 'for'] - if has_key(a:arg, opt) - \ && type(a:arg[opt]) != s:TYPE.list - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string or list') - endif - endfor - if has_key(a:arg, 'do') - \ && type(a:arg.do) != s:TYPE.funcref - \ && (type(a:arg.do) != s:TYPE.string || empty(a:arg.do)) - throw printf(opt_errfmt, 'do', 'string or funcref') - endif - call extend(opts, a:arg) - if has_key(opts, 'dir') - let opts.dir = s:dirpath(s:plug_expand(opts.dir)) - endif - else - throw 'Invalid argument type (expected: string or dictionary)' - endif - return opts -endfunction - -function! s:infer_properties(name, repo) - let repo = a:repo - if s:is_local_plug(repo) - return { 'dir': s:dirpath(s:plug_expand(repo)) } - else - if repo =~ ':' - let uri = repo - else - if repo !~ '/' - throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) - endif - let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') - let uri = printf(fmt, repo) - endif - return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } - endif -endfunction - -function! s:install(force, names) - call s:update_impl(0, a:force, a:names) -endfunction - -function! s:update(force, names) - call s:update_impl(1, a:force, a:names) -endfunction - -function! plug#helptags() - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - for spec in values(g:plugs) - let docd = join([s:rtp(spec), 'doc'], '/') - if isdirectory(docd) - silent! execute 'helptags' s:esc(docd) - endif - endfor - return 1 -endfunction - -function! s:syntax() - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-\{1}\ / - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn match plugH2 /^-\{2,}/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - -function! s:lpad(str, len) - return a:str . repeat(' ', a:len - len(a:str)) -endfunction - -function! s:lines(msg) - return split(a:msg, "[\r\n]") -endfunction - -function! s:lastline(msg) - return get(s:lines(a:msg), -1, '') -endfunction - -function! s:new_window() - execute get(g:, 'plug_window', 'vertical topleft new') -endfunction - -function! s:plug_window_exists() - let buflist = tabpagebuflist(s:plug_tab) - return !empty(buflist) && index(buflist, s:plug_buf) >= 0 -endfunction - -function! s:switch_in() - if !s:plug_window_exists() - return 0 - endif - - if winbufnr(0) != s:plug_buf - let s:pos = [tabpagenr(), winnr(), winsaveview()] - execute 'normal!' s:plug_tab.'gt' - let winnr = bufwinnr(s:plug_buf) - execute winnr.'wincmd w' - call add(s:pos, winsaveview()) - else - let s:pos = [winsaveview()] - endif - - setlocal modifiable - return 1 -endfunction - -function! s:switch_out(...) - call winrestview(s:pos[-1]) - setlocal nomodifiable - if a:0 > 0 - execute a:1 - endif - - if len(s:pos) > 1 - execute 'normal!' s:pos[0].'gt' - execute s:pos[1] 'wincmd w' - call winrestview(s:pos[2]) - endif -endfunction - -function! s:finish_bindings() - nnoremap R :call retry() - nnoremap D :PlugDiff - nnoremap S :PlugStatus - nnoremap U :call status_update() - xnoremap U :call status_update() - nnoremap ]] :silent! call section('') - nnoremap [[ :silent! call section('b') -endfunction - -function! s:prepare(...) - if empty(s:plug_getcwd()) - throw 'Invalid current working directory. Cannot proceed.' - endif - - for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] - if exists(evar) - throw evar.' detected. Cannot proceed.' - endif - endfor - - call s:job_abort() - if s:switch_in() - if b:plug_preview == 1 - pc - endif - enew - else - call s:new_window() - endif - - nnoremap q :call close_pane() - if a:0 == 0 - call s:finish_bindings() - endif - let b:plug_preview = -1 - let s:plug_tab = tabpagenr() - let s:plug_buf = winbufnr(0) - call s:assign_name() - - for k in ['', 'L', 'o', 'X', 'd', 'dd'] - execute 'silent! unmap ' k - endfor - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell - if exists('+colorcolumn') - setlocal colorcolumn= - endif - setf vim-plug - if exists('g:syntax_on') - call s:syntax() - endif -endfunction - -function! s:close_pane() - if b:plug_preview == 1 - pc - let b:plug_preview = -1 - else - bd - endif -endfunction - -function! s:assign_name() - " Assign buffer name - let prefix = '[Plugins]' - let name = prefix - let idx = 2 - while bufexists(name) - let name = printf('%s (%s)', prefix, idx) - let idx = idx + 1 - endwhile - silent! execute 'f' fnameescape(name) -endfunction - -function! s:chsh(swap) - let prev = [&shell, &shellcmdflag, &shellredir] - if !s:is_win - set shell=sh - endif - if a:swap - if s:is_powershell(&shell) - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' - elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$' - set shellredir=>%s\ 2>&1 - endif - endif - return prev -endfunction - -function! s:bang(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(a:0) - " FIXME: Escaping is incomplete. We could use shellescape with eval, - " but it won't work on Windows. - let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') - execute "normal! :execute g:_plug_bang\\" - finally - unlet g:_plug_bang - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - return v:shell_error ? 'Exit status: ' . v:shell_error : '' -endfunction - -function! s:regress_bar() - let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') - call s:progress_bar(2, bar, len(bar)) -endfunction - -function! s:is_updated(dir) - return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) -endfunction - -function! s:do(pull, force, todo) - for [name, spec] in items(a:todo) - if !isdirectory(spec.dir) - continue - endif - let installed = has_key(s:update.new, name) - let updated = installed ? 0 : - \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) - if a:force || installed || updated - execute 'cd' s:esc(spec.dir) - call append(3, '- Post-update hook for '. name .' ... ') - let error = '' - let type = type(spec.do) - if type == s:TYPE.string - if spec.do[0] == ':' - if !get(s:loaded, name, 0) - let s:loaded[name] = 1 - call s:reorg_rtp() - endif - call s:load_plugin(spec) - try - execute spec.do[1:] - catch - let error = v:exception - endtry - if !s:plug_window_exists() - cd - - throw 'Warning: vim-plug was terminated by the post-update hook of '.name - endif - else - let error = s:bang(spec.do) - endif - elseif type == s:TYPE.funcref - try - call s:load_plugin(spec) - let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') - call spec.do({ 'name': name, 'status': status, 'force': a:force }) - catch - let error = v:exception - endtry - else - let error = 'Invalid hook type' - endif - call s:switch_in() - call setline(4, empty(error) ? (getline(4) . 'OK') - \ : ('x' . getline(4)[1:] . error)) - if !empty(error) - call add(s:update.errors, name) - call s:regress_bar() - endif - cd - - endif - endfor -endfunction - -function! s:hash_match(a, b) - return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 -endfunction - -function! s:checkout(spec) - let sha = a:spec.commit - let output = s:git_revision(a:spec.dir) - if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) - let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' - let output = s:system( - \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) - endif - return output -endfunction - -function! s:finish(pull) - let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) - if new_frozen - let s = new_frozen > 1 ? 's' : '' - call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) - endif - call append(3, '- Finishing ... ') | 4 - redraw - call plug#helptags() - call plug#end() - call setline(4, getline(4) . 'Done!') - redraw - let msgs = [] - if !empty(s:update.errors) - call add(msgs, "Press 'R' to retry.") - endif - if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) - call add(msgs, "Press 'D' to see the updated changes.") - endif - echo join(msgs, ' ') - call s:finish_bindings() -endfunction - -function! s:retry() - if empty(s:update.errors) - return - endif - echo - call s:update_impl(s:update.pull, s:update.force, - \ extend(copy(s:update.errors), [s:update.threads])) -endfunction - -function! s:is_managed(name) - return has_key(g:plugs[a:name], 'uri') -endfunction - -function! s:names(...) - return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) -endfunction - -function! s:check_ruby() - silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") - if !exists('g:plug_ruby') - redraw! - return s:warn('echom', 'Warning: Ruby interface is broken') - endif - let ruby_version = split(g:plug_ruby, '\.') - unlet g:plug_ruby - return s:version_requirement(ruby_version, [1, 8, 7]) -endfunction - -function! s:update_impl(pull, force, args) abort - let sync = index(a:args, '--sync') >= 0 || has('vim_starting') - let args = filter(copy(a:args), 'v:val != "--sync"') - let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? - \ remove(args, -1) : get(g:, 'plug_threads', 16) - - let managed = filter(copy(g:plugs), 's:is_managed(v:key)') - let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : - \ filter(managed, 'index(args, v:key) >= 0') - - if empty(todo) - return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) - endif - - if !s:is_win && s:git_version_requirement(2, 3) - let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' - let $GIT_TERMINAL_PROMPT = 0 - for plug in values(todo) - let plug.uri = substitute(plug.uri, - \ '^https://git::@github\.com', 'https://github.com', '') - endfor - endif - - if !isdirectory(g:plug_home) - try - call mkdir(g:plug_home, 'p') - catch - return s:err(printf('Invalid plug directory: %s. '. - \ 'Try to call plug#begin with a valid directory', g:plug_home)) - endtry - endif - - if has('nvim') && !exists('*jobwait') && threads > 1 - call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') - endif - - let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() - - let s:update = { - \ 'start': reltime(), - \ 'all': todo, - \ 'todo': copy(todo), - \ 'errors': [], - \ 'pull': a:pull, - \ 'force': a:force, - \ 'new': {}, - \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, - \ 'bar': '', - \ 'fin': 0 - \ } - - call s:prepare(1) - call append(0, ['', '']) - normal! 2G - silent! redraw - - " Set remote name, overriding a possible user git config's clone.defaultRemoteName - let s:clone_opt = ['--origin', 'origin'] - if get(g:, 'plug_shallow', 1) - call extend(s:clone_opt, ['--depth', '1']) - if s:git_version_requirement(1, 7, 10) - call add(s:clone_opt, '--no-single-branch') - endif - endif - - if has('win32unix') || has('wsl') - call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) - endif - - let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' - - " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 - redir => pyv - silent python import platform; print platform.python_version() - redir END - let python = s:version_requirement( - \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) - endif - - if (python || ruby) && s:update.threads > 1 - try - let imd = &imd - if s:mac_gui - set noimd - endif - if ruby - call s:update_ruby() - else - call s:update_python() - endif - catch - let lines = getline(4, '$') - let printed = {} - silent! 4,$d _ - for line in lines - let name = s:extract_name(line, '.', '') - if empty(name) || !has_key(printed, name) - call append('$', line) - if !empty(name) - let printed[name] = 1 - if line[0] == 'x' && index(s:update.errors, name) < 0 - call add(s:update.errors, name) - end - endif - endif - endfor - finally - let &imd = imd - call s:update_finish() - endtry - else - call s:update_vim() - while use_job && sync - sleep 100m - if s:update.fin - break - endif - endwhile - endif -endfunction - -function! s:log4(name, msg) - call setline(4, printf('- %s (%s)', a:msg, a:name)) - redraw -endfunction - -function! s:update_finish() - if exists('s:git_terminal_prompt') - let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt - endif - if s:switch_in() - call append(3, '- Updating ...') | 4 - for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) - let [pos, _] = s:logpos(name) - if !pos - continue - endif - if has_key(spec, 'commit') - call s:log4(name, 'Checking out '.spec.commit) - let out = s:checkout(spec) - elseif has_key(spec, 'tag') - let tag = spec.tag - if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) - if !v:shell_error && !empty(tags) - let tag = tags[0] - call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) - call append(3, '') - endif - endif - call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) - else - let branch = s:git_origin_branch(spec) - call s:log4(name, 'Merging origin/'.s:esc(branch)) - let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) - endif - if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && - \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) - call s:log4(name, 'Updating submodules. This may take a while.') - let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) - endif - let msg = s:format_message(v:shell_error ? 'x': '-', name, out) - if v:shell_error - call add(s:update.errors, name) - call s:regress_bar() - silent execute pos 'd _' - call append(4, msg) | 4 - elseif !empty(out) - call setline(pos, msg[0]) - endif - redraw - endfor - silent 4 d _ - try - call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) - catch - call s:warn('echom', v:exception) - call s:warn('echo', '') - return - endtry - call s:finish(s:update.pull) - call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') - call s:switch_out('normal! gg') - endif -endfunction - -function! s:job_abort() - if (!s:nvim && !s:vim8) || !exists('s:jobs') - return - endif - - for [name, j] in items(s:jobs) - if s:nvim - silent! call jobstop(j.jobid) - elseif s:vim8 - silent! call job_stop(j.jobid) - endif - if j.new - call s:rm_rf(g:plugs[name].dir) - endif - endfor - let s:jobs = {} -endfunction - -function! s:last_non_empty_line(lines) - let len = len(a:lines) - for idx in range(len) - let line = a:lines[len-idx-1] - if !empty(line) - return line - endif - endfor - return '' -endfunction - -function! s:job_out_cb(self, data) abort - let self = a:self - let data = remove(self.lines, -1) . a:data - let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') - call extend(self.lines, lines) - " To reduce the number of buffer updates - let self.tick = get(self, 'tick', -1) + 1 - if !self.running || self.tick % len(s:jobs) == 0 - let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') - let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) - call s:log(bullet, self.name, result) - endif -endfunction - -function! s:job_exit_cb(self, data) abort - let a:self.running = 0 - let a:self.error = a:data != 0 - call s:reap(a:self.name) - call s:tick() -endfunction - -function! s:job_cb(fn, job, ch, data) - if !s:plug_window_exists() " plug window closed - return s:job_abort() - endif - call call(a:fn, [a:job, a:data]) -endfunction - -function! s:nvim_cb(job_id, data, event) dict abort - return (a:event == 'stdout' || a:event == 'stderr') ? - \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : - \ s:job_cb('s:job_exit_cb', self, 0, a:data) -endfunction - -function! s:spawn(name, cmd, opts) - let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'new': get(a:opts, 'new', 0) } - let s:jobs[a:name] = job - - if s:nvim - if has_key(a:opts, 'dir') - let job.cwd = a:opts.dir - endif - let argv = a:cmd - call extend(job, { - \ 'on_stdout': function('s:nvim_cb'), - \ 'on_stderr': function('s:nvim_cb'), - \ 'on_exit': function('s:nvim_cb'), - \ }) - let jid = s:plug_call('jobstart', argv, job) - if jid > 0 - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = [jid < 0 ? argv[0].' is not executable' : - \ 'Invalid arguments (or job table is full)'] - endif - elseif s:vim8 - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) - if has_key(a:opts, 'dir') - let cmd = s:with_cd(cmd, a:opts.dir, 0) - endif - let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] - let jid = job_start(s:is_win ? join(argv, ' ') : argv, { - \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), - \ 'err_mode': 'raw', - \ 'out_mode': 'raw' - \}) - if job_status(jid) == 'run' - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = ['Failed to start job'] - endif - else - let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) - let job.error = v:shell_error != 0 - let job.running = 0 - endif -endfunction - -function! s:reap(name) - let job = s:jobs[a:name] - if job.error - call add(s:update.errors, a:name) - elseif get(job, 'new', 0) - let s:update.new[a:name] = 1 - endif - let s:update.bar .= job.error ? 'x' : '=' - - let bullet = job.error ? 'x' : '-' - let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) - call s:log(bullet, a:name, empty(result) ? 'OK' : result) - call s:bar() - - call remove(s:jobs, a:name) -endfunction - -function! s:bar() - if s:switch_in() - let total = len(s:update.all) - call setline(1, (s:update.pull ? 'Updating' : 'Installing'). - \ ' plugins ('.len(s:update.bar).'/'.total.')') - call s:progress_bar(2, s:update.bar, total) - call s:switch_out() - endif -endfunction - -function! s:logpos(name) - let max = line('$') - for i in range(4, max > 4 ? max : 4) - if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, max > 5 ? max : 5) - if getline(j) !~ '^ ' - return [i, j - 1] - endif - endfor - return [i, i] - endif - endfor - return [0, 0] -endfunction - -function! s:log(bullet, name, lines) - if s:switch_in() - let [b, e] = s:logpos(a:name) - if b > 0 - silent execute printf('%d,%d d _', b, e) - if b > winheight('.') - let b = 4 - endif - else - let b = 4 - endif - " FIXME For some reason, nomodifiable is set after :d in vim8 - setlocal modifiable - call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) - call s:switch_out() - endif -endfunction - -function! s:update_vim() - let s:jobs = {} - - call s:bar() - call s:tick() -endfunction - -function! s:tick() - let pull = s:update.pull - let prog = s:progress_opt(s:nvim || s:vim8) -while 1 " Without TCO, Vim stack is bound to explode - if empty(s:update.todo) - if empty(s:jobs) && !s:update.fin - call s:update_finish() - let s:update.fin = 1 - endif - return - endif - - let name = keys(s:update.todo)[0] - let spec = remove(s:update.todo, name) - let new = empty(globpath(spec.dir, '.git', 1)) - - call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') - redraw - - let has_tag = has_key(spec, 'tag') - if !new - let [error, _] = s:git_validate(spec, 0) - if empty(error) - if pull - let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] - if has_tag && !empty(globpath(spec.dir, '.git/shallow')) - call extend(cmd, ['--depth', '99999999']) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, cmd, { 'dir': spec.dir }) - else - let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } - endif - else - let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } - endif - else - let cmd = ['git', 'clone'] - if !has_tag - call extend(cmd, s:clone_opt) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) - endif - - if !s:jobs[name].running - call s:reap(name) - endif - if len(s:jobs) >= s:update.threads - break - endif -endwhile -endfunction - -function! s:update_python() -let py_exe = has('python') ? 'python' : 'python3' -execute py_exe "<< EOF" -import datetime -import functools -import os -try: - import queue -except ImportError: - import Queue as queue -import random -import re -import shutil -import signal -import subprocess -import tempfile -import threading as thr -import time -import traceback -import vim - -G_NVIM = vim.eval("has('nvim')") == '1' -G_PULL = vim.eval('s:update.pull') == '1' -G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 -G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) -G_PROGRESS = vim.eval('s:progress_opt(1)') -G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) -G_STOP = thr.Event() -G_IS_WIN = vim.eval('s:is_win') == '1' - -class PlugError(Exception): - def __init__(self, msg): - self.msg = msg -class CmdTimedOut(PlugError): - pass -class CmdFailed(PlugError): - pass -class InvalidURI(PlugError): - pass -class Action(object): - INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] - -class Buffer(object): - def __init__(self, lock, num_plugs, is_pull): - self.bar = '' - self.event = 'Updating' if is_pull else 'Installing' - self.lock = lock - self.maxy = int(vim.eval('winheight(".")')) - self.num_plugs = num_plugs - - def __where(self, name): - """ Find first line with name in current buffer. Return line num. """ - found, lnum = False, 0 - matcher = re.compile('^[-+x*] {0}:'.format(name)) - for line in vim.current.buffer: - if matcher.search(line) is not None: - found = True - break - lnum += 1 - - if not found: - lnum = -1 - return lnum - - def header(self): - curbuf = vim.current.buffer - curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) - - num_spaces = self.num_plugs - len(self.bar) - curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') - - with self.lock: - vim.command('normal! 2G') - vim.command('redraw') - - def write(self, action, name, lines): - first, rest = lines[0], lines[1:] - msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] - msg.extend([' ' + line for line in rest]) - - try: - if action == Action.ERROR: - self.bar += 'x' - vim.command("call add(s:update.errors, '{0}')".format(name)) - elif action == Action.DONE: - self.bar += '=' - - curbuf = vim.current.buffer - lnum = self.__where(name) - if lnum != -1: # Found matching line num - del curbuf[lnum] - if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): - lnum = 3 - else: - lnum = 3 - curbuf.append(msg, lnum) - - self.header() - except vim.error: - pass - -class Command(object): - CD = 'cd /d' if G_IS_WIN else 'cd' - - def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): - self.cmd = cmd - if cmd_dir: - self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) - self.timeout = timeout - self.callback = cb if cb else (lambda msg: None) - self.clean = clean if clean else (lambda: None) - self.proc = None - - @property - def alive(self): - """ Returns true only if command still running. """ - return self.proc and self.proc.poll() is None - - def execute(self, ntries=3): - """ Execute the command with ntries if CmdTimedOut. - Returns the output of the command if no Exception. - """ - attempt, finished, limit = 0, False, self.timeout - - while not finished: - try: - attempt += 1 - result = self.try_command() - finished = True - return result - except CmdTimedOut: - if attempt != ntries: - self.notify_retry() - self.timeout += limit - else: - raise - - def notify_retry(self): - """ Retry required for command, notify user. """ - for count in range(3, 0, -1): - if G_STOP.is_set(): - raise KeyboardInterrupt - msg = 'Timeout. Will retry in {0} second{1} ...'.format( - count, 's' if count != 1 else '') - self.callback([msg]) - time.sleep(1) - self.callback(['Retrying ...']) - - def try_command(self): - """ Execute a cmd & poll for callback. Returns list of output. - Raises CmdFailed -> return code for Popen isn't 0 - Raises CmdTimedOut -> command exceeded timeout without new output - """ - first_line = True - - try: - tfile = tempfile.NamedTemporaryFile(mode='w+b') - preexec_fn = not G_IS_WIN and os.setsid or None - self.proc = subprocess.Popen(self.cmd, stdout=tfile, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, shell=True, - preexec_fn=preexec_fn) - thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) - thrd.start() - - thread_not_started = True - while thread_not_started: - try: - thrd.join(0.1) - thread_not_started = False - except RuntimeError: - pass - - while self.alive: - if G_STOP.is_set(): - raise KeyboardInterrupt - - if first_line or random.random() < G_LOG_PROB: - first_line = False - line = '' if G_IS_WIN else nonblock_read(tfile.name) - if line: - self.callback([line]) - - time_diff = time.time() - os.path.getmtime(tfile.name) - if time_diff > self.timeout: - raise CmdTimedOut(['Timeout!']) - - thrd.join(0.5) - - tfile.seek(0) - result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] - - if self.proc.returncode != 0: - raise CmdFailed([''] + result) - - return result - except: - self.terminate() - raise - - def terminate(self): - """ Terminate process and cleanup. """ - if self.alive: - if G_IS_WIN: - os.kill(self.proc.pid, signal.SIGINT) - else: - os.killpg(self.proc.pid, signal.SIGTERM) - self.clean() - -class Plugin(object): - def __init__(self, name, args, buf_q, lock): - self.name = name - self.args = args - self.buf_q = buf_q - self.lock = lock - self.tag = args.get('tag', 0) - - def manage(self): - try: - if os.path.exists(self.args['dir']): - self.update() - else: - self.install() - with self.lock: - thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) - except PlugError as exc: - self.write(Action.ERROR, self.name, exc.msg) - except KeyboardInterrupt: - G_STOP.set() - self.write(Action.ERROR, self.name, ['Interrupted!']) - except: - # Any exception except those above print stack trace - msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) - self.write(Action.ERROR, self.name, msg.split('\n')) - raise - - def install(self): - target = self.args['dir'] - if target[-1] == '\\': - target = target[0:-1] - - def clean(target): - def _clean(): - try: - shutil.rmtree(target) - except OSError: - pass - return _clean - - self.write(Action.INSTALL, self.name, ['Installing ...']) - callback = functools.partial(self.write, Action.INSTALL, self.name) - cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( - '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], - esc(target)) - com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - - def repo_uri(self): - cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' - command = Command(cmd, self.args['dir'], G_TIMEOUT,) - result = command.execute(G_RETRIES) - return result[-1] - - def update(self): - actual_uri = self.repo_uri() - expect_uri = self.args['uri'] - regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') - ma = regex.match(actual_uri) - mb = regex.match(expect_uri) - if ma is None or mb is None or ma.groups() != mb.groups(): - msg = ['', - 'Invalid URI: {0}'.format(actual_uri), - 'Expected {0}'.format(expect_uri), - 'PlugClean required.'] - raise InvalidURI(msg) - - if G_PULL: - self.write(Action.UPDATE, self.name, ['Updating ...']) - callback = functools.partial(self.write, Action.UPDATE, self.name) - fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' - cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) - com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - else: - self.write(Action.DONE, self.name, ['Already installed']) - - def write(self, action, name, msg): - self.buf_q.put((action, name, msg)) - -class PlugThread(thr.Thread): - def __init__(self, tname, args): - super(PlugThread, self).__init__() - self.tname = tname - self.args = args - - def run(self): - thr.current_thread().name = self.tname - buf_q, work_q, lock = self.args - - try: - while not G_STOP.is_set(): - name, args = work_q.get_nowait() - plug = Plugin(name, args, buf_q, lock) - plug.manage() - work_q.task_done() - except queue.Empty: - pass - -class RefreshThread(thr.Thread): - def __init__(self, lock): - super(RefreshThread, self).__init__() - self.lock = lock - self.running = True - - def run(self): - while self.running: - with self.lock: - thread_vim_command('noautocmd normal! a') - time.sleep(0.33) - - def stop(self): - self.running = False - -if G_NVIM: - def thread_vim_command(cmd): - vim.session.threadsafe_call(lambda: vim.command(cmd)) -else: - def thread_vim_command(cmd): - vim.command(cmd) - -def esc(name): - return '"' + name.replace('"', '\"') + '"' - -def nonblock_read(fname): - """ Read a file with nonblock flag. Return the last line. """ - fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) - buf = os.read(fread, 100000).decode('utf-8', 'replace') - os.close(fread) - - line = buf.rstrip('\r\n') - left = max(line.rfind('\r'), line.rfind('\n')) - if left != -1: - left += 1 - line = line[left:] - - return line - -def main(): - thr.current_thread().name = 'main' - nthreads = int(vim.eval('s:update.threads')) - plugs = vim.eval('s:update.todo') - mac_gui = vim.eval('s:mac_gui') == '1' - - lock = thr.Lock() - buf = Buffer(lock, len(plugs), G_PULL) - buf_q, work_q = queue.Queue(), queue.Queue() - for work in plugs.items(): - work_q.put(work) - - start_cnt = thr.active_count() - for num in range(nthreads): - tname = 'PlugT-{0:02}'.format(num) - thread = PlugThread(tname, (buf_q, work_q, lock)) - thread.start() - if mac_gui: - rthread = RefreshThread(lock) - rthread.start() - - while not buf_q.empty() or thr.active_count() != start_cnt: - try: - action, name, msg = buf_q.get(True, 0.25) - buf.write(action, name, ['OK'] if not msg else msg) - buf_q.task_done() - except queue.Empty: - pass - except KeyboardInterrupt: - G_STOP.set() - - if mac_gui: - rthread.stop() - rthread.join() - -main() -EOF -endfunction - -function! s:update_ruby() - ruby << EOF - module PlugStream - SEP = ["\r", "\n", nil] - def get_line - buffer = '' - loop do - char = readchar rescue return - if SEP.include? char.chr - buffer << $/ - break - else - buffer << char - end - end - buffer - end - end unless defined?(PlugStream) - - def esc arg - %["#{arg.gsub('"', '\"')}"] - end - - def killall pid - pids = [pid] - if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } - else - unless `which pgrep 2> /dev/null`.empty? - children = pids - until children.empty? - children = children.map { |pid| - `pgrep -P #{pid}`.lines.map { |l| l.chomp } - }.flatten - pids += children - end - end - pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } - end - end - - def compare_git_uri a, b - regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} - regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) - end - - require 'thread' - require 'fileutils' - require 'timeout' - running = true - iswin = VIM::evaluate('s:is_win').to_i == 1 - pull = VIM::evaluate('s:update.pull').to_i == 1 - base = VIM::evaluate('g:plug_home') - all = VIM::evaluate('s:update.todo') - limit = VIM::evaluate('get(g:, "plug_timeout", 60)') - tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 - nthr = VIM::evaluate('s:update.threads').to_i - maxy = VIM::evaluate('winheight(".")').to_i - vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ - cd = iswin ? 'cd /d' : 'cd' - tot = VIM::evaluate('len(s:update.todo)') || 0 - bar = '' - skip = 'Already installed' - mtx = Mutex.new - take1 = proc { mtx.synchronize { running && all.shift } } - logh = proc { - cnt = bar.length - $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" - $curbuf[2] = '[' + bar.ljust(tot) + ']' - VIM::command('normal! 2G') - VIM::command('redraw') - } - where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } - log = proc { |name, result, type| - mtx.synchronize do - ing = ![true, false].include?(type) - bar += type ? '=' : 'x' unless ing - b = case type - when :install then '+' when :update then '*' - when true, nil then '-' else - VIM::command("call add(s:update.errors, '#{name}')") - 'x' - end - result = - if type || type.nil? - ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] - elsif result =~ /^Interrupted|^Timeout/ - ["#{b} #{name}: #{result}"] - else - ["#{b} #{name}"] + result.lines.map { |l| " " << l } - end - if lnum = where.call(name) - $curbuf.delete lnum - lnum = 4 if ing && lnum > maxy - end - result.each_with_index do |line, offset| - $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) - end - logh.call - end - } - bt = proc { |cmd, name, type, cleanup| - tried = timeout = 0 - begin - tried += 1 - timeout += limit - fd = nil - data = '' - if iswin - Timeout::timeout(timeout) do - tmp = VIM::evaluate('tempname()') - system("(#{cmd}) > #{tmp}") - data = File.read(tmp).chomp - File.unlink tmp rescue nil - end - else - fd = IO.popen(cmd).extend(PlugStream) - first_line = true - log_prob = 1.0 / nthr - while line = Timeout::timeout(timeout) { fd.get_line } - data << line - log.call name, line.chomp, type if name && (first_line || rand < log_prob) - first_line = false - end - fd.close - end - [$? == 0, data.chomp] - rescue Timeout::Error, Interrupt => e - if fd && !fd.closed? - killall fd.pid - fd.close - end - cleanup.call if cleanup - if e.is_a?(Timeout::Error) && tried < tries - 3.downto(1) do |countdown| - s = countdown > 1 ? 's' : '' - log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type - sleep 1 - end - log.call name, 'Retrying ...', type - retry - end - [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] - end - } - main = Thread.current - threads = [] - watcher = Thread.new { - if vim7 - while VIM::evaluate('getchar(1)') - sleep 0.1 - end - else - require 'io/console' # >= Ruby 1.9 - nil until IO.console.getch == 3.chr - end - mtx.synchronize do - running = false - threads.each { |t| t.raise Interrupt } unless vim7 - end - threads.each { |t| t.join rescue nil } - main.kill - } - refresh = Thread.new { - while true - mtx.synchronize do - break unless running - VIM::command('noautocmd normal! a') - end - sleep 0.2 - end - } if VIM::evaluate('s:mac_gui') == 1 - - clone_opt = VIM::evaluate('s:clone_opt').join(' ') - progress = VIM::evaluate('s:progress_opt(1)') - nthr.times do - mtx.synchronize do - threads << Thread.new { - while pair = take1.call - name = pair.first - dir, uri, tag = pair.last.values_at *%w[dir uri tag] - exists = File.directory? dir - ok, result = - if exists - chdir = "#{cd} #{iswin ? dir : esc(dir)}" - ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil - current_uri = data.lines.to_a.last - if !ret - if data =~ /^Interrupted|^Timeout/ - [false, data] - else - [false, [data.chomp, "PlugClean required."].join($/)] - end - elsif !compare_git_uri(current_uri, uri) - [false, ["Invalid URI: #{current_uri}", - "Expected: #{uri}", - "PlugClean required."].join($/)] - else - if pull - log.call name, 'Updating ...', :update - fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' - bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil - else - [true, skip] - end - end - else - d = esc dir.sub(%r{[\\/]+$}, '') - log.call name, 'Installing ...', :install - bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { - FileUtils.rm_rf dir - } - end - mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok - log.call name, result, ok - end - } if running - end - end - threads.each { |t| t.join rescue nil } - logh.call - refresh.kill if refresh - watcher.kill -EOF -endfunction - -function! s:shellesc_cmd(arg, script) - let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') - return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') -endfunction - -function! s:shellesc_ps1(arg) - return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" -endfunction - -function! s:shellesc_sh(arg) - return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" -endfunction - -" Escape the shell argument based on the shell. -" Vim and Neovim's shellescape() are insufficient. -" 1. shellslash determines whether to use single/double quotes. -" Double-quote escaping is fragile for cmd.exe. -" 2. It does not work for powershell. -" 3. It does not work for *sh shells if the command is executed -" via cmd.exe (ie. cmd.exe /c sh -c command command_args) -" 4. It does not support batchfile syntax. -" -" Accepts an optional dictionary with the following keys: -" - shell: same as Vim/Neovim 'shell' option. -" If unset, fallback to 'cmd.exe' on Windows or 'sh'. -" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. -function! plug#shellescape(arg, ...) - if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' - return a:arg - endif - let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} - let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') - let script = get(opts, 'script', 1) - if shell =~# 'cmd\(\.exe\)\?$' - return s:shellesc_cmd(a:arg, script) - elseif s:is_powershell(shell) - return s:shellesc_ps1(a:arg) - endif - return s:shellesc_sh(a:arg) -endfunction - -function! s:glob_dir(path) - return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') -endfunction - -function! s:progress_bar(line, bar, total) - call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') -endfunction - -function! s:compare_git_uri(a, b) - " See `git help clone' - " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] - " [git@] github.com[:port] : junegunn/vim-plug [.git] - " file:// / junegunn/vim-plug [/] - " / junegunn/vim-plug [/] - let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' - let ma = matchlist(a:a, pat) - let mb = matchlist(a:b, pat) - return ma[1:2] ==# mb[1:2] -endfunction - -function! s:format_message(bullet, name, message) - if a:bullet != 'x' - return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] - else - let lines = map(s:lines(a:message), '" ".v:val') - return extend([printf('x %s:', a:name)], lines) - endif -endfunction - -function! s:with_cd(cmd, dir, ...) - let script = a:0 > 0 ? a:1 : 1 - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) -endfunction - -function! s:system(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - if type(a:cmd) == s:TYPE.list - " Neovim's system() supports list argument to bypass the shell - " but it cannot set the working directory for the command. - " Assume that the command does not rely on the shell. - if has('nvim') && a:0 == 0 - return system(a:cmd) - endif - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - else - let cmd = a:cmd - endif - if a:0 > 0 - let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) - endif - if s:is_win && type(a:cmd) != s:TYPE.list - let [batchfile, cmd] = s:batchfile(cmd) - endif - return system(cmd) - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry -endfunction - -function! s:system_chomp(...) - let ret = call('s:system', a:000) - return v:shell_error ? '' : substitute(ret, '\n$', '', '') -endfunction - -function! s:git_validate(spec, check_branch) - let err = '' - if isdirectory(a:spec.dir) - let result = [s:git_local_branch(a:spec.dir), s:git_origin_url(a:spec.dir)] - let remote = result[-1] - if empty(remote) - let err = join([remote, 'PlugClean required.'], "\n") - elseif !s:compare_git_uri(remote, a:spec.uri) - let err = join(['Invalid URI: '.remote, - \ 'Expected: '.a:spec.uri, - \ 'PlugClean required.'], "\n") - elseif a:check_branch && has_key(a:spec, 'commit') - let sha = s:git_revision(a:spec.dir) - if empty(sha) - let err = join(add(result, 'PlugClean required.'), "\n") - elseif !s:hash_match(sha, a:spec.commit) - let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', - \ a:spec.commit[:6], sha[:6]), - \ 'PlugUpdate required.'], "\n") - endif - elseif a:check_branch - let current_branch = result[0] - " Check tag - let origin_branch = s:git_origin_branch(a:spec) - if has_key(a:spec, 'tag') - let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) - if a:spec.tag !=# tag && a:spec.tag !~ '\*' - let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', - \ (empty(tag) ? 'N/A' : tag), a:spec.tag) - endif - " Check branch - elseif origin_branch !=# current_branch - let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', - \ current_branch, origin_branch) - endif - if empty(err) - let [ahead, behind] = split(s:lastline(s:system([ - \ 'git', 'rev-list', '--count', '--left-right', - \ printf('HEAD...origin/%s', origin_branch) - \ ], a:spec.dir)), '\t') - if !v:shell_error && ahead - if behind - " Only mention PlugClean if diverged, otherwise it's likely to be - " pushable (and probably not that messed up). - let err = printf( - \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" - \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', origin_branch, ahead, behind) - else - let err = printf("Ahead of origin/%s by %d commit(s).\n" - \ .'Cannot update until local changes are pushed.', - \ origin_branch, ahead) - endif - endif - endif - endif - else - let err = 'Not found' - endif - return [err, err =~# 'PlugClean'] -endfunction - -function! s:rm_rf(dir) - if isdirectory(a:dir) - return s:system(s:is_win - \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) - \ : ['rm', '-rf', a:dir]) - endif -endfunction - -function! s:clean(force) - call s:prepare() - call append(0, 'Searching for invalid plugins in '.g:plug_home) - call append(1, '') - - " List of valid directories - let dirs = [] - let errs = {} - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - if !s:is_managed(name) - call add(dirs, spec.dir) - else - let [err, clean] = s:git_validate(spec, 1) - if clean - let errs[spec.dir] = s:lines(err)[0] - else - call add(dirs, spec.dir) - endif - endif - let cnt += 1 - call s:progress_bar(2, repeat('=', cnt), total) - normal! 2G - redraw - endfor - - let allowed = {} - for dir in dirs - let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 - let allowed[dir] = 1 - for child in s:glob_dir(dir) - let allowed[child] = 1 - endfor - endfor - - let todo = [] - let found = sort(s:glob_dir(g:plug_home)) - while !empty(found) - let f = remove(found, 0) - if !has_key(allowed, f) && isdirectory(f) - call add(todo, f) - call append(line('$'), '- ' . f) - if has_key(errs, f) - call append(line('$'), ' ' . errs[f]) - endif - let found = filter(found, 'stridx(v:val, f) != 0') - end - endwhile - - 4 - redraw - if empty(todo) - call append(line('$'), 'Already clean.') - else - let s:clean_count = 0 - call append(3, ['Directories to delete:', '']) - redraw! - if a:force || s:ask_no_interrupt('Delete all directories?') - call s:delete([6, line('$')], 1) - else - call setline(4, 'Cancelled.') - nnoremap d :set opfunc=delete_opg@ - nmap dd d_ - xnoremap d :call delete_op(visualmode(), 1) - echo 'Delete the lines (d{motion}) to delete the corresponding directories' - endif - endif - 4 - setlocal nomodifiable -endfunction - -function! s:delete_op(type, ...) - call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) -endfunction - -function! s:delete(range, force) - let [l1, l2] = a:range - let force = a:force - let err_count = 0 - while l1 <= l2 - let line = getline(l1) - if line =~ '^- ' && isdirectory(line[2:]) - execute l1 - redraw! - let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) - let force = force || answer > 1 - if answer - let err = s:rm_rf(line[2:]) - setlocal modifiable - if empty(err) - call setline(l1, '~'.line[1:]) - let s:clean_count += 1 - else - delete _ - call append(l1 - 1, s:format_message('x', line[1:], err)) - let l2 += len(s:lines(err)) - let err_count += 1 - endif - let msg = printf('Removed %d directories.', s:clean_count) - if err_count > 0 - let msg .= printf(' Failed to remove %d directories.', err_count) - endif - call setline(4, msg) - setlocal nomodifiable - endif - endif - let l1 += 1 - endwhile -endfunction - -function! s:upgrade() - echo 'Downloading the latest version of vim-plug' - redraw - let tmp = s:plug_tempname() - let new = tmp . '/plug.vim' - - try - let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) - if v:shell_error - return s:err('Error upgrading vim-plug: '. out) - endif - - if readfile(s:me) ==# readfile(new) - echo 'vim-plug is already up-to-date' - return 0 - else - call rename(s:me, s:me . '.old') - call rename(new, s:me) - unlet g:loaded_plug - echo 'vim-plug has been upgraded' - return 1 - endif - finally - silent! call s:rm_rf(tmp) - endtry -endfunction - -function! s:upgrade_specs() - for spec in values(g:plugs) - let spec.frozen = get(spec, 'frozen', 0) - endfor -endfunction - -function! s:status() - call s:prepare() - call append(0, 'Checking plugins') - call append(1, '') - - let ecnt = 0 - let unloaded = 0 - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - let is_dir = isdirectory(spec.dir) - if has_key(spec, 'uri') - if is_dir - let [err, _] = s:git_validate(spec, 1) - let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] - else - let [valid, msg] = [0, 'Not found. Try PlugInstall.'] - endif - else - if is_dir - let [valid, msg] = [1, 'OK'] - else - let [valid, msg] = [0, 'Not found.'] - endif - endif - let cnt += 1 - let ecnt += !valid - " `s:loaded` entry can be missing if PlugUpgraded - if is_dir && get(s:loaded, name, -1) == 0 - let unloaded = 1 - let msg .= ' (not loaded)' - endif - call s:progress_bar(2, repeat('=', cnt), total) - call append(3, s:format_message(valid ? '-' : 'x', name, msg)) - normal! 2G - redraw - endfor - call setline(1, 'Finished. '.ecnt.' error(s).') - normal! gg - setlocal nomodifiable - if unloaded - echo "Press 'L' on each line to load plugin, or 'U' to update" - nnoremap L :call status_load(line('.')) - xnoremap L :call status_load(line('.')) - end -endfunction - -function! s:extract_name(str, prefix, suffix) - return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') -endfunction - -function! s:status_load(lnum) - let line = getline(a:lnum) - let name = s:extract_name(line, '-', '(not loaded)') - if !empty(name) - call plug#load(name) - setlocal modifiable - call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) - setlocal nomodifiable - endif -endfunction - -function! s:status_update() range - let lines = getline(a:firstline, a:lastline) - let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') - if !empty(names) - echo - execute 'PlugUpdate' join(names) - endif -endfunction - -function! s:is_preview_window_open() - silent! wincmd P - if &previewwindow - wincmd p - return 1 - endif -endfunction - -function! s:find_name(lnum) - for lnum in reverse(range(1, a:lnum)) - let line = getline(lnum) - if empty(line) - return '' - endif - let name = s:extract_name(line, '-', '') - if !empty(name) - return name - endif - endfor - return '' -endfunction - -function! s:preview_commit() - if b:plug_preview < 0 - let b:plug_preview = !s:is_preview_window_open() - endif - - let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') - if empty(sha) - let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$') - if empty(name) - return - endif - let title = 'HEAD@{1}..' - let command = 'git diff --no-color HEAD@{1}' - else - let title = sha - let command = 'git show --no-color --pretty=medium '.sha - let name = s:find_name(line('.')) - endif - - if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) - return - endif - - if exists('g:plug_pwindow') && !s:is_preview_window_open() - execute g:plug_pwindow - execute 'e' title - else - execute 'pedit' title - wincmd P - endif - setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - execute 'silent %!' cmd - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - setlocal nomodifiable - nnoremap q :q - wincmd p -endfunction - -function! s:section(flags) - call search('\(^[x-] \)\@<=[^:]\+:', a:flags) -endfunction - -function! s:format_git_log(line) - let indent = ' ' - let tokens = split(a:line, nr2char(1)) - if len(tokens) != 5 - return indent.substitute(a:line, '\s*$', '', '') - endif - let [graph, sha, refs, subject, date] = tokens - let tag = matchstr(refs, 'tag: [^,)]\+') - let tag = empty(tag) ? ' ' : ' ('.tag.') ' - return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) -endfunction - -function! s:append_ul(lnum, text) - call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) -endfunction - -function! s:diff() - call s:prepare() - call append(0, ['Collecting changes ...', '']) - let cnts = [0, 0] - let bar = '' - let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') - call s:progress_bar(2, bar, len(total)) - for origin in [1, 0] - let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) - if empty(plugs) - continue - endif - call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') - for [k, v] in plugs - let branch = s:git_origin_branch(v) - if len(branch) - let range = origin ? '..origin/'.branch : 'HEAD@{1}..' - let cmd = ['git', 'log', '--graph', '--color=never'] - if s:git_version_requirement(2, 10, 0) - call add(cmd, '--no-show-signature') - endif - call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) - if has_key(v, 'rtp') - call extend(cmd, ['--', v.rtp]) - endif - let diff = s:system_chomp(cmd, v.dir) - if !empty(diff) - let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' - call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) - let cnts[origin] += 1 - endif - endif - let bar .= '=' - call s:progress_bar(2, bar, len(total)) - normal! 2G - redraw - endfor - if !cnts[origin] - call append(5, ['', 'N/A']) - endif - endfor - call setline(1, printf('%d plugin(s) updated.', cnts[0]) - \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) - - if cnts[0] || cnts[1] - nnoremap (plug-preview) :silent! call preview_commit() - if empty(maparg("\", 'n')) - nmap (plug-preview) - endif - if empty(maparg('o', 'n')) - nmap o (plug-preview) - endif - endif - if cnts[0] - nnoremap X :call revert() - echo "Press 'X' on each block to revert the update" - endif - normal! gg - setlocal nomodifiable -endfunction - -function! s:revert() - if search('^Pending updates', 'bnW') - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || - \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' - return - endif - - call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) - setlocal modifiable - normal! "_dap - setlocal nomodifiable - echo 'Reverted' -endfunction - -function! s:snapshot(force, ...) abort - call s:prepare() - setf vim - call append(0, ['" Generated by vim-plug', - \ '" '.strftime("%c"), - \ '" :source this file in vim to restore the snapshot', - \ '" or execute: vim -S snapshot.vim', - \ '', '', 'PlugUpdate!']) - 1 - let anchor = line('$') - 3 - let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && isdirectory(v:val.dir)'))) - for name in reverse(names) - let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir) - if !empty(sha) - call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) - redraw - endif - endfor - - if a:0 > 0 - let fn = s:plug_expand(a:1) - if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) - return - endif - call writefile(getline(1, '$'), fn) - echo 'Saved as '.a:1 - silent execute 'e' s:esc(fn) - setf vim - endif -endfunction - -function! s:split_rtp() - return split(&rtp, '\\\@ Date: Tue, 20 Jun 2023 11:50:02 +0200 Subject: [PATCH 17/81] remove double initialization of copilot --- lua/plugins/cmp.lua | 133 ++++++++++++++++++++++++------------------- lua/plugins/init.lua | 4 -- plugin/copilot.lua | 8 --- 3 files changed, 75 insertions(+), 70 deletions(-) delete mode 100644 plugin/copilot.lua diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 5de5c8d..f72c46a 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,65 +1,82 @@ return { - "hrsh7th/nvim-cmp", - -- load cmp on InsertEnter - event = "InsertEnter", - -- these dependencies will only be loaded when cmp loads - -- dependencies are always lazy-loaded unless specified otherwise - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-vsnip', - 'hrsh7th/vim-vsnip', - 'hrsh7th/vim-vsnip-integ', - 'onsails/lspkind.nvim', - }, - config = function() - local cmp = require('cmp') - local lspkind = require('lspkind') + { + "hrsh7th/nvim-cmp", + -- load cmp on InsertEnter + event = "InsertEnter", + -- these dependencies will only be loaded when cmp loads + -- dependencies are always lazy-loaded unless specified otherwise + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/vim-vsnip', + 'hrsh7th/vim-vsnip-integ', + 'onsails/lspkind.nvim', + }, + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') - cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = { - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [''] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() + cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = { + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end end - end - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, - { name = "copilot"}, - },{ + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + { name = "copilot" }, + }, { { name = 'buffer' }, --{ name = 'path' }, }), - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', -- show only symbol annotations - maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - symbol_map = { Copilot = "" }, - }) - }, - }) - end, + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + symbol_map = { Copilot = "" }, + }) + }, + }) + end, + }, + { + 'zbirenbaum/copilot-cmp', + dependencies = { "hrsh7th/nvim-cmp", + { + 'zbirenbaum/copilot.lua', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { + mail = false, + } + } + } + }, + }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index efd9714..1af8e03 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -35,10 +35,6 @@ return { 'folke/lsp-colors.nvim', 'nvim-lua/popup.nvim', - 'zbirenbaum/copilot.lua', - {'zbirenbaum/copilot-cmp', - dependencies = { "hrsh7th/nvim-cmp" }, - }, 'junegunn/vim-easy-align', 'machakann/vim-highlightedyank', 'vim-airline/vim-airline', diff --git a/plugin/copilot.lua b/plugin/copilot.lua deleted file mode 100644 index c644093..0000000 --- a/plugin/copilot.lua +++ /dev/null @@ -1,8 +0,0 @@ -require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - filetypes = { - mail = false, - } -}) -require("copilot_cmp").setup() From d34b91cfd854092469d3a1ff6658879a5239853d Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 22 Jun 2023 14:12:12 +0200 Subject: [PATCH 18/81] Fix copilot setup --- lua/plugins/cmp.lua | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index f72c46a..d99e213 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -16,6 +16,24 @@ return { 'hrsh7th/vim-vsnip', 'hrsh7th/vim-vsnip-integ', 'onsails/lspkind.nvim', + { + 'zbirenbaum/copilot-cmp', + dependencies = { "hrsh7th/nvim-cmp", + { + 'zbirenbaum/copilot.lua', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { + mail = false, + } + } + } + }, + config = function () + require("copilot_cmp").setup() + end + }, }, config = function() local cmp = require('cmp') @@ -33,7 +51,7 @@ return { [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }), @@ -64,19 +82,4 @@ return { }) end, }, - { - 'zbirenbaum/copilot-cmp', - dependencies = { "hrsh7th/nvim-cmp", - { - 'zbirenbaum/copilot.lua', - opts = { - suggestion = { enabled = false }, - panel = { enabled = false }, - filetypes = { - mail = false, - } - } - } - }, - }, } From 387db52c767e201f2e4ac0ec9fcdefe4bbb6a458 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 22 Jun 2023 16:28:46 +0200 Subject: [PATCH 19/81] Disable copilot on text files --- lua/plugins/cmp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index d99e213..cefab5e 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -26,6 +26,7 @@ return { panel = { enabled = false }, filetypes = { mail = false, + text = false, } } } From 7cdac89502d87623ed5a5f700c3e7fbb8d65deaf Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 27 Jun 2023 11:52:49 +0200 Subject: [PATCH 20/81] Clean up --- after/ftplugin/bib.vim | 1 - after/ftplugin/c.vim | 4 -- after/ftplugin/java.lua | 22 +++++++++++ after/ftplugin/java.vim | 47 ---------------------- after/ftplugin/ruby.vim | 6 --- after/ftplugin/tex.vim | 8 ---- after/plugin/airline.vim | 18 --------- after/plugin/autoformat.vim | 2 - after/plugin/c.vim | 2 - after/plugin/centerscroll.vim | 33 ++++++++-------- after/plugin/coc.vim | 20 ---------- after/plugin/compe.vim | 7 ---- after/plugin/deepl.vim | 10 ----- after/plugin/general.vim | 19 --------- after/plugin/nvim-metals.vim | 2 - after/plugin/syntastic.vim | 7 ---- after/plugin/tabline.vim | 45 --------------------- after/plugin/vimtex.vim | 4 -- lua/plugins/init.lua | 10 +++-- lua/plugins/lspconfig.lua | 13 ++++-- lua/plugins/tabline.lua | 74 +++++++++++++++++++++++++++++++++++ lua/plugins/treesitter.lua | 19 ++++++++- 22 files changed, 147 insertions(+), 226 deletions(-) delete mode 100644 after/ftplugin/bib.vim delete mode 100644 after/ftplugin/c.vim create mode 100644 after/ftplugin/java.lua delete mode 100644 after/ftplugin/java.vim delete mode 100644 after/plugin/airline.vim delete mode 100644 after/plugin/autoformat.vim delete mode 100644 after/plugin/coc.vim delete mode 100644 after/plugin/compe.vim delete mode 100644 after/plugin/deepl.vim delete mode 100644 after/plugin/general.vim delete mode 100644 after/plugin/nvim-metals.vim delete mode 100644 after/plugin/syntastic.vim delete mode 100644 after/plugin/tabline.vim delete mode 100644 after/plugin/vimtex.vim create mode 100644 lua/plugins/tabline.lua diff --git a/after/ftplugin/bib.vim b/after/ftplugin/bib.vim deleted file mode 100644 index a4f9c7a..0000000 --- a/after/ftplugin/bib.vim +++ /dev/null @@ -1 +0,0 @@ -map f :%!bibformat diff --git a/after/ftplugin/c.vim b/after/ftplugin/c.vim deleted file mode 100644 index 6dd71c1..0000000 --- a/after/ftplugin/c.vim +++ /dev/null @@ -1,4 +0,0 @@ -let c_space_errors = 1 -let c_space_errors = 1 -let c_no_comment_fold = 1 -let g:syntastic_c_checkers=['make'] diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua new file mode 100644 index 0000000..f039aac --- /dev/null +++ b/after/ftplugin/java.lua @@ -0,0 +1,22 @@ +vim.api.nvim_buf_set_option(0, 'textwidth', 120) +vim.cmd.iabbrev('syso', 'System.out.println') + +local bmap = vim.keymap.set +local map_opt = { silent = true, buffer = true } + +bmap('n', 'ev', function() require('jdtls').extract_variable() end, + { silent = true, buffer = true, desc = 'Extract variable'}) +bmap('v', 'ev', function() require('jdtls').extract_variable(true) end, + { silent = true, buffer = true, desc = 'Extract variable'}) +bmap('n', 'ec', function() require('jdtls').extract_constant() end, + { silent = true, buffer = true, desc = 'Extract constant'}) +bmap('v', 'ec', function() require('jdtls').extract_constant(true) end, + { silent = true, buffer = true, desc = 'Extract constant'}) +bmap('v', 'em', function() require('jdtls').extract_method(true) end, + { silent = true, buffer = true, desc = 'Extract method'}) +bmap('n', 'ro', function() require('jdtls').organize_imports() end, + { silent = true, buffer = true, desc = 'Organize imports'}) +bmap('n', 'tc', function() require 'jdtls'.test_class() end, + { silent = true, buffer = true, desc = 'Test class'}) +bmap('n', 'tm', function() require 'jdtls'.test_nearest_method() end, + { silent = true, buffer = true, desc = 'Test nearest method'}) diff --git a/after/ftplugin/java.vim b/after/ftplugin/java.vim deleted file mode 100644 index fd1c415..0000000 --- a/after/ftplugin/java.vim +++ /dev/null @@ -1,47 +0,0 @@ -iab syso System.out.println - -setlocal foldmethod=syntax -setlocal foldenable -setlocal textwidth=120 - -nnoremap jd :JavaDocComment -nnoremap :JavaDocPreview -nnoremap :JavaSearchContext -nnoremap ev lua require('jdtls').extract_variable() -vnoremap ev lua require('jdtls').extract_variable(true) -nnoremap ec lua require('jdtls').extract_constant() -vnoremap ec lua require('jdtls').extract_constant(true) -vnoremap em lua require('jdtls').extract_method(true) -nnoremap ro lua require('jdtls').organize_imports() - -nnoremap tc lua require'jdtls'.test_class() -nnoremap tm lua require'jdtls'.test_nearest_method() - -inoremap pumvisible() \|\| &omnifunc == '' ? -\ "\C-n>" : -\ "\C-x>\C-o>=pumvisible() ?" . -\ "\"\\c-n>\\c-p>\\c-n>\" :" . -\ "\" \\bs>\\C-n>\"\" -imap map - -function! InsertJavaPackage() - let filename = expand("%") - let filename = substitute(filename, "\.java$", "", "") - let dir = getcwd() . "/" . filename - let dir = substitute(dir, "^.*\/src\/", "", "") - let dir = substitute(dir, "\/[^\/]*$", "", "") - let dir = substitute(dir, "\/", ".", "g") - let filename = substitute(filename, "^.*\/", "", "") - let dir = "package " . dir . ";" - let result = append(0, dir) - let result = append(1, "") - let result = append(2, "class " . filename . " {") - let result = append(4, "}") -endfunction - -"java {{{ -"if filereadable(bufname("%")) == 0 -" call InsertJavaPackage() -"endif - -"}}} diff --git a/after/ftplugin/ruby.vim b/after/ftplugin/ruby.vim index 9be0081..8c3ca50 100644 --- a/after/ftplugin/ruby.vim +++ b/after/ftplugin/ruby.vim @@ -1,10 +1,4 @@ setl sts=2 setl sw=2 setl expandtab -setl omnifunc=rubycomplete#Complete -let g:rubycomplete_buffer_loading = 1 -let g:rubycomplete_classes_in_global = 1 - -nmap K :!ri - hi link rubySymbol Special diff --git a/after/ftplugin/tex.vim b/after/ftplugin/tex.vim index e04fe7f..88c0487 100644 --- a/after/ftplugin/tex.vim +++ b/after/ftplugin/tex.vim @@ -1,11 +1,3 @@ -if exists("&cole") - " conceal" Use conceal vim 7.3 feature: - set cole=0 " conceal level - " Conceal in tex file: "admgs", a=accents, d=delimiters, m=math symbols, - " g=Greek, s=superscripts/subscripts: - let g:tex_conceal="agm" -endif - imap [[ \begin{ imap ]] (vimtex-delim-close) imap [( \left( diff --git a/after/plugin/airline.vim b/after/plugin/airline.vim deleted file mode 100644 index dc78b32..0000000 --- a/after/plugin/airline.vim +++ /dev/null @@ -1,18 +0,0 @@ -let g:airline_powerline_fonts = 1 -let g:airline_left_sep = '' -let g:airline_left_alt_sep = '' -let g:airline_right_sep = '' -let g:airline_right_alt_sep = '' -let g:airline_symbols.branch = '' -let g:airline_symbols.readonly = '' -let g:airline_symbols.linenr = '' -let g:airline_section_z = 'L:%l/%L C:%v' - -function! LspStatus() abort - let status = luaeval('require("lsp-status").status()') - return trim(status) -endfunction -call airline#parts#define_function('lsp_status', 'LspStatus') -call airline#parts#define_condition('lsp_status', 'luaeval("#vim.lsp.buf_get_clients() > 0")') -let g:airline#extensions#nvimlsp#enabled = 0 -let g:airline_section_warning = airline#section#create_right(['lsp_status']) diff --git a/after/plugin/autoformat.vim b/after/plugin/autoformat.vim deleted file mode 100644 index b7ec72d..0000000 --- a/after/plugin/autoformat.vim +++ /dev/null @@ -1,2 +0,0 @@ -let g:formatdef_scalafmt = '"scalafmt --stdin 2>/dev/null"' -let g:formatters_scala = ['scalafmt'] diff --git a/after/plugin/c.vim b/after/plugin/c.vim index 09e6281..8a96d9f 100644 --- a/after/plugin/c.vim +++ b/after/plugin/c.vim @@ -1,4 +1,3 @@ - "{{{ c header gates function! s:insert_gates() let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g") @@ -8,5 +7,4 @@ function! s:insert_gates() normal! kk endfunction autocmd BufNewFile *.{h,hpp} call insert_gates() - "}}} diff --git a/after/plugin/centerscroll.vim b/after/plugin/centerscroll.vim index 24c9f0e..64db6f6 100644 --- a/after/plugin/centerscroll.vim +++ b/after/plugin/centerscroll.vim @@ -1,17 +1,18 @@ -set scrolloff=99999 -set lazyredraw +" from https://vi.stackexchange.com/a/26055 +augroup KeepCentered + autocmd! + autocmd CursorMoved * normal! zz + autocmd TextChangedI * call InsertRecenter() +augroup END -nnoremap 11kzz -nnoremap 11jzz -nnoremap j gjzz -nnoremap k gkzz -nnoremap # #zz -nnoremap * *zz -nnoremap n nzz -nnoremap N Nzz -nnoremap gg ggzz -nnoremap G Gzz -nnoremap gj jzz -nnoremap gk kzz -vnoremap < >gv +function InsertRecenter() abort + let at_end = getcursorcharpos()[2] > len(getline('.')) + normal! zz + + " Fix position of cursor at end of line + if at_end + let cursor_pos = getcursorcharpos() + let cursor_pos[2] = cursor_pos[2] + 1 + call setcursorcharpos(cursor_pos[1:]) + endif +endfunction diff --git a/after/plugin/coc.vim b/after/plugin/coc.vim deleted file mode 100644 index ca3afb4..0000000 --- a/after/plugin/coc.vim +++ /dev/null @@ -1,20 +0,0 @@ -if exists(":CocAction") - set signcolumn=yes - map gd (coc-definition) - - map call CocAction("doHover") - map t (coc-type-definition) - map u (coc-references) - map r (coc-rename) - map q (coc-quickfix) - - map F (coc-format) - map f (coc-format-selected) - vmap f (coc-format-selected) - - map (coc-codeaction) - vmap (coc-codeaction-selected) - - omap af (coc-funcobj-a) - omap if (coc-funcobj-i) -endif diff --git a/after/plugin/compe.vim b/after/plugin/compe.vim deleted file mode 100644 index a4ea8a8..0000000 --- a/after/plugin/compe.vim +++ /dev/null @@ -1,7 +0,0 @@ -if exists('g:loaded_compe') - inoremap compe#complete() - inoremap compe#confirm('') - inoremap compe#close('') - inoremap compe#scroll({ 'delta': +4 }) - inoremap compe#scroll({ 'delta': -4 }) -endif diff --git a/after/plugin/deepl.vim b/after/plugin/deepl.vim deleted file mode 100644 index a1add28..0000000 --- a/after/plugin/deepl.vim +++ /dev/null @@ -1,10 +0,0 @@ -let g:deepl#endpoint = "https://api-free.deepl.com/v2/translate" -function TranslateSelection(lang) - if !exists('g:deepl#auth_key') - let g:deepl#auth_key = pass#get('web/deepl.com', 'apikey') - endif - call deepl#v(a:lang) -endfun - -vmap call TranslateSelection("EN") -vmap call TranslateSelection("DE") diff --git a/after/plugin/general.vim b/after/plugin/general.vim deleted file mode 100644 index b816a66..0000000 --- a/after/plugin/general.vim +++ /dev/null @@ -1,19 +0,0 @@ -let g:deoplete#enable_at_startup = 1 -if !exists('g:deoplete#omni#input_patterns') - let g:deoplete#omni#input_patterns = {} -endif - -" , : close popup and delete backword char. -"inoremap deoplete#smart_close_popup()."\" -"inoremap deoplete#smart_close_popup()."\" - -"inoremap -" \ pumvisible() ? "\" : -" \ check_back_space() ? "\" : -" \ '\' - -function! s:check_back_space() - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' -endfunction -"inoremap diff --git a/after/plugin/nvim-metals.vim b/after/plugin/nvim-metals.vim deleted file mode 100644 index b29809e..0000000 --- a/after/plugin/nvim-metals.vim +++ /dev/null @@ -1,2 +0,0 @@ -":let g:metals_server_version = '0.10.6-M1+29-22f5a4b1-SNAPSHOT' -"let g:metals_server_version = '0.10.6-M1' diff --git a/after/plugin/syntastic.vim b/after/plugin/syntastic.vim deleted file mode 100644 index 84e9de0..0000000 --- a/after/plugin/syntastic.vim +++ /dev/null @@ -1,7 +0,0 @@ - -hi SyntasticErrorLine ctermbg=52 ctermfg=fg cterm=NONE -hi SyntasticWarningLine ctermbg=234 ctermfg=fg cterm=NONE - -let g:syntastic_tex_chktex_showmsg = 0 -let g:syntastic_tex_chktex_args = '-n 1 -n 11' -let g:syntastic_tex_checkers = ['chktex'] diff --git a/after/plugin/tabline.vim b/after/plugin/tabline.vim deleted file mode 100644 index f3aa0b3..0000000 --- a/after/plugin/tabline.vim +++ /dev/null @@ -1,45 +0,0 @@ -function MyTabLine() - let s = '' - let t = tabpagenr() - let i = 1 - while i <= tabpagenr('$') - let buflist = tabpagebuflist(i) - let winnr = tabpagewinnr(i) - let s .= '%' . i . 'T' - let s .= (i == t ? '%2*' : '%1*') - let s .= ' ' - let s .= i . ':' - let s .= winnr . '/' . tabpagewinnr(i,'$') - - let bufnrlist = tabpagebuflist(i) - for bufnr in bufnrlist - if getbufvar(bufnr, "&modified") - let s .= '+' - break - endif - endfor - - let s .= ' %*' - let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#') - let bufnr = buflist[winnr - 1] - let file = bufname(bufnr) - let buftype = getbufvar(bufnr, 'buftype') - if buftype == 'nofile' - if file =~ '\/.' - let file = substitute(file, '.*\/\ze.', '', '') - endif - else - let file = fnamemodify(file, ':p:t') - endif - if file == '' - let file = '[No Name]' - endif - let s .= file - let i = i + 1 - endwhile - let s .= '%T%#TabLineFill#%=' - let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X') - return s -endfunction -set stal=2 -set tabline=%!MyTabLine() diff --git a/after/plugin/vimtex.vim b/after/plugin/vimtex.vim deleted file mode 100644 index d813c7a..0000000 --- a/after/plugin/vimtex.vim +++ /dev/null @@ -1,4 +0,0 @@ -let g:vimtex_quickfix_ignorefilters = [ - \ 'overfull', - \ 'underfull', - \] diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 1af8e03..f325736 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -29,7 +29,6 @@ return { require('lsp_signature').setup({}) end }, - 'nvim-lua/lsp-status.nvim', 'kyazdani42/nvim-web-devicons', 'folke/trouble.nvim', 'folke/lsp-colors.nvim', @@ -37,7 +36,6 @@ return { 'junegunn/vim-easy-align', 'machakann/vim-highlightedyank', - 'vim-airline/vim-airline', 'lukas-reineke/indent-blankline.nvim', 'lambdalisue/suda.vim', -- git @@ -47,7 +45,13 @@ return { 'sjl/splice.vim', 'jamessan/vim-gnupg', - 'lervag/vimtex', + {'lervag/vimtex', + init = function() + vim.g.tex_conceal="agm" + vim.g.vimtex_quickfix_ignorefilters = { 'overfull', 'underfull' } + end, + ft = "tex", + }, 'ledger/vim-ledger', 'anekos/hledger-vim', diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 147bec8..354fdb1 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -8,6 +8,7 @@ return { { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", + 'nvim-lua/lsp-status.nvim', { "hrsh7th/cmp-nvim-lsp", cond = function() @@ -16,7 +17,7 @@ return { }, }, ---@class PluginLspOpts - opts = { + opts = function() return { -- options for vim.diagnostic.config() diagnostics = { underline = true, @@ -32,7 +33,7 @@ return { severity_sort = true, }, -- add any global capabilities here - capabilities = {}, + capabilities = { require'lsp-status'.capabilities }, servers = { jsonls = {}, lua_ls = { @@ -71,7 +72,7 @@ return { -- Specify * to use this function as a fallback for any server -- ["*"] = function(server, opts) end, }, - }, + } end, ---@param opts PluginLspOpts config = function(_, opts) -- diagnostics @@ -196,5 +197,11 @@ return { end, }, 'mfussenegger/nvim-jdtls', + {'nvim-lua/lsp-status.nvim', + config = function(_, opts) + local lsp_status = require('lsp-status') + lsp_status.register_progress() + end + } } diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua new file mode 100644 index 0000000..6f570ae --- /dev/null +++ b/lua/plugins/tabline.lua @@ -0,0 +1,74 @@ +local colors = { + blue = '#00afff', + lightblue = '#87afff', + orange = '#ffaf5f', + yellow = '#ffd75f', + green = '#87d75f', + red = '#ff0000', + lightred = '#ff5f5f', + white = '#ffffff', + lightgray = '#c6c6c6', + gray = '#6a6a6a', + bggray = '#1c1c1c', + lightbggray = '#262626', + visualgray = '#303030', + black = '#000000', + normfg = '#ffffff', + normbg = '#000000', +} + +return { + 'hoob3rt/lualine.nvim', + dependencies = { + {'kyazdani42/nvim-web-devicons', lazy = true }, + 'nvim-lua/lsp-status.nvim', + }, + opts = { + options = { + theme = { + normal = { + a = { fg = colors.black, bg = colors.gray }, + b = { fg = colors.yellow, bg = colors.lightbggray }, + c = { fg = colors.blue, bg = colors.bggray }, + z = { fg = colors.yellow, bg = colors.gray }, + }, + inactive = { + a = { fg = colors.black, bg = colors.gray }, + b = { fg = colors.red, bg = colors.lightbggray }, + c = { fg = colors.gray, bg = colors.bggray }, + z = { fg = colors.blue, bg = colors.gray }, + }, + insert = { a = { fg = colors.black, bg = colors.green } }, + visual = { a = { fg = colors.black, bg = colors.yellow } }, + replace = { a = { fg = colors.black, bg = colors.red } }, + } + }, + tabline = { + lualine_a = { 'branch' }, + lualine_b = {}, + lualine_c = { 'windows' }, + lualine_x = {}, + lualine_y = {}, + lualine_z = { 'tabs' } + }, + sections = { + lualine_a = { 'filename' }, + lualine_b = { 'diff', 'diagnostics' }, + lualine_c = {}, + lualine_x = { "require'lsp-status'.status()" }, + lualine_y = { 'filetype' }, + lualine_z = { 'searchcount', 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 8f77982..bcbecb9 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -28,7 +28,7 @@ return { }, keys = { { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, + { "", desc = "Decrement selection", mode = "x" }, }, ---@type TSConfig opts = { @@ -76,13 +76,28 @@ return { end added[lang] = true return true - end, opts.ensure_installed) + end, opts.ensure_installed --[[@as string[] ]]) end require("nvim-treesitter.configs").setup(opts) end, }, { 'nvim-treesitter/playground', + dependencies = { "nvim-treesitter/nvim-treesitter" }, cmd = 'TSPlaygroundToggle' }, + { "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + cmd = { 'TSContextEnable', 'TSContextDisable', 'TSContextToggle' }, + keys = { + { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start" }, + }, + opts = { enable = true }, + config = function(_, opts) + require'treesitter-context'.setup(opts) + vim.api.nvim_set_hl(0, 'TreesitterContext', { bg = "#555555" }) + vim.api.nvim_set_hl(0, 'TreesitterContextLineNumber', { link = "Special" }) + end, + } } From 6012fd64610809e973dad236aa605d6275962089 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sat, 24 Jun 2023 18:04:11 +0200 Subject: [PATCH 21/81] Add typescript-specific Optimize Imports binding --- after/ftplugin/typescript.lua | 4 ++++ after/ftplugin/typescriptreact.lua | 1 + 2 files changed, 5 insertions(+) create mode 100644 after/ftplugin/typescript.lua create mode 120000 after/ftplugin/typescriptreact.lua diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua new file mode 100644 index 0000000..e5ad9bf --- /dev/null +++ b/after/ftplugin/typescript.lua @@ -0,0 +1,4 @@ +vim.keymap.set("n", "o", + function() vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) end, + { desc = "Organize imports" } +) diff --git a/after/ftplugin/typescriptreact.lua b/after/ftplugin/typescriptreact.lua new file mode 120000 index 0000000..ede1851 --- /dev/null +++ b/after/ftplugin/typescriptreact.lua @@ -0,0 +1 @@ +typescript.lua \ No newline at end of file From dea49d5689c0778dc0bb4368c6d99082c4677c8c Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 27 Jun 2023 09:27:19 +0200 Subject: [PATCH 22/81] Rename rdf-turtle to rdf_turtle (treesitter complains about dashes) --- ftdetect/turtle.vim | 2 +- syntax/{rdf-turtle.vim => rdf_turtle.vim} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename syntax/{rdf-turtle.vim => rdf_turtle.vim} (100%) diff --git a/ftdetect/turtle.vim b/ftdetect/turtle.vim index 4d5923b..0bec6f9 100644 --- a/ftdetect/turtle.vim +++ b/ftdetect/turtle.vim @@ -1 +1 @@ -au BufRead,BufNewFile *.ttl set filetype=rdf-turtle +au BufRead,BufNewFile *.ttl set filetype=rdf_turtle diff --git a/syntax/rdf-turtle.vim b/syntax/rdf_turtle.vim similarity index 100% rename from syntax/rdf-turtle.vim rename to syntax/rdf_turtle.vim From aa7cf035ff81437c50f466c0571b23f0f6a66f2e Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 27 Jun 2023 12:58:13 +0200 Subject: [PATCH 23/81] Replace vim-eunuch with nvim-genghis because of hangs with :Unlink --- lua/plugins/init.lua | 3 ++- lua/plugins/telescope.lua | 1 - lua/plugins/ui.lua | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 lua/plugins/ui.lua diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index f325736..cf6aeeb 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -6,10 +6,11 @@ return { 'tpope/vim-repeat', 'tpope/vim-surround', 'tpope/vim-characterize', - 'tpope/vim-eunuch', 'tpope/vim-commentary', 'tpope/vim-sleuth', + {"chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim"}, + -- ic / ac {'glts/vim-textobj-comment', dependencies = { 'kana/vim-textobj-user' } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index d1b69f8..9d12b2b 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -10,7 +10,6 @@ return { build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', }, 'gbrlsnchs/telescope-lsp-handlers.nvim', - 'nvim-telescope/telescope-ui-select.nvim', --Plug { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } }, cmd = "Telescope", diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua new file mode 100644 index 0000000..ce22fe5 --- /dev/null +++ b/lua/plugins/ui.lua @@ -0,0 +1,12 @@ +return { + {'stevearc/dressing.nvim', + dependencies = { + 'nvim-telescope/telescope-ui-select.nvim', + }, + opts = { + select = { + backend = {'telescope'} + } + } + } +} From b3ffefc07c5a5eb9f567a4e19eed68b4c02a91ca Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 27 Jun 2023 23:17:19 +0200 Subject: [PATCH 24/81] Fix centerscroll --- after/plugin/centerscroll.vim | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/after/plugin/centerscroll.vim b/after/plugin/centerscroll.vim index 64db6f6..c37197b 100644 --- a/after/plugin/centerscroll.vim +++ b/after/plugin/centerscroll.vim @@ -2,17 +2,4 @@ augroup KeepCentered autocmd! autocmd CursorMoved * normal! zz - autocmd TextChangedI * call InsertRecenter() augroup END - -function InsertRecenter() abort - let at_end = getcursorcharpos()[2] > len(getline('.')) - normal! zz - - " Fix position of cursor at end of line - if at_end - let cursor_pos = getcursorcharpos() - let cursor_pos[2] = cursor_pos[2] + 1 - call setcursorcharpos(cursor_pos[1:]) - endif -endfunction From b3925cebad2f079dab5628fd72c64a709979b5d2 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 4 Jul 2023 11:54:25 +0200 Subject: [PATCH 25/81] Move indent-blankline config to ui stuff --- after/plugin/indent-blankline.lua | 17 ----------------- lua/plugins/init.lua | 1 - lua/plugins/ui.lua | 22 ++++++++++++++++++++-- 3 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 after/plugin/indent-blankline.lua diff --git a/after/plugin/indent-blankline.lua b/after/plugin/indent-blankline.lua deleted file mode 100644 index 0538c5e..0000000 --- a/after/plugin/indent-blankline.lua +++ /dev/null @@ -1,17 +0,0 @@ -vim.cmd [[highlight IndentBlanklineIndent1 guibg=#333333 gui=nocombine]] -vim.cmd [[highlight IndentBlanklineIndent2 guibg=#000000 gui=nocombine]] - -require("indent_blankline").setup { - char = "", - char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", - }, - space_char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", - }, - show_trailing_blankline_indent = false, - show_current_context = true, - show_current_context_start = true, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index cf6aeeb..e8f2bf2 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -37,7 +37,6 @@ return { 'junegunn/vim-easy-align', 'machakann/vim-highlightedyank', - 'lukas-reineke/indent-blankline.nvim', 'lambdalisue/suda.vim', -- git 'lambdalisue/gina.vim', diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index ce22fe5..26a083b 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,12 +1,30 @@ return { - {'stevearc/dressing.nvim', + { + 'stevearc/dressing.nvim', dependencies = { 'nvim-telescope/telescope-ui-select.nvim', }, opts = { select = { - backend = {'telescope'} + backend = { 'telescope' } } } + }, + { + 'lukas-reineke/indent-blankline.nvim', + opts = { + char = "", + char_highlight_list = { + "Normal", + "CursorLine", + }, + space_char_highlight_list = { + "Normal", + "CursorLine", + }, + show_trailing_blankline_indent = false, + show_current_context = true, + show_current_context_start = true, + }, } } From 508883c3c227d8078baaa782134516a3bc9ea232 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 1 Aug 2023 16:28:47 +0200 Subject: [PATCH 26/81] Update lots of things --- after/plugin/gitgutter.vim | 5 -- after/plugin/telescope.lua | 1 + ftdetect/turtle.vim | 2 +- init.lua | 35 ++++++------ lazy-lock.json | 78 +++++++++++++++++++++++++++ lua/my-lsp.lua | 2 - lua/plugins/beamer.lua | 7 +++ lua/plugins/chroma.lua | 5 +- lua/plugins/cmp.lua | 3 +- lua/plugins/fugitive.lua | 3 ++ lua/plugins/init.lua | 2 +- lua/plugins/lspconfig.lua | 8 +-- lua/plugins/lush.lua | 4 ++ lua/plugins/metals.lua | 1 + lua/plugins/tabline.lua | 45 +++------------- lua/plugins/treesitter.lua | 6 ++- syntax/{rdf_turtle.vim => turtle.vim} | 0 17 files changed, 133 insertions(+), 74 deletions(-) delete mode 100644 after/plugin/gitgutter.vim create mode 100644 lazy-lock.json create mode 100644 lua/plugins/beamer.lua create mode 100644 lua/plugins/fugitive.lua create mode 100644 lua/plugins/lush.lua rename syntax/{rdf_turtle.vim => turtle.vim} (100%) diff --git a/after/plugin/gitgutter.vim b/after/plugin/gitgutter.vim deleted file mode 100644 index 8fe5645..0000000 --- a/after/plugin/gitgutter.vim +++ /dev/null @@ -1,5 +0,0 @@ -hi link GitGutterAddLineNr DiffAdd -hi link GitGutterChangeLineNr DiffChange -hi link GitGutterDeleteLineNr DiffDelete -hi link GitGutterChangeDeleteLineNr GitGutterChangeLine -GitGutterLineNrHighlightsEnable diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index fde5ea6..29dd1e3 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -32,3 +32,4 @@ map('n', 'g/', telescope.builtin.live_grep) map('n', '', telescope.builtin.current_buffer_fuzzy_find) map('n', '*', telescope.builtin.grep_string) map('n', 'gb', telescope.builtin.buffers) +map('n', '', telescope.builtin.registers) diff --git a/ftdetect/turtle.vim b/ftdetect/turtle.vim index 0bec6f9..002c820 100644 --- a/ftdetect/turtle.vim +++ b/ftdetect/turtle.vim @@ -1 +1 @@ -au BufRead,BufNewFile *.ttl set filetype=rdf_turtle +au BufRead,BufNewFile *.ttl set filetype=turtle diff --git a/init.lua b/init.lua index 6e69387..db5a34c 100644 --- a/init.lua +++ b/init.lua @@ -7,17 +7,23 @@ end -- lazy.nvim bootstrap 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) -require("lazy").setup("plugins") +require("lazy").setup("plugins", { + dev = { + path = "~/projects/nvim/", + patterns = {"crater2150"}, + fallback = true + } +}) vim.opt.background = "dark" vim.g.chroma_italic_style = "bold" @@ -34,9 +40,6 @@ vim.opt.whichwrap = "b,s,<,>,[,],h,l" vim.opt.timeout = false -vim.opt.foldmethod = "expr" -vim.opt.foldlevelstart = 99 -vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' vim.opt.foldenable = false -- todo visualbell needed? @@ -88,10 +91,10 @@ key('n', '', 'j') key('n', '', 'k') key('n', '', 'l') -- -key('n', '', "',<") -key('n', '', "',>',") -key('n', '', "',-") -key('n', '', "',+") +key('n', '', "<") +key('n', '', ">") +key('n', '', "-") +key('n', '', "+") key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' }) key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' }) diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..70cc0f4 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,78 @@ +{ + "bluloco.nvim": { "branch": "main", "commit": "27ad647f0fc3270e732add1533ad9bcbf702f24e" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, + "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, + "copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" }, + "deepl.vim": { "branch": "main", "commit": "2397b16d4070080b695321a1fe7958fd0812176b" }, + "dressing.nvim": { "branch": "master", "commit": "39611852fd7bbac117e939a26759bb37361f0c90" }, + "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, + "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, + "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, + "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, + "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, + "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, + "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, + "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, + "lsp_signature.nvim": { "branch": "master", "commit": "58d4e810801da74c29313da86075d6aea537501f" }, + "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "lush.nvim": { "branch": "main", "commit": "b10ef2bfff0647e701b691019ade3edd5e44eb50" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, + "mason.nvim": { "branch": "main", "commit": "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd" }, + "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, + "neodev.nvim": { "branch": "main", "commit": "866b6b6e687a93ba98851a03a74bf6d9211b7299" }, + "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, + "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, + "nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" }, + "nvim-genghis": { "branch": "main", "commit": "9f04102a6f591c231dfb23b58ad3b49cd0a43c03" }, + "nvim-jdtls": { "branch": "master", "commit": "96e3978c3fdae3950f6ccda548775e8b8952f74a" }, + "nvim-lspconfig": { "branch": "master", "commit": "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0" }, + "nvim-metals": { "branch": "main", "commit": "92e2085f08da4598c6ae0c19c332c5c04b33a2c5" }, + "nvim-treesitter": { "branch": "master", "commit": "7b04e8b67eec7d92daadf9f0717dd272ddfc81a3" }, + "nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ef32a5c24b767d165ed63fd2b24ac8dc52742521" }, + "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, + "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, + "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, + "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, + "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, + "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, + "telescope.nvim": { "branch": "master", "commit": "1228f3b15ca3d9b95dcb92efda6a3448871030bd" }, + "text-to-colorscheme": { "branch": "main", "commit": "a6226a2d771b52dfadea81b308069a8655e0c978" }, + "trouble.nvim": { "branch": "main", "commit": "0e6703c1d37d2d34ed029ab54f9bd66e3f2ecbf7" }, + "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, + "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, + "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, + "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, + "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, + "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, + "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, + "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, + "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, + "vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" }, + "vim-kitty": { "branch": "main", "commit": "20a2625b600f26ef8ce664c098c78ca5256695a0" }, + "vim-ledger": { "branch": "master", "commit": "8e735f84d2d954229ee65f4dc71bfc0bec897d98" }, + "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, + "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, + "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, + "vim-pandoc": { "branch": "master", "commit": "d4fc6f8234c37eef16b6de8055c5fe53b7d7316a" }, + "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, + "vim-pass": { "branch": "master", "commit": "9bd30f675ea66e3f413d6f45db3be008dd70bbad" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, + "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, + "vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" }, + "vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" }, + "vimtex": { "branch": "master", "commit": "53464eb5df497eb015da773f7a309e3bf2dfa16e" }, + "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } +} \ No newline at end of file diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua index 01be8fe..f3f4b61 100644 --- a/lua/my-lsp.lua +++ b/lua/my-lsp.lua @@ -48,8 +48,6 @@ local on_attach = function(client, bufnr) vim.cmd [[autocmd BufEnter,BufWrite lua vim.lsp.codelens.refresh()]] vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] - - vim.lsp.codelens.refresh() end require("lsp.installer")(on_attach) diff --git a/lua/plugins/beamer.lua b/lua/plugins/beamer.lua new file mode 100644 index 0000000..b3fa6cd --- /dev/null +++ b/lua/plugins/beamer.lua @@ -0,0 +1,7 @@ +return { + 'uloco/bluloco.nvim', + dependencies = { 'rktjmp/lush.nvim' }, + opts = { + italics = true, + }, +} diff --git a/lua/plugins/chroma.lua b/lua/plugins/chroma.lua index daad375..71cb32a 100644 --- a/lua/plugins/chroma.lua +++ b/lua/plugins/chroma.lua @@ -1,5 +1,8 @@ return { + --'crater2150/vim-theme-chroma-lush', 'crater2150/vim-theme-chroma', - lazy = false, priority = 1000, + dev = true, + lazy = false, + priority = 1000, config = function() vim.cmd.colorscheme("chroma") end } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index cefab5e..109a19c 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -9,7 +9,6 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-vsnip', @@ -29,7 +28,7 @@ return { text = false, } } - } + }, }, config = function () require("copilot_cmp").setup() diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua new file mode 100644 index 0000000..db4be56 --- /dev/null +++ b/lua/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + 'tpope/vim-fugitive' +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e8f2bf2..f99e3d8 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -17,7 +17,7 @@ return { }, -- ii / ai 'michaeljsmith/vim-indent-object', - 'airblade/vim-gitgutter', + {'lewis6991/gitsigns.nvim', config=true}, 'neovim/nvim-lspconfig', diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 354fdb1..de53eb9 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -9,12 +9,7 @@ return { "mason.nvim", "williamboman/mason-lspconfig.nvim", 'nvim-lua/lsp-status.nvim', - { - "hrsh7th/cmp-nvim-lsp", - cond = function() - return require("lazy.core.config").plugins["nvim-cmp"] ~= nil - end, - }, + "hrsh7th/cmp-nvim-lsp", }, ---@class PluginLspOpts opts = function() return { @@ -162,6 +157,7 @@ return { nls.builtins.completion.vsnip, nls.builtins.diagnostics.zsh, nls.builtins.formatting.beautysh, + nls.builtins.code_actions.gitsigns, }, } end, diff --git a/lua/plugins/lush.lua b/lua/plugins/lush.lua new file mode 100644 index 0000000..c4fcc84 --- /dev/null +++ b/lua/plugins/lush.lua @@ -0,0 +1,4 @@ +return { + 'rktjmp/lush.nvim', + 'rktjmp/shipwright.nvim', +} diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua index 8cc94b5..8d7d25b 100644 --- a/lua/plugins/metals.lua +++ b/lua/plugins/metals.lua @@ -5,6 +5,7 @@ return { 'mfussenegger/nvim-dap', "hrsh7th/cmp-nvim-lsp", }, + ft = { 'scala', 'sbt' }, config = function() local metals_config = require('metals').bare_config() metals_config.init_options.statusBarProvider = "on" diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index 6f570ae..7f77a0c 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -1,47 +1,14 @@ -local colors = { - blue = '#00afff', - lightblue = '#87afff', - orange = '#ffaf5f', - yellow = '#ffd75f', - green = '#87d75f', - red = '#ff0000', - lightred = '#ff5f5f', - white = '#ffffff', - lightgray = '#c6c6c6', - gray = '#6a6a6a', - bggray = '#1c1c1c', - lightbggray = '#262626', - visualgray = '#303030', - black = '#000000', - normfg = '#ffffff', - normbg = '#000000', -} - return { - 'hoob3rt/lualine.nvim', + 'nvim-lualine/lualine.nvim', dependencies = { {'kyazdani42/nvim-web-devicons', lazy = true }, 'nvim-lua/lsp-status.nvim', + 'crater2150/vim-theme-chroma', }, - opts = { + event = "VeryLazy", + opts = function(_, opts) return { options = { - theme = { - normal = { - a = { fg = colors.black, bg = colors.gray }, - b = { fg = colors.yellow, bg = colors.lightbggray }, - c = { fg = colors.blue, bg = colors.bggray }, - z = { fg = colors.yellow, bg = colors.gray }, - }, - inactive = { - a = { fg = colors.black, bg = colors.gray }, - b = { fg = colors.red, bg = colors.lightbggray }, - c = { fg = colors.gray, bg = colors.bggray }, - z = { fg = colors.blue, bg = colors.gray }, - }, - insert = { a = { fg = colors.black, bg = colors.green } }, - visual = { a = { fg = colors.black, bg = colors.yellow } }, - replace = { a = { fg = colors.black, bg = colors.red } }, - } + theme = require('chroma-theme.lualine') }, tabline = { lualine_a = { 'branch' }, @@ -54,7 +21,6 @@ return { sections = { lualine_a = { 'filename' }, lualine_b = { 'diff', 'diagnostics' }, - lualine_c = {}, lualine_x = { "require'lsp-status'.status()" }, lualine_y = { 'filetype' }, lualine_z = { 'searchcount', 'location' } @@ -71,4 +37,5 @@ return { inactive_winbar = {}, extensions = {} } + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index bcbecb9..0744781 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -83,7 +83,11 @@ return { }, { 'nvim-treesitter/playground', dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = 'TSPlaygroundToggle' + cmd = { + 'TSPlaygroundToggle', + 'TSHighlightCapturesUnderCursor', + 'TSNodeUnderCursor', + } }, { "nvim-treesitter/nvim-treesitter-context", event = "VeryLazy", diff --git a/syntax/rdf_turtle.vim b/syntax/turtle.vim similarity index 100% rename from syntax/rdf_turtle.vim rename to syntax/turtle.vim From 400495feb942b485797d3ef861f9c95253819773 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 1 Aug 2023 16:30:05 +0200 Subject: [PATCH 27/81] Use lush branch of chroma theme --- lua/plugins/chroma.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/chroma.lua b/lua/plugins/chroma.lua index 71cb32a..470d7fb 100644 --- a/lua/plugins/chroma.lua +++ b/lua/plugins/chroma.lua @@ -1,8 +1,8 @@ return { - --'crater2150/vim-theme-chroma-lush', 'crater2150/vim-theme-chroma', dev = true, lazy = false, + branch = 'lush', priority = 1000, config = function() vim.cmd.colorscheme("chroma") end } From eed2756f8305bdb82db6559d39974a2963910b2e Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 18 Aug 2023 11:52:45 +0200 Subject: [PATCH 28/81] Spelllang can take more than one language --- init.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/init.lua b/init.lua index db5a34c..1ae18e5 100644 --- a/init.lua +++ b/init.lua @@ -26,9 +26,6 @@ require("lazy").setup("plugins", { }) vim.opt.background = "dark" -vim.g.chroma_italic_style = "bold" -vim.g.chroma_nontext_dark = 1 - vim.opt.number = true vim.opt.colorcolumn = "+1" @@ -62,7 +59,7 @@ vim.opt.shortmess = vim.o.shortmess .. "c" vim.opt.cursorline = true vim.opt.undofile = true -vim.opt.spelllang = 'de' +vim.opt.spelllang = 'de,en' vim.opt.termguicolors = true vim.opt.pumblend = 10 From cf181c41b7282f6b15734dae3938d2b891d259e6 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 18 Aug 2023 11:59:12 +0200 Subject: [PATCH 29/81] Remove null-ls for now (archived) --- lazy-lock.json | 46 +++++++++++++++++++-------------------- lua/plugins/lspconfig.lua | 20 ----------------- 2 files changed, 23 insertions(+), 43 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 70cc0f4..49ce3f0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,37 +5,36 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, - "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, - "copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" }, + "copilot-cmp": { "branch": "master", "commit": "d631b3afbf26bb17d6cf2b3cd8f3d79e7d5eeca1" }, + "copilot.lua": { "branch": "master", "commit": "b3798d85322b1aaa56cad9d651d2d1aaec6298e9" }, "deepl.vim": { "branch": "main", "commit": "2397b16d4070080b695321a1fe7958fd0812176b" }, - "dressing.nvim": { "branch": "master", "commit": "39611852fd7bbac117e939a26759bb37361f0c90" }, + "dressing.nvim": { "branch": "master", "commit": "6bde51adabba06f7fd4a469885a85f36d78a5f52" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, + "gitsigns.nvim": { "branch": "main", "commit": "55f8fc7b13205d44359080ed00095674c353bd76" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, - "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, + "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp_signature.nvim": { "branch": "master", "commit": "58d4e810801da74c29313da86075d6aea537501f" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "lush.nvim": { "branch": "main", "commit": "b10ef2bfff0647e701b691019ade3edd5e44eb50" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "lush.nvim": { "branch": "main", "commit": "a8f0f7b9f837887f13a61d67b40ae26188fe4d62" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, - "mason.nvim": { "branch": "main", "commit": "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd" }, + "mason.nvim": { "branch": "main", "commit": "74eac861b013786bf231b204b4ba9a7d380f4bd9" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, - "neodev.nvim": { "branch": "main", "commit": "866b6b6e687a93ba98851a03a74bf6d9211b7299" }, - "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, - "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, - "nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" }, - "nvim-genghis": { "branch": "main", "commit": "9f04102a6f591c231dfb23b58ad3b49cd0a43c03" }, - "nvim-jdtls": { "branch": "master", "commit": "96e3978c3fdae3950f6ccda548775e8b8952f74a" }, - "nvim-lspconfig": { "branch": "master", "commit": "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0" }, + "neodev.nvim": { "branch": "main", "commit": "9a5c0f0de5c15fba52d4fb83d425d3f4fa7abfa1" }, + "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, + "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, + "nvim-genghis": { "branch": "main", "commit": "13b773cb3935b25962b0e00ff0795cce6be2eb1e" }, + "nvim-jdtls": { "branch": "master", "commit": "095dc490f362adc85be66dc14bd9665ddd94413b" }, + "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" }, "nvim-metals": { "branch": "main", "commit": "92e2085f08da4598c6ae0c19c332c5c04b33a2c5" }, - "nvim-treesitter": { "branch": "master", "commit": "7b04e8b67eec7d92daadf9f0717dd272ddfc81a3" }, - "nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ef32a5c24b767d165ed63fd2b24ac8dc52742521" }, - "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, + "nvim-treesitter": { "branch": "master", "commit": "11d79aa0f731439f2cd05579a64ac13857002f16" }, + "nvim-treesitter-context": { "branch": "master", "commit": "d8fd71428e02190d8f75ff915b6cca9e3063992c" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, + "nvim-web-devicons": { "branch": "master", "commit": "ab899311f8ae00a47eae8e0879506cead8eb1561" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -45,9 +44,9 @@ "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "1228f3b15ca3d9b95dcb92efda6a3448871030bd" }, + "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, "text-to-colorscheme": { "branch": "main", "commit": "a6226a2d771b52dfadea81b308069a8655e0c978" }, - "trouble.nvim": { "branch": "main", "commit": "0e6703c1d37d2d34ed029ab54f9bd66e3f2ecbf7" }, + "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, @@ -71,8 +70,9 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, + "vim-theme-chroma": { "branch": "lush", "commit": "993207be88aae87f1c31539ace258918f4ed2358" }, "vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" }, "vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" }, - "vimtex": { "branch": "master", "commit": "53464eb5df497eb015da773f7a309e3bf2dfa16e" }, - "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } + "vimtex": { "branch": "master", "commit": "877de3ba5de5f766e5bfa1c3fb0d2ecfcd18f868" }, + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } } \ No newline at end of file diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index de53eb9..814cae2 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -143,26 +143,6 @@ return { }, -- formatters - { - "jose-elias-alvarez/null-ls.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { "mason.nvim" }, - opts = function() - local nls = require("null-ls") - return { - root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"), - sources = { - nls.builtins.formatting.stylua, - nls.builtins.formatting.shfmt, - nls.builtins.completion.vsnip, - nls.builtins.diagnostics.zsh, - nls.builtins.formatting.beautysh, - nls.builtins.code_actions.gitsigns, - }, - } - end, - }, - -- cmdline tools and lsp servers { "williamboman/mason.nvim", From f3923dd425228b52e4495374d7a6a72c45c1fcde Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 18 Aug 2023 14:45:05 +0200 Subject: [PATCH 30/81] Switch to luasnip --- lua/debug.lua | 10 ++-------- lua/my-lsp.lua | 1 - lua/plugins/cmp.lua | 13 ++++++++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lua/debug.lua b/lua/debug.lua index 5b5b393..e40b4af 100644 --- a/lua/debug.lua +++ b/lua/debug.lua @@ -4,14 +4,8 @@ local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) - -- For `vsnip` user. - vim.fn["vsnip#anonymous"](args.body) - - -- For `luasnip` user. - -- require('luasnip').lsp_expand(args.body) - - -- For `ultisnips` user. - -- vim.fn["UltiSnips#Anon"](args.body) + --vim.fn["vsnip#anonymous"](args.body) + require('luasnip').lsp_expand(args.body) end, }, mapping = { diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua index f3f4b61..e3b58cf 100644 --- a/lua/my-lsp.lua +++ b/lua/my-lsp.lua @@ -45,7 +45,6 @@ local on_attach = function(client, bufnr) map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) - vim.cmd [[autocmd BufEnter,BufWrite lua vim.lsp.codelens.refresh()]] vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] end diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 109a19c..4fe090c 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -11,9 +11,11 @@ return { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-vsnip', - 'hrsh7th/vim-vsnip', - 'hrsh7th/vim-vsnip-integ', + -- 'hrsh7th/cmp-vsnip', + -- 'hrsh7th/vim-vsnip', + -- 'hrsh7th/vim-vsnip-integ', + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', 'onsails/lspkind.nvim', { 'zbirenbaum/copilot-cmp', @@ -42,7 +44,8 @@ return { cmp.setup({ snippet = { expand = function(args) - vim.fn["vsnip#anonymous"](args.body) + --vim.fn["vsnip#anonymous"](args.body) + require('luasnip').lsp_expand(args.body) end, }, mapping = { @@ -65,7 +68,7 @@ return { }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, - { name = 'vsnip' }, + { name = 'luasnip' }, { name = "copilot" }, }, { { name = 'buffer' }, From 6e1060fbaf8361f4aa98c45986f632e0d0dbd41f Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 21 Aug 2023 13:54:27 +0200 Subject: [PATCH 31/81] centerscroll: use lua to filter buftypes --- after/plugin/centerscroll.vim | 5 ----- plugin/centerscroll.lua | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) delete mode 100644 after/plugin/centerscroll.vim create mode 100644 plugin/centerscroll.lua diff --git a/after/plugin/centerscroll.vim b/after/plugin/centerscroll.vim deleted file mode 100644 index c37197b..0000000 --- a/after/plugin/centerscroll.vim +++ /dev/null @@ -1,5 +0,0 @@ -" from https://vi.stackexchange.com/a/26055 -augroup KeepCentered - autocmd! - autocmd CursorMoved * normal! zz -augroup END diff --git a/plugin/centerscroll.lua b/plugin/centerscroll.lua new file mode 100644 index 0000000..860d652 --- /dev/null +++ b/plugin/centerscroll.lua @@ -0,0 +1,16 @@ +-- " from https://vi.stackexchange.com/a/26055 +-- augroup KeepCentered +-- autocmd! +-- autocmd CursorMoved * if &buftype == '' | normal! zz | endif +-- augroup END + +vim.api.nvim_create_augroup("KeepCentered", { clear = true }) +vim.api.nvim_create_autocmd("CursorMoved", { + group = "KeepCentered", + pattern = '*', + callback = function() + if vim.o.buftype == '' then + vim.cmd([[normal! zz]]) + end + end, +}) From 8242bdd4c42b32f6e0f8f4d9f725431f09a83808 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 23 Aug 2023 13:25:45 +0200 Subject: [PATCH 32/81] Customize tabline --- ftdetect/extensions.lua | 1 + lua/plugins/tabline.lua | 26 +++++++++++++++++++++----- lua/plugins/treesitter.lua | 6 +++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua index 1098681..c3b69da 100644 --- a/ftdetect/extensions.lua +++ b/ftdetect/extensions.lua @@ -6,6 +6,7 @@ vim.filetype.add({ ['kitty.conf'] = 'kitty', ['neomuttrc'] = 'neomutt', ['template'] = 'sh', + ['mbsyncrc'] = 'mbsyncrc', }, pattern = { ['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty', diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index 7f77a0c..0336192 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -1,7 +1,7 @@ return { 'nvim-lualine/lualine.nvim', dependencies = { - {'kyazdani42/nvim-web-devicons', lazy = true }, + { 'kyazdani42/nvim-web-devicons', lazy = true }, 'nvim-lua/lsp-status.nvim', 'crater2150/vim-theme-chroma', }, @@ -13,13 +13,29 @@ return { tabline = { lualine_a = { 'branch' }, lualine_b = {}, - lualine_c = { 'windows' }, + lualine_c = { { 'windows', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}}, lualine_x = {}, lualine_y = {}, - lualine_z = { 'tabs' } + lualine_z = { + {'tabs', + mode=1, + fmt = function(name, context) + local buflist = vim.fn.tabpagebuflist(context.tabnr) + local mod = not vim.tbl_isempty(vim.tbl_filter( + function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end, + buflist)) + + local wincount = #vim.tbl_filter( + function(i) return i == 'leaf' end, + vim.tbl_flatten(vim.fn.winlayout(context.tabnr)) + ) + + return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '') + end + } } }, sections = { - lualine_a = { 'filename' }, + lualine_a = { filename }, lualine_b = { 'diff', 'diagnostics' }, lualine_x = { "require'lsp-status'.status()" }, lualine_y = { 'filetype' }, @@ -28,7 +44,7 @@ return { inactive_sections = { lualine_a = {}, lualine_b = {}, - lualine_c = { 'filename' }, + lualine_c = { filename }, lualine_x = { 'location' }, lualine_y = {}, lualine_z = {} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 0744781..5e1d743 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,3 +1,7 @@ +local function ts_disable(_, bufnr) + return vim.api.nvim_buf_line_count(bufnr) > 5000 +end + return { { "nvim-treesitter/nvim-treesitter", @@ -32,7 +36,7 @@ return { }, ---@type TSConfig opts = { - highlight = { enable = true }, + highlight = { enable = true, disable = ts_disable }, indent = { enable = true }, ensure_installed = { "bash", From f51ddd6f72b47a8f9c83f6a2906182182b86c9a9 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 23 Aug 2023 17:13:09 +0200 Subject: [PATCH 33/81] Change mappings for cmp --- lua/plugins/cmp.lua | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 4fe090c..09f3cb3 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -32,7 +32,7 @@ return { } }, }, - config = function () + config = function() require("copilot_cmp").setup() end }, @@ -40,6 +40,12 @@ return { config = function() local cmp = require('cmp') local lspkind = require('lspkind') + local luasnip = require('luasnip') + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end cmp.setup({ snippet = { @@ -53,18 +59,44 @@ return { [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), + [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }), - [''] = function(fallback) + [""] = cmp.mapping({ + i = function(fallback) + if cmp.visible() and cmp.get_active_entry() then + cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) + else + fallback() + end + end, + s = cmp.mapping.confirm({ select = true }), + c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }), + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() else fallback() end - end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, From eb8a2a698a21d6ff86699e6ccdeaac5b02eeef6a Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 18 Aug 2023 16:19:58 +0200 Subject: [PATCH 34/81] Remove text-to-color, was just for fun --- lua/plugins/text-to-color.lua | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 lua/plugins/text-to-color.lua diff --git a/lua/plugins/text-to-color.lua b/lua/plugins/text-to-color.lua deleted file mode 100644 index ef20908..0000000 --- a/lua/plugins/text-to-color.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'svermeulen/text-to-colorscheme', - dependencies = { 'tsuyoshicho/vim-pass' }, - config = function () - require('text-to-colorscheme').setup { - ai = { - gpt_model = "gpt-3.5-turbo", - openai_api_key = vim.fn['pass#get']('apikeys/openai_vim'), - }, - } - end -} From 381fb51b80868dc1e5974a83d4318d5153131a30 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 28 Aug 2023 10:36:18 +0200 Subject: [PATCH 35/81] Cleanup and lockfile update --- lazy-lock.json | 39 ++++++++++++++++++++------------------- lua/plugins/deepl.lua | 6 +++++- plugin/my-lsp.lua | 1 - plugin/on-attach.lua | 2 -- 4 files changed, 25 insertions(+), 23 deletions(-) delete mode 100644 plugin/my-lsp.lua diff --git a/lazy-lock.json b/lazy-lock.json index 49ce3f0..5ba5ceb 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,19 +1,22 @@ { + "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, "bluloco.nvim": { "branch": "main", "commit": "27ad647f0fc3270e732add1533ad9bcbf702f24e" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "copilot-cmp": { "branch": "master", "commit": "d631b3afbf26bb17d6cf2b3cd8f3d79e7d5eeca1" }, - "copilot.lua": { "branch": "master", "commit": "b3798d85322b1aaa56cad9d651d2d1aaec6298e9" }, + "copilot.lua": { "branch": "master", "commit": "4f6329cd3c94ad367088cdab3310739eded5acea" }, "deepl.vim": { "branch": "main", "commit": "2397b16d4070080b695321a1fe7958fd0812176b" }, - "dressing.nvim": { "branch": "master", "commit": "6bde51adabba06f7fd4a469885a85f36d78a5f52" }, + "dressing.nvim": { "branch": "master", "commit": "ee571505f3566f84fd252e76c4ce6df6eaf2fb94" }, + "formatter.nvim": { "branch": "master", "commit": "44c89f09dcc220dc2a9b056e93c3a87c86e79804" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "55f8fc7b13205d44359080ed00095674c353bd76" }, + "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, + "hover.nvim": { "branch": "main", "commit": "c366d1b0f9d6612d25681d3fea0f9ea46fa54f4d" }, + "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, @@ -21,20 +24,21 @@ "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "lush.nvim": { "branch": "main", "commit": "a8f0f7b9f837887f13a61d67b40ae26188fe4d62" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, - "mason.nvim": { "branch": "main", "commit": "74eac861b013786bf231b204b4ba9a7d380f4bd9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "2997f467881ac4faa6f8c5e7065e3a672297c8ad" }, + "mason.nvim": { "branch": "main", "commit": "a51c2d063c5377ee9e58c5f9cda7c7436787be72" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, - "neodev.nvim": { "branch": "main", "commit": "9a5c0f0de5c15fba52d4fb83d425d3f4fa7abfa1" }, + "neodev.nvim": { "branch": "main", "commit": "f8a4200951189f7c831cfb698a2e05791e9fd83c" }, "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, - "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, + "nvim-dap": { "branch": "master", "commit": "897c433ff2fbcf6f71a57bf18460d810e173d1e0" }, "nvim-genghis": { "branch": "main", "commit": "13b773cb3935b25962b0e00ff0795cce6be2eb1e" }, "nvim-jdtls": { "branch": "master", "commit": "095dc490f362adc85be66dc14bd9665ddd94413b" }, - "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" }, - "nvim-metals": { "branch": "main", "commit": "92e2085f08da4598c6ae0c19c332c5c04b33a2c5" }, - "nvim-treesitter": { "branch": "master", "commit": "11d79aa0f731439f2cd05579a64ac13857002f16" }, - "nvim-treesitter-context": { "branch": "master", "commit": "d8fd71428e02190d8f75ff915b6cca9e3063992c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, - "nvim-web-devicons": { "branch": "master", "commit": "ab899311f8ae00a47eae8e0879506cead8eb1561" }, + "nvim-lint": { "branch": "master", "commit": "8864e99d560bbb7eefcdab21c105be91161af0ba" }, + "nvim-lspconfig": { "branch": "master", "commit": "1cfb96490c3889a2c57d1ef5e1acc59e9b47c455" }, + "nvim-metals": { "branch": "main", "commit": "57cff9a240f3337129188997887d8848fe6022ad" }, + "nvim-treesitter": { "branch": "master", "commit": "9ea7559ea99701c900b08c1f977eca6ca57eadd2" }, + "nvim-treesitter-context": { "branch": "master", "commit": "14856c9ee6eb0ede0ae9b43782c9be5e7bd946e6" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, + "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -45,7 +49,6 @@ "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, - "text-to-colorscheme": { "branch": "main", "commit": "a6226a2d771b52dfadea81b308069a8655e0c978" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, @@ -71,8 +74,6 @@ "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, "vim-theme-chroma": { "branch": "lush", "commit": "993207be88aae87f1c31539ace258918f4ed2358" }, - "vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" }, - "vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" }, - "vimtex": { "branch": "master", "commit": "877de3ba5de5f766e5bfa1c3fb0d2ecfcd18f868" }, + "vimtex": { "branch": "master", "commit": "534fd725f2475a9083b032e402c7e73b8a3fc6bb" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } } \ No newline at end of file diff --git a/lua/plugins/deepl.lua b/lua/plugins/deepl.lua index 2ee6c3d..0e2c2a6 100644 --- a/lua/plugins/deepl.lua +++ b/lua/plugins/deepl.lua @@ -4,7 +4,11 @@ return { 'ryicoh/deepl.vim', { '', function() vim.fn['deepl#v']("EN") end, mode = 'v' }, { '', function() vim.fn['deepl#v']("DE") end, mode = 'v' }, }, - dependencies = { 'tsuyoshicho/vim-pass' }, + dependencies = {{ 'tsuyoshicho/vim-pass', + init = function () + vim.g.pass_use_agent = 1 + end + }}, config = function () vim.g['deepl#endpoint'] = "https://api-free.deepl.com/v2/translate" vim.g['deepl#auth_key'] = vim.fn['pass#get']('web/deepl.com', 'apikey') diff --git a/plugin/my-lsp.lua b/plugin/my-lsp.lua deleted file mode 100644 index 3758e51..0000000 --- a/plugin/my-lsp.lua +++ /dev/null @@ -1 +0,0 @@ -require('my-lsp') diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 0fe3a52..4a0fb5e 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -14,8 +14,6 @@ local on_attach = function(args) map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) map('n', 'gD', vim.lsp.buf.declaration, opts) map('n', 'gd', vim.lsp.buf.definition, opts) - map('n', 'K', vim.lsp.buf.hover, opts) - map('v', 'K', vim.lsp.buf.hover, opts) map('n', 'gi', vim.lsp.buf.implementation, opts) map('n', '', vim.lsp.buf.signature_help, opts) map('n', 'D', vim.lsp.buf.type_definition, opts) From 80ecaf36163035a852854117828d176bb52e3cdb Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 28 Aug 2023 12:28:15 +0200 Subject: [PATCH 36/81] Add hover.lua --- lua/plugins/hover.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lua/plugins/hover.lua diff --git a/lua/plugins/hover.lua b/lua/plugins/hover.lua new file mode 100644 index 0000000..111ec84 --- /dev/null +++ b/lua/plugins/hover.lua @@ -0,0 +1,23 @@ +return { + "lewis6991/hover.nvim", + config = function() + require("hover").setup { + init = function() + require("hover.providers.lsp") + require('hover.providers.gh') + require('hover.providers.man') + end, + preview_opts = { + border = nil + }, + -- Whether the contents of a currently open hover window should be moved + -- to a :h preview-window when pressing the hover keymap. + preview_window = false, + title = true + } + + -- Setup keymaps + vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"}) + vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"}) + end +} From cc13b9bbdbb605cf884fd407f007dc4648ea3bd0 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 28 Aug 2023 11:07:21 +0200 Subject: [PATCH 37/81] Update plugins --- lazy-lock.json | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 5ba5ceb..0bcb98c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,40 +7,37 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "copilot-cmp": { "branch": "master", "commit": "d631b3afbf26bb17d6cf2b3cd8f3d79e7d5eeca1" }, - "copilot.lua": { "branch": "master", "commit": "4f6329cd3c94ad367088cdab3310739eded5acea" }, + "copilot.lua": { "branch": "master", "commit": "0fa30d6846aae1af1c94a9ead93fa7dcf8affbe6" }, "deepl.vim": { "branch": "main", "commit": "2397b16d4070080b695321a1fe7958fd0812176b" }, - "dressing.nvim": { "branch": "master", "commit": "ee571505f3566f84fd252e76c4ce6df6eaf2fb94" }, - "formatter.nvim": { "branch": "master", "commit": "44c89f09dcc220dc2a9b056e93c3a87c86e79804" }, + "dressing.nvim": { "branch": "master", "commit": "c7b035de7f91bb6b62b4308f105c56d1a968b8c5" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, + "gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "c366d1b0f9d6612d25681d3fea0f9ea46fa54f4d" }, "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, - "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, + "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp_signature.nvim": { "branch": "master", "commit": "58d4e810801da74c29313da86075d6aea537501f" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "lush.nvim": { "branch": "main", "commit": "a8f0f7b9f837887f13a61d67b40ae26188fe4d62" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "2997f467881ac4faa6f8c5e7065e3a672297c8ad" }, - "mason.nvim": { "branch": "main", "commit": "a51c2d063c5377ee9e58c5f9cda7c7436787be72" }, - "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, - "neodev.nvim": { "branch": "main", "commit": "f8a4200951189f7c831cfb698a2e05791e9fd83c" }, - "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, - "nvim-dap": { "branch": "master", "commit": "897c433ff2fbcf6f71a57bf18460d810e173d1e0" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" }, + "mason.nvim": { "branch": "main", "commit": "c811fbf09c7642eebb37d6694f1a016a043f6ed3" }, + "neoconf.nvim": { "branch": "main", "commit": "e7f98b9a12e2a741b84e6761e925fc2196ef460f" }, + "neodev.nvim": { "branch": "main", "commit": "183f5a7357397260b631d6cccceccc3621b50f78" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-dap": { "branch": "master", "commit": "4377a05b9476587b7b485d6a9d9745768c4e4b37" }, "nvim-genghis": { "branch": "main", "commit": "13b773cb3935b25962b0e00ff0795cce6be2eb1e" }, "nvim-jdtls": { "branch": "master", "commit": "095dc490f362adc85be66dc14bd9665ddd94413b" }, - "nvim-lint": { "branch": "master", "commit": "8864e99d560bbb7eefcdab21c105be91161af0ba" }, - "nvim-lspconfig": { "branch": "master", "commit": "1cfb96490c3889a2c57d1ef5e1acc59e9b47c455" }, + "nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" }, "nvim-metals": { "branch": "main", "commit": "57cff9a240f3337129188997887d8848fe6022ad" }, - "nvim-treesitter": { "branch": "master", "commit": "9ea7559ea99701c900b08c1f977eca6ca57eadd2" }, - "nvim-treesitter-context": { "branch": "master", "commit": "14856c9ee6eb0ede0ae9b43782c9be5e7bd946e6" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, + "nvim-treesitter": { "branch": "master", "commit": "d94e1ad9575cc211b5726f09b28ca9454aba22fe" }, + "nvim-treesitter-context": { "branch": "master", "commit": "a77f1aa1264de73b2347385a75508b34f809547f" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "e3e2b6de4ccf781fb653a3a1d397aeb4a0095609" }, "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, - "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, - "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "playground": { "branch": "master", "commit": "429f3e76cbb1c59fe000b690f7a5bea617b890c0" }, + "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, @@ -48,13 +45,13 @@ "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, + "telescope.nvim": { "branch": "master", "commit": "1dfa66b845673effc8771f9ebe511bb36a09f560" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, + "vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, @@ -73,7 +70,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "993207be88aae87f1c31539ace258918f4ed2358" }, "vimtex": { "branch": "master", "commit": "534fd725f2475a9083b032e402c7e73b8a3fc6bb" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } } \ No newline at end of file From daa9394fd5db3aa34b0d797a18f50f19d2f3a89c Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 8 Sep 2023 11:14:20 +0200 Subject: [PATCH 38/81] Add keybindings and binding descriptions --- lazy-lock.json | 1 + lua/plugins/telescope.lua | 95 ++++++++++++++++++++------------------- plugin/on-attach.lua | 47 +++++++++---------- 3 files changed, 73 insertions(+), 70 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 0bcb98c..9bec4f4 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,6 +14,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, + "hover.nvim": { "branch": "main", "commit": "c366d1b0f9d6612d25681d3fea0f9ea46fa54f4d" }, "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 9d12b2b..27acbc9 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,53 +1,54 @@ ---Plug 'nvim-telescope/telescope.nvim' - ---Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ---Plug 'gbrlsnchs/telescope-lsp-handlers.nvim' ---Plug 'nvim-telescope/telescope-ui-select.nvim' return { - "nvim-telescope/telescope.nvim", - dependencies = { - {'nvim-telescope/telescope-fzf-native.nvim', - build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', - }, - 'gbrlsnchs/telescope-lsp-handlers.nvim', ---Plug { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } + "nvim-telescope/telescope.nvim", + dependencies = { + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = + 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', }, - cmd = "Telescope", - version = false, - keys = { - {',ff', require("telescope.builtin").fd, desc = "Find files"}, - {',fg', require("telescope.builtin").git_files, desc = "Find files (git)"}, - {',gs', require("telescope.builtin").git_status, desc = "Git status"}, - {',s', require("telescope.builtin").lsp_dynamic_workspace_symbols, desc = "Symbols"}, - {'g/', require("telescope.builtin").live_grep, desc = "Live grep"}, - {'', require("telescope.builtin").current_buffer_fuzzy_find, desc = "Fuzzy find"}, - {'*', require("telescope.builtin").grep_string, desc = "Find at cursor"}, - {'gb', require("telescope.builtin").buffers}, - { ":", require("telescope.builtin").command_history, desc = "Command History" }, - { ";", require("telescope.builtin").commands, desc = "Commands" }, + 'gbrlsnchs/telescope-lsp-handlers.nvim', + }, + cmd = "Telescope", + version = false, + keys = function() + local builtin = require("telescope.builtin") + local utils = require("telescope.utils") + return { + { ',,', function() builtin.fd { cwd = utils.buffer_dir() } end, desc = "Find files in current file's dir" }, + { ',ff', builtin.fd, desc = "Find files" }, + { ',fg', builtin.git_files, desc = "Find files (git)" }, + { ',gs', builtin.git_status, desc = "Git status" }, + { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, + { 'g/', builtin.live_grep, desc = "Live grep" }, + { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, + { '*', builtin.grep_string, desc = "Find at cursor" }, + { 'gb', builtin.buffers, desc = "Switch buffer" }, + { ":", builtin.command_history, desc = "Command History" }, + { ";", builtin.commands, desc = "Commands" }, + } + end, + opts = { + defaults = { + prompt_prefix = " ", + selection_caret = " ", }, - opts = { - defaults = { - prompt_prefix = " ", - selection_caret = " ", + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown { } - }, + ["ui-select"] = { + require("telescope.themes").get_dropdown {} }, }, - config = function(_, opts) - local telescope = require('telescope') - telescope.setup(opts) - telescope.load_extension('fzf') - telescope.load_extension('ui-select') - end, - } + }, + config = function(_, opts) + local telescope = require('telescope') + telescope.setup(opts) + telescope.load_extension('fzf') + telescope.load_extension('ui-select') + end, +} diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 4a0fb5e..9dcf82c 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -8,34 +8,35 @@ local on_attach = function(args) -- Mappings. local opts = { silent = true, buffer = bufnr } local loud = { buffer = bufnr } + local desc = function(text) return { silent = true, buffer = bufnr, desc = text} end local map = vim.keymap.set -- See `:help vim.lsp.*` for documentation on any of the below functions map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) - map('n', 'gD', vim.lsp.buf.declaration, opts) - map('n', 'gd', vim.lsp.buf.definition, opts) - map('n', 'gi', vim.lsp.buf.implementation, opts) - map('n', '', vim.lsp.buf.signature_help, opts) - map('n', 'D', vim.lsp.buf.type_definition, opts) - map('n', 'rn', vim.lsp.buf.rename, opts) - map('n', '', vim.lsp.buf.code_action, loud) - map('n', '', vim.lsp.codelens.run, loud) - map('n', 'gr', vim.lsp.buf.references, opts) - map('n', '', vim.diagnostic.open_float, opts) - map('n', '[d', vim.diagnostic.goto_prev, opts) - map('n', ']d', vim.diagnostic.goto_next, opts) - map('n', '', vim.diagnostic.setloclist, opts) - map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) - map("n", "dc", function() require("dap").continue() end, opts) - map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) - map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) - map("n", "dso", function() require("dap").step_over() end, opts) - map("n", "dsi", function() require("dap").step_into() end, opts) - map("n", "dl", function() require("dap").run_last() end, opts) + map('n', 'gD', vim.lsp.buf.declaration, desc("Go to declaration")) + map('n', 'gd', vim.lsp.buf.definition, desc("Go to definition")) + map('n', 'gi', vim.lsp.buf.implementation, desc("Go to implementation")) + map('n', '', vim.lsp.buf.signature_help, desc("Show signature help")) + map('n', 'D', vim.lsp.buf.type_definition, desc("Go to type definition")) + map('n', 'rn', vim.lsp.buf.rename, desc("Rename")) + map('n', '', vim.lsp.buf.code_action, desc("Code action")) + map('n', '', vim.lsp.codelens.run, desc("Run code lens")) + map('n', 'gr', vim.lsp.buf.references, desc("Go to references")) + map('n', '', vim.diagnostic.open_float, desc("Open diagnostics")) + map('n', '[d', vim.diagnostic.goto_prev, desc("Go to previous diagnostic")) + map('n', '[d', vim.diagnostic.goto_prev, desc("Go to next diagnostic")) + map('n', '', vim.diagnostic.setloclist, desc("Add buffer diagnostics to location list")) + map("n", "f", function() vim.lsp.buf.format { async = true } end, desc("Format buffer")) + map("n", "dc", function() require("dap").continue() end, desc("Debug: Continue")) + map("n", "dK", function() require("dap.ui.widgets").hover() end, desc("Debug: Hover")) + map("n", "dt", function() require("dap").toggle_breakpoint() end, desc("Debug: Toggle breakpoint")) + map("n", "dso", function() require("dap").step_over() end, desc("Debug: Step over")) + map("n", "dsi", function() require("dap").step_into() end, desc("Debug: Step into")) + map("n", "dl", function() require("dap").run_last() end, desc("Debug: Run last")) - map("n", "aa", vim.diagnostic.setqflist, opts) - map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) - map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) + map("n", "aa", vim.diagnostic.setqflist, desc("Add all diagnostics to quickfix list")) + map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, desc("Add all warnings to quickfix list")) + map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, desc("Add all errors to quickfix list")) vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] From 41d779e3c7a145b797b7a8b4ac855772ef618e88 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 8 Sep 2023 12:06:53 +0200 Subject: [PATCH 39/81] cleanup --- .editorconfig | 14 +++++++++ init.lua | 45 ++++++++++++++------------- lua/my-lsp.lua | 73 -------------------------------------------- plugin/on-attach.lua | 72 +++++++++++++++++++++---------------------- 4 files changed, 72 insertions(+), 132 deletions(-) create mode 100644 .editorconfig delete mode 100644 lua/my-lsp.lua diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a48dce9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.{lua,vim}] +indent_size = tab +indent_style = tab +trim_trailing_whitespace = true + +[*.{lua}] +max_line_length = 140 diff --git a/init.lua b/init.lua index 1ae18e5..78331fb 100644 --- a/init.lua +++ b/init.lua @@ -20,7 +20,7 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup("plugins", { dev = { path = "~/projects/nvim/", - patterns = {"crater2150"}, + patterns = { "crater2150" }, fallback = true } }) @@ -45,6 +45,9 @@ vim.opt.shell = "/bin/zsh" vim.opt.ignorecase = true vim.opt.smartcase = true vim.opt.inccommand = "split" +vim.opt.listchars = "tab:⇥\\ ,trail:-,nbsp:+,lead:␣" +vim.opt.list = true +vim.cmd [[hi link Whitespace Comment]] vim.opt.wildmode = { "list:longest", "list:full" } vim.opt.wildignore = { "*.so", "*.swp", "*.zip", "*.o" } @@ -76,35 +79,35 @@ vim.g.tex_flavor = 'latex' local key = vim.keymap.set -key('n', '', 'za', { desc = 'toggle fold' }) -key('v', '.', 'normal .', { desc = 'repeat last command in visual mode' }) -key('n', 'cy', '"*y', { desc = 'copy to system clipboard' }) +key('n', '', 'za', { desc = 'toggle fold' }) +key('v', '.', 'normal .', { desc = 'repeat last command in visual mode' }) +key('n', 'cy', '"*y', { desc = 'copy to system clipboard' }) -key('t', '', '', { desc = 'exit terminal mode' }) +key('t', '', '', { desc = 'exit terminal mode' }) -- Arrow keys for window movement and resizing -key('n', '', 'h') -key('n', '', 'j') -key('n', '', 'k') -key('n', '', 'l') +key('n', '', 'h') +key('n', '', 'j') +key('n', '', 'k') +key('n', '', 'l') -- -key('n', '', "<") +key('n', '', "<") key('n', '', ">") -key('n', '', "-") -key('n', '', "+") +key('n', '', "-") +key('n', '', "+") -key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' }) -key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' }) +key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' }) +key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' }) -key('i', '', 'u') -key('n', '&', ':&&') -key('x', '&', ':&&') -key('n', 'Y', 'y$') +key('i', '', 'u') +key('n', '&', ':&&') +key('x', '&', ':&&') +key('n', 'Y', 'y$') key('i', '', '', { desc = 'completion' }) -key('n', '', 'nohredraw!', { desc = 'clear search highlight' }) -key('v', 'gs', "'<,'>sort", { desc = 'sort selection' }) +key('n', '', 'nohredraw!', { desc = 'clear search highlight' }) +key('v', 'gs', "'<,'>sort", { desc = 'sort selection' }) -key({ 'n', 'x' }, '', "(EasyAlign)", { desc = 'align selection' }) +key({ 'n', 'x' }, '', "(EasyAlign)", { desc = 'align selection' }) diff --git a/lua/my-lsp.lua b/lua/my-lsp.lua deleted file mode 100644 index e3b58cf..0000000 --- a/lua/my-lsp.lua +++ /dev/null @@ -1,73 +0,0 @@ ---local lsp_status = require('lsp-status') - ---lsp_status.register_progress() - -local map = vim.keymap.set -map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - --Enable completion triggered by - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' - - -- Mappings. - local opts = { silent = true, buffer = bufnr } - local loud = { buffer = bufnr } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - map('n', 'gD', vim.lsp.buf.declaration, opts) - map('n', 'gd', vim.lsp.buf.definition, opts) - map('n', 'K', vim.lsp.buf.hover, opts) - map('v', 'K', vim.lsp.buf.hover, opts) - map('n', 'gi', vim.lsp.buf.implementation, opts) - map('n', '', vim.lsp.buf.signature_help, opts) - map('n', 'D', vim.lsp.buf.type_definition, opts) - map('n', 'rn', vim.lsp.buf.rename, opts) - map('n', '', vim.lsp.buf.code_action, loud) - map('n', '', vim.lsp.codelens.run, loud) - map('n', 'gr', vim.lsp.buf.references, opts) - map('n', '', vim.diagnostic.open_float, opts) - map('n', '[d', vim.diagnostic.goto_prev, opts) - map('n', ']d', vim.diagnostic.goto_next, opts) - map('n', '', vim.diagnostic.setloclist, opts) - map("n", "f", function() vim.lsp.buf.format { async = true } end, opts) - map("n", "dc", function() require("dap").continue() end, opts) - map("n", "dK", function() require("dap.ui.widgets").hover() end, opts) - map("n", "dt", function() require("dap").toggle_breakpoint() end, opts) - map("n", "dso", function() require("dap").step_over() end, opts) - map("n", "dsi", function() require("dap").step_into() end, opts) - map("n", "dl", function() require("dap").run_last() end, opts) - - map("n", "aa", vim.diagnostic.setqflist, opts) - map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, opts) - map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, opts) - - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] - vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] -end - -require("lsp.installer")(on_attach) -require("lsp.metals")(on_attach) -require("lsp.typescript")(on_attach) - -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, -} -) - -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - silent = true, focusable = false -} -) - -local signature_help_cfg = {} -require "lsp_signature".setup(signature_help_cfg) - -return { on_attach = on_attach } diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 9dcf82c..cbf9e97 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -1,45 +1,41 @@ local on_attach = function(args) - local bufnr = args.buf - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + --Enable completion triggered by + vim.bo[args.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' - --Enable completion triggered by - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + for _, mapping in ipairs({ + { 'gD', vim.lsp.buf.declaration, "Go to declaration" }, + { 'gd', require('telescope.builtin').lsp_definitions, "Go to definition" }, + { 'gi', vim.lsp.buf.implementation, "Go to implementation" }, + { '', vim.lsp.buf.signature_help, "Show signature help" }, + { 'D', vim.lsp.buf.type_definition, "Go to type definition" }, + { 'rn', vim.lsp.buf.rename, "Rename" }, + { '', vim.lsp.buf.code_action, "Code action" }, + { '', vim.lsp.codelens.run, "Run code lens" }, + { 'gr', vim.lsp.buf.references, "Go to references" }, + { '', vim.diagnostic.open_float, "Open diagnostics" }, + { '[d', vim.diagnostic.goto_prev, "Go to previous diagnostic" }, + { '[d', vim.diagnostic.goto_prev, "Go to next diagnostic" }, + { '', vim.diagnostic.setloclist, "Add buffer diagnostics to location list" }, + { "f", function() vim.lsp.buf.format { async = true } end, "Format buffer" }, + { "dc", function() require("dap").continue() end, "Debug: Continue" }, + { "dK", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, + { "dt", function() require("dap").toggle_breakpoint() end, "Debug: Toggle breakpoint" }, + { "dso", function() require("dap").step_over() end, "Debug: Step over" }, + { "dsi", function() require("dap").step_into() end, "Debug: Step into" }, + { "dl", function() require("dap").run_last() end, "Debug: Run last" }, + { "aa", vim.diagnostic.setqflist, "Add all diagnostics to quickfix list" }, + { "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, "Add all warnings to quickfix list" }, + { "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, "Add all errors to quickfix list" }, + }) do + vim.keymap.set('n', mapping[1], mapping[2], { silent = true, buffer = args.buf, desc = mapping[3] }) + end - -- Mappings. - local opts = { silent = true, buffer = bufnr } - local loud = { buffer = bufnr } - local desc = function(text) return { silent = true, buffer = bufnr, desc = text} end + vim.keymap.set("n", "dr", function() require("dap").repl.toggle() end, { silent = true, desc = "Toogle debug REPL" }) - local map = vim.keymap.set - -- See `:help vim.lsp.*` for documentation on any of the below functions - map("n", "dr", function() require("dap").repl.toggle() end, { silent = true }) - map('n', 'gD', vim.lsp.buf.declaration, desc("Go to declaration")) - map('n', 'gd', vim.lsp.buf.definition, desc("Go to definition")) - map('n', 'gi', vim.lsp.buf.implementation, desc("Go to implementation")) - map('n', '', vim.lsp.buf.signature_help, desc("Show signature help")) - map('n', 'D', vim.lsp.buf.type_definition, desc("Go to type definition")) - map('n', 'rn', vim.lsp.buf.rename, desc("Rename")) - map('n', '', vim.lsp.buf.code_action, desc("Code action")) - map('n', '', vim.lsp.codelens.run, desc("Run code lens")) - map('n', 'gr', vim.lsp.buf.references, desc("Go to references")) - map('n', '', vim.diagnostic.open_float, desc("Open diagnostics")) - map('n', '[d', vim.diagnostic.goto_prev, desc("Go to previous diagnostic")) - map('n', '[d', vim.diagnostic.goto_prev, desc("Go to next diagnostic")) - map('n', '', vim.diagnostic.setloclist, desc("Add buffer diagnostics to location list")) - map("n", "f", function() vim.lsp.buf.format { async = true } end, desc("Format buffer")) - map("n", "dc", function() require("dap").continue() end, desc("Debug: Continue")) - map("n", "dK", function() require("dap.ui.widgets").hover() end, desc("Debug: Hover")) - map("n", "dt", function() require("dap").toggle_breakpoint() end, desc("Debug: Toggle breakpoint")) - map("n", "dso", function() require("dap").step_over() end, desc("Debug: Step over")) - map("n", "dsi", function() require("dap").step_into() end, desc("Debug: Step into")) - map("n", "dl", function() require("dap").run_last() end, desc("Debug: Run last")) - - map("n", "aa", vim.diagnostic.setqflist, desc("Add all diagnostics to quickfix list")) - map("n", "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, desc("Add all warnings to quickfix list")) - map("n", "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, desc("Add all errors to quickfix list")) - - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] - vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] end vim.api.nvim_create_autocmd("LspAttach", { callback = on_attach }) From 9bffccefba5cac82a2598579ed26427fd429f465 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 8 Sep 2023 12:14:51 +0200 Subject: [PATCH 40/81] more minor stuff --- lua/.luarc.json | 3 +++ lua/plugins/telescope.lua | 1 + lua/plugins/ui.lua | 56 +++++++++++++++++++-------------------- plugin/scaladeps.lua | 7 +++++ 4 files changed, 39 insertions(+), 28 deletions(-) create mode 100644 lua/.luarc.json create mode 100644 plugin/scaladeps.lua diff --git a/lua/.luarc.json b/lua/.luarc.json new file mode 100644 index 0000000..841ada9 --- /dev/null +++ b/lua/.luarc.json @@ -0,0 +1,3 @@ +{ + "workspace.checkThirdParty": false +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 27acbc9..218dd96 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -20,6 +20,7 @@ return { { ',gs', builtin.git_status, desc = "Git status" }, { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, { 'g/', builtin.live_grep, desc = "Live grep" }, + { 'g:', builtin.command_history, desc = "Command history" }, { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, { '*', builtin.grep_string, desc = "Find at cursor" }, { 'gb', builtin.buffers, desc = "Switch buffer" }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 26a083b..bd99bed 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,30 +1,30 @@ return { - { - 'stevearc/dressing.nvim', - dependencies = { - 'nvim-telescope/telescope-ui-select.nvim', - }, - opts = { - select = { - backend = { 'telescope' } - } - } - }, - { - 'lukas-reineke/indent-blankline.nvim', - opts = { - char = "", - char_highlight_list = { - "Normal", - "CursorLine", - }, - space_char_highlight_list = { - "Normal", - "CursorLine", - }, - show_trailing_blankline_indent = false, - show_current_context = true, - show_current_context_start = true, - }, - } + { + 'stevearc/dressing.nvim', + dependencies = { + 'nvim-telescope/telescope-ui-select.nvim', + }, + opts = { + select = { + backend = { 'telescope' } + } + } + }, + { + 'lukas-reineke/indent-blankline.nvim', + opts = { + char = "", + char_highlight_list = { + "Whitespace", + "CursorLine", + }, + space_char_highlight_list = { + "Whitespace", + "CursorLine", + }, + show_trailing_blankline_indent = false, + show_current_context = true, + show_current_context_start = true, + }, + } } diff --git a/plugin/scaladeps.lua b/plugin/scaladeps.lua new file mode 100644 index 0000000..2291f59 --- /dev/null +++ b/plugin/scaladeps.lua @@ -0,0 +1,7 @@ + +local sbtToScalaCLI = function() + vim.cmd[[s/\s*libraryDependencies\s*+=\s*/\/\/> using dep /]] + vim.cmd[[s/" \(%\+\) "/\=repeat(":", strlen(submatch(1)))/g]] +end + +vim.keymap.set("n", "dep", sbtToScalaCLI, { noremap = true, silent = true, desc = "Convert sbt dependency to Scala CLI" }) From 0b9c41b79221e64e12ad32ca503f4bec0b22ce12 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 24 Oct 2023 12:28:17 +0200 Subject: [PATCH 41/81] Update plugin configs --- lua/plugins/init.lua | 1 + lua/plugins/ui.lua | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index f99e3d8..64a6357 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -49,6 +49,7 @@ return { init = function() vim.g.tex_conceal="agm" vim.g.vimtex_quickfix_ignorefilters = { 'overfull', 'underfull' } + vim.g.vimtex_syntax_enabled = 0 end, ft = "tex", }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index bd99bed..ba6fee3 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -12,19 +12,11 @@ return { }, { 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', opts = { - char = "", - char_highlight_list = { - "Whitespace", - "CursorLine", - }, - space_char_highlight_list = { - "Whitespace", - "CursorLine", - }, - show_trailing_blankline_indent = false, - show_current_context = true, - show_current_context_start = true, + whitespace = { highlight = { "Whitespace", "CursorLine" }, remove_blankline_trail = false, }, + indent = { highlight = { "Whitespace", "CursorLine" }, char = "" }, + scope = { enabled = true, }, }, } } From 573d230ad377920e9b7186556f68255dc55e0887 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 27 Oct 2023 11:15:33 +0200 Subject: [PATCH 42/81] Conifgure jdtls --- ftplugin/java.lua | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 70a70bd..d4bf73b 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,20 +1,57 @@ local path = require("mason-core.path") local function mason_package(...) - return path.concat{vim.fn.stdpath("data"), "mason", "packages", ...} + return path.concat { vim.fn.stdpath("data"), "mason", "packages", ... } end -local bundles = vim.fn.glob(mason_package("java-debug-adapter", "extension", "server", "com.microsoft.java.debug.plugin-*.jar"), true, true) +local bundles = vim.fn.glob( + mason_package("java-debug-adapter", "extension", "server", "com.microsoft.java.debug.plugin-*.jar"), true, true) local extra_bundles = vim.fn.glob(mason_package("java-test", "extension", "server", "*.jar"), true, true) vim.list_extend(bundles, extra_bundles) require('jdtls').start_or_attach({ - cmd = {mason_package("jdtls", "bin", "jdtls") }, + cmd = { mason_package("jdtls", "bin", "jdtls") }, on_attach = function(client, bufnr) - require'jdtls.setup'.add_commands() - require'jdtls'.setup_dap() + require 'jdtls'.setup_dap() end, init_options = { bundles = extra_bundles + }, + settings = { + java = { + completion = { + favoriteStaticMembers = { + "org.hamcrest.MatcherAssert.assertThat", + "org.hamcrest.Matchers.*", + "org.hamcrest.CoreMatchers.*", + "org.junit.jupiter.api.Assertions.*", + "java.util.Objects.requireNonNull", + "java.util.Objects.requireNonNullElse", + "org.mockito.Mockito.*" + }, + filteredTypes = { + "com.sun.*", + "io.micrometer.shaded.*", + "java.awt.*", + "jdk.*", + "sun.*", + }, + }, + codeGeneration = { + toString = { + template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}" + }, + hashCodeEquals = { + useJava7Objects = true, + }, + useBlocks = true, + }, + sources = { + organizeImports = { + starThreshold = 3, + staticStarThreshold = 5, + }, + }, + } } }) From 250a4a81424f2ad48419c0ced68a4e0d93470cdf Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 27 Oct 2023 11:17:42 +0200 Subject: [PATCH 43/81] add nvim-lint --- lazy-lock.json | 81 +++++++++++++++++++++------------------- lua/plugins/exttools.lua | 12 ++++++ 2 files changed, 54 insertions(+), 39 deletions(-) create mode 100644 lua/plugins/exttools.lua diff --git a/lazy-lock.json b/lazy-lock.json index 9bec4f4..1c504e8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,76 +1,79 @@ { - "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, - "bluloco.nvim": { "branch": "main", "commit": "27ad647f0fc3270e732add1533ad9bcbf702f24e" }, + "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, + "bluloco.nvim": { "branch": "main", "commit": "e4aad381d5ee432b2ba9feea58d0acd57877f365" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "copilot-cmp": { "branch": "master", "commit": "d631b3afbf26bb17d6cf2b3cd8f3d79e7d5eeca1" }, - "copilot.lua": { "branch": "master", "commit": "0fa30d6846aae1af1c94a9ead93fa7dcf8affbe6" }, - "deepl.vim": { "branch": "main", "commit": "2397b16d4070080b695321a1fe7958fd0812176b" }, - "dressing.nvim": { "branch": "master", "commit": "c7b035de7f91bb6b62b4308f105c56d1a968b8c5" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "688762a3999eeee54b78f447719854f52672ec02" }, + "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, + "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, + "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" }, + "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "c366d1b0f9d6612d25681d3fea0f9ea46fa54f4d" }, - "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, + "hover.nvim": { "branch": "main", "commit": "a173256a9dba938e876ceb4bb5d2742f8866e349" }, + "indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" }, + "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "58d4e810801da74c29313da86075d6aea537501f" }, + "lsp_signature.nvim": { "branch": "master", "commit": "33250c84c7a552daf28ac607d9d9e82f88cd0907" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "lush.nvim": { "branch": "main", "commit": "a8f0f7b9f837887f13a61d67b40ae26188fe4d62" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" }, - "mason.nvim": { "branch": "main", "commit": "c811fbf09c7642eebb37d6694f1a016a043f6ed3" }, - "neoconf.nvim": { "branch": "main", "commit": "e7f98b9a12e2a741b84e6761e925fc2196ef460f" }, - "neodev.nvim": { "branch": "main", "commit": "183f5a7357397260b631d6cccceccc3621b50f78" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-dap": { "branch": "master", "commit": "4377a05b9476587b7b485d6a9d9745768c4e4b37" }, - "nvim-genghis": { "branch": "main", "commit": "13b773cb3935b25962b0e00ff0795cce6be2eb1e" }, - "nvim-jdtls": { "branch": "master", "commit": "095dc490f362adc85be66dc14bd9665ddd94413b" }, - "nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" }, - "nvim-metals": { "branch": "main", "commit": "57cff9a240f3337129188997887d8848fe6022ad" }, - "nvim-treesitter": { "branch": "master", "commit": "d94e1ad9575cc211b5726f09b28ca9454aba22fe" }, - "nvim-treesitter-context": { "branch": "master", "commit": "a77f1aa1264de73b2347385a75508b34f809547f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "e3e2b6de4ccf781fb653a3a1d397aeb4a0095609" }, - "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, - "playground": { "branch": "master", "commit": "429f3e76cbb1c59fe000b690f7a5bea617b890c0" }, - "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, + "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, + "neoconf.nvim": { "branch": "main", "commit": "00dcf2b81c45de1768b4171faa16729f0888cfb8" }, + "neodev.nvim": { "branch": "main", "commit": "7b46fd0f81c9c9ef5d5898879e86ae271152c79f" }, + "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, + "nvim-dap": { "branch": "master", "commit": "3eb26a63a3674e3722182a92f21d04c4e5ce0f43" }, + "nvim-genghis": { "branch": "main", "commit": "ba59d6fd8440c9b8928acd22b845d18fe9a8b848" }, + "nvim-jdtls": { "branch": "master", "commit": "a09f8cdd75c546eb024d0f0b5b3ad185f05b738f" }, + "nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" }, + "nvim-lspconfig": { "branch": "master", "commit": "cb49a4cd622d7ed775c31561bb8aa6a50712d6b9" }, + "nvim-metals": { "branch": "main", "commit": "6692a6512a53b494984eac247ced40e8165dc2ca" }, + "nvim-treesitter": { "branch": "master", "commit": "3954741f2652fbcef9d6877d0e3a4d91d44b1632" }, + "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, + "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "1dfa66b845673effc8771f9ebe511bb36a09f560" }, - "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "b0015e6e4b46a64192c64b68dec9a9ac5a4e5690" }, + "telescope.nvim": { "branch": "master", "commit": "4522d7e3ea75ffddabdc39957168a8a7060b5df0" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" }, + "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" }, - "vim-kitty": { "branch": "main", "commit": "20a2625b600f26ef8ce664c098c78ca5256695a0" }, + "vim-kitty": { "branch": "main", "commit": "891475671feebc4bf0f29f0a0987067913a81686" }, "vim-ledger": { "branch": "master", "commit": "8e735f84d2d954229ee65f4dc71bfc0bec897d98" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, "vim-pandoc": { "branch": "master", "commit": "d4fc6f8234c37eef16b6de8055c5fe53b7d7316a" }, "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, - "vim-pass": { "branch": "master", "commit": "9bd30f675ea66e3f413d6f45db3be008dd70bbad" }, + "vim-pass": { "branch": "master", "commit": "bc04f3b8f77c6b26d4b7c8017fcf443fa58d5ece" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "534fd725f2475a9083b032e402c7e73b8a3fc6bb" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } + "vim-theme-chroma": { "branch": "lush", "commit": "993207be88aae87f1c31539ace258918f4ed2358" }, + "vimtex": { "branch": "master", "commit": "5f18251553e814daa3eee2ec676ae536b55108cf" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/exttools.lua b/lua/plugins/exttools.lua new file mode 100644 index 0000000..2ac70ac --- /dev/null +++ b/lua/plugins/exttools.lua @@ -0,0 +1,12 @@ +return { + 'mfussenegger/nvim-lint', + + { + 'mhartington/formatter.nvim', + opts = function() + return { + + } + end + } +} From 0fc8456552611eff60050f0a81d5e59bb68ca7a8 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 12 Nov 2023 15:27:47 +0100 Subject: [PATCH 44/81] let nvim set terminal title --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 78331fb..f3d462c 100644 --- a/init.lua +++ b/init.lua @@ -27,6 +27,7 @@ require("lazy").setup("plugins", { vim.opt.background = "dark" vim.opt.number = true +vim.opt.title = true vim.opt.colorcolumn = "+1" vim.opt.textwidth = 80 From fa838f8e1bcd3bf6cea59966d133bb70112b85d4 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 12 Nov 2023 15:28:14 +0100 Subject: [PATCH 45/81] Update plugins --- lazy-lock.json | 57 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 1c504e8..a4806b6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,44 +1,44 @@ { - "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, - "bluloco.nvim": { "branch": "main", "commit": "e4aad381d5ee432b2ba9feea58d0acd57877f365" }, + "LuaSnip": { "branch": "master", "commit": "a4de64570b9620875c8ea04175cd07ed8e32ac99" }, + "bluloco.nvim": { "branch": "main", "commit": "f0659d9d068fff9604ab06bdc8eb5d08fe0eeec4" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "688762a3999eeee54b78f447719854f52672ec02" }, + "copilot.lua": { "branch": "master", "commit": "73047082d72fcfdde1f73b7f17ad495cffcbafaa" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, + "dressing.nvim": { "branch": "master", "commit": "fe3071330a0720ce3695ac915820c8134b22d1b0" }, "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "a173256a9dba938e876ceb4bb5d2742f8866e349" }, - "indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" }, - "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, + "hover.nvim": { "branch": "main", "commit": "bb3dc1a9fa34c3577bca627b848625e94a93efe8" }, + "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "33250c84c7a552daf28ac607d9d9e82f88cd0907" }, + "lsp_signature.nvim": { "branch": "master", "commit": "9ed85616b772a07f8db56c26e8fff2d962f1f211" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, - "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, - "neoconf.nvim": { "branch": "main", "commit": "00dcf2b81c45de1768b4171faa16729f0888cfb8" }, - "neodev.nvim": { "branch": "main", "commit": "7b46fd0f81c9c9ef5d5898879e86ae271152c79f" }, - "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, - "nvim-dap": { "branch": "master", "commit": "3eb26a63a3674e3722182a92f21d04c4e5ce0f43" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "6eb8cae80f2e4322ec82cd9f8fa423f6d1eb02c3" }, + "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, + "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, + "neodev.nvim": { "branch": "main", "commit": "20f1e5d3c143333bdf5ea48729f7b50660135cb3" }, + "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, + "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, "nvim-genghis": { "branch": "main", "commit": "ba59d6fd8440c9b8928acd22b845d18fe9a8b848" }, - "nvim-jdtls": { "branch": "master", "commit": "a09f8cdd75c546eb024d0f0b5b3ad185f05b738f" }, - "nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" }, - "nvim-lspconfig": { "branch": "master", "commit": "cb49a4cd622d7ed775c31561bb8aa6a50712d6b9" }, + "nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" }, + "nvim-lint": { "branch": "master", "commit": "775ae0e5a451dd6c5d15de7a828ea72d2c54e8cf" }, + "nvim-lspconfig": { "branch": "master", "commit": "b0852218bc5fa6514a71a9da6d5cfa63a263c83d" }, "nvim-metals": { "branch": "main", "commit": "6692a6512a53b494984eac247ced40e8165dc2ca" }, - "nvim-treesitter": { "branch": "master", "commit": "3954741f2652fbcef9d6877d0e3a4d91d44b1632" }, - "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, - "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, + "nvim-treesitter": { "branch": "master", "commit": "d4fb7557ba0ee203f18b3f290d80a8940f2d637d" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2806d83e3965017382ce08792ee527e708fa1bd4" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" }, + "nvim-web-devicons": { "branch": "master", "commit": "47103b80c38c59f7a1b5408c232b92bf5d018651" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -47,33 +47,32 @@ "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "b0015e6e4b46a64192c64b68dec9a9ac5a4e5690" }, - "telescope.nvim": { "branch": "master", "commit": "4522d7e3ea75ffddabdc39957168a8a7060b5df0" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "0fc69ebbf178631b8ab76745459fade062156ec5" }, + "telescope.nvim": { "branch": "master", "commit": "20bf20500c95208c3ac0ef07245065bf94dcab15" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, - "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, + "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, + "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" }, "vim-kitty": { "branch": "main", "commit": "891475671feebc4bf0f29f0a0987067913a81686" }, - "vim-ledger": { "branch": "master", "commit": "8e735f84d2d954229ee65f4dc71bfc0bec897d98" }, + "vim-ledger": { "branch": "master", "commit": "281346a221434574dd7f8767a352b2bf0b218b74" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, "vim-pandoc": { "branch": "master", "commit": "d4fc6f8234c37eef16b6de8055c5fe53b7d7316a" }, "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, - "vim-pass": { "branch": "master", "commit": "bc04f3b8f77c6b26d4b7c8017fcf443fa58d5ece" }, + "vim-pass": { "branch": "master", "commit": "21062970709f72a3e5eebf6605050743de2c1d97" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "993207be88aae87f1c31539ace258918f4ed2358" }, - "vimtex": { "branch": "master", "commit": "5f18251553e814daa3eee2ec676ae536b55108cf" }, + "vimtex": { "branch": "master", "commit": "7d1dbd0eebe041fbda4d1132622bf051b1546497" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file From c9c8de00c8b81835bc6aa49ad1f4268a2d8a5448 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 12 Nov 2023 15:28:48 +0100 Subject: [PATCH 46/81] Add focused variable highlighting --- plugin/on-attach.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index cbf9e97..73da198 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -1,6 +1,13 @@ local on_attach = function(args) - --Enable completion triggered by - vim.bo[args.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client.server_capabilities.completionProvider then + --Enable completion triggered by + vim.bo[args.buf].omnifunc = "v:lua.vim.lsp.omnifunc" + end + if client.server_capabilities.definitionProvider then + vim.bo[args.buf].tagfunc = "v:lua.vim.lsp.tagfunc" + end + -- -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions @@ -34,8 +41,16 @@ local on_attach = function(args) vim.keymap.set("n", "dr", function() require("dap").repl.toggle() end, { silent = true, desc = "Toogle debug REPL" }) - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] - vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + if client.server_capabilities.signatureHelpProvider then + vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] + vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + end + + if client.server_capabilities.documentHighlightingProvider then + vim.cmd([[autocmd CursorHold lua vim.lsp.buf.document_highlight()]]) + vim.cmd([[autocmd CursorHoldI lua vim.lsp.buf.document_highlight()]]) + vim.cmd([[autocmd CursorMoved lua vim.lsp.buf.clear_references()]]) + end end vim.api.nvim_create_autocmd("LspAttach", { callback = on_attach }) From 0e0a4c9c663ee85eaefe49eb0ca3109ab546f607 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Tue, 30 Jan 2024 17:39:06 +0100 Subject: [PATCH 47/81] Add Jinja2 syntax --- lazy-lock.json | 62 +++++++++++++++++++++++--------------------- lua/plugins/init.lua | 1 + 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index a4806b6..e75f5f9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,54 +1,55 @@ { - "LuaSnip": { "branch": "master", "commit": "a4de64570b9620875c8ea04175cd07ed8e32ac99" }, - "bluloco.nvim": { "branch": "main", "commit": "f0659d9d068fff9604ab06bdc8eb5d08fe0eeec4" }, + "LuaSnip": { "branch": "master", "commit": "6a001360cea89df50f7c5cc8c7a75e6a21f1ef5c" }, + "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, + "bluloco.nvim": { "branch": "main", "commit": "efd790d690febdab74d8d012b6109e490a2db68d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "73047082d72fcfdde1f73b7f17ad495cffcbafaa" }, + "copilot.lua": { "branch": "master", "commit": "38a41d0d78f8823cc144c99784528b9a68bdd608" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "fe3071330a0720ce3695ac915820c8134b22d1b0" }, - "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" }, + "dressing.nvim": { "branch": "master", "commit": "8b7ae53d7f04f33be3439a441db8071c96092d19" }, + "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, + "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "bb3dc1a9fa34c3577bca627b848625e94a93efe8" }, - "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, + "hover.nvim": { "branch": "main", "commit": "0a0dd1baf1bb9415e3358207b6ab35747fb5f3ba" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "9ed85616b772a07f8db56c26e8fff2d962f1f211" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, - "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "6eb8cae80f2e4322ec82cd9f8fa423f6d1eb02c3" }, + "lush.nvim": { "branch": "main", "commit": "f76741886b356586f9dfe8e312fbd1ab0fd1084f" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, - "neodev.nvim": { "branch": "main", "commit": "20f1e5d3c143333bdf5ea48729f7b50660135cb3" }, - "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, - "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, - "nvim-genghis": { "branch": "main", "commit": "ba59d6fd8440c9b8928acd22b845d18fe9a8b848" }, - "nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" }, - "nvim-lint": { "branch": "master", "commit": "775ae0e5a451dd6c5d15de7a828ea72d2c54e8cf" }, - "nvim-lspconfig": { "branch": "master", "commit": "b0852218bc5fa6514a71a9da6d5cfa63a263c83d" }, - "nvim-metals": { "branch": "main", "commit": "6692a6512a53b494984eac247ced40e8165dc2ca" }, - "nvim-treesitter": { "branch": "master", "commit": "d4fb7557ba0ee203f18b3f290d80a8940f2d637d" }, - "nvim-treesitter-context": { "branch": "master", "commit": "2806d83e3965017382ce08792ee527e708fa1bd4" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" }, - "nvim-web-devicons": { "branch": "master", "commit": "47103b80c38c59f7a1b5408c232b92bf5d018651" }, + "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-dap": { "branch": "master", "commit": "bbe2c6f3438542a37cc2141a8e385f7dfe07d87d" }, + "nvim-genghis": { "branch": "main", "commit": "884d98393d434e8e284bb7b32a9144b3dc6823e1" }, + "nvim-jdtls": { "branch": "master", "commit": "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8" }, + "nvim-lint": { "branch": "master", "commit": "849ccb610de3f6ce1a239ea1e68568ef1a53d5df" }, + "nvim-lspconfig": { "branch": "master", "commit": "f451052bd6804e9e5ccd0ac874d7df8d3d4c55b9" }, + "nvim-metals": { "branch": "main", "commit": "826b7542b8bccf9a120d1c613481fb0496f93724" }, + "nvim-treesitter": { "branch": "master", "commit": "42381aae7c1f785e4658cdb34a750be9851ba9af" }, + "nvim-treesitter-context": { "branch": "master", "commit": "cfa8ee19ac9bae9b7fb2958eabe2b45b70c56ccb" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, + "nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "0fc69ebbf178631b8ab76745459fade062156ec5" }, - "telescope.nvim": { "branch": "master", "commit": "20bf20500c95208c3ac0ef07245065bf94dcab15" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, @@ -65,14 +66,15 @@ "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, - "vim-pandoc": { "branch": "master", "commit": "d4fc6f8234c37eef16b6de8055c5fe53b7d7316a" }, - "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, + "vim-pandoc": { "branch": "master", "commit": "84ff781925a28346df99d3764ec697c3088862a7" }, + "vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" }, "vim-pass": { "branch": "master", "commit": "21062970709f72a3e5eebf6605050743de2c1d97" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "7d1dbd0eebe041fbda4d1132622bf051b1546497" }, + "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, + "vimtex": { "branch": "master", "commit": "29b6c052707b2d713fe2097cd5df54ce12ba2f90" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 64a6357..ecc3208 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -59,6 +59,7 @@ return { 'vim-pandoc/vim-pandoc', 'vim-pandoc/vim-pandoc-syntax', 'isobit/vim-caddyfile', + 'Glench/Vim-Jinja2-Syntax', 'GEverding/vim-hocon', 'nfnty/vim-nftables', } From 2a36c3fc7a394245a7a2f7ea715c77514241e955 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 20 Nov 2023 18:05:40 +0100 Subject: [PATCH 48/81] remove duplicate telescope config --- after/plugin/telescope.lua | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 after/plugin/telescope.lua diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua deleted file mode 100644 index 29dd1e3..0000000 --- a/after/plugin/telescope.lua +++ /dev/null @@ -1,35 +0,0 @@ -local map = vim.keymap.set -telescope = require('telescope') -telescope.builtin = require('telescope.builtin') - -telescope.setup { - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown { - -- even more opts - } - } - } -} -telescope.load_extension('fzf') -telescope.load_extension("ui-select") - - ---telescope.load_extension('lsp_handlers') --- -map('n', ',ff', telescope.builtin.fd) -map('n', ',fg', telescope.builtin.git_files) -map('n', ',gs', telescope.builtin.git_status) -map('n', ',s', telescope.builtin.lsp_dynamic_workspace_symbols) -map('n', 'g/', telescope.builtin.live_grep) -map('n', '', telescope.builtin.current_buffer_fuzzy_find) -map('n', '*', telescope.builtin.grep_string) -map('n', 'gb', telescope.builtin.buffers) -map('n', '', telescope.builtin.registers) From 2eca6c0d56478b2689046a8d418369bef942793b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:10:00 +0100 Subject: [PATCH 49/81] Update Plugin Config --- lua/lsp/installer.lua | 51 --------- lua/lsp/metals.lua | 53 --------- lua/lsp/typescript.lua | 13 --- lua/plugins/cmp.lua | 233 +++++++++++++++++++------------------- lua/plugins/init.lua | 11 +- lua/plugins/tabline.lua | 8 +- lua/plugins/telescope.lua | 1 - lua/plugins/ui.lua | 3 +- 8 files changed, 124 insertions(+), 249 deletions(-) delete mode 100644 lua/lsp/installer.lua delete mode 100644 lua/lsp/metals.lua delete mode 100644 lua/lsp/typescript.lua diff --git a/lua/lsp/installer.lua b/lua/lsp/installer.lua deleted file mode 100644 index f0fa06f..0000000 --- a/lua/lsp/installer.lua +++ /dev/null @@ -1,51 +0,0 @@ -local status1, mason = pcall(require, "mason") -local status2, mason_lspconfig = pcall(require, "mason-lspconfig") -if (not (status1 and status2)) then return end - -return function(on_attach) - mason.setup {} - mason_lspconfig.setup { - ensure_installed = { 'jdtls', 'lua_ls' } - } - - local no_autosetup = { - jdtls = true - } - - local extra_config = { - lua_ls = { - on_attach = on_attach, - settings = { - Lua = { - diagnostics = { globals = { 'vim' } }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false, - }, - telemetry = { enable = false }, - }, - }, - }, - ["pylsp"] = { - on_attach = on_attach, - settings = { - pylsp = { - plugins = { - rope_autoimport = { enabled = true, }, - isort = { enabled = true, }, - } - } - } - } - } - - mason_lspconfig.setup_handlers { - function(server_name) - if (not no_autosetup[server_name]) then - require("lspconfig")[server_name].setup( - extra_config[server_name] or { on_attach = on_attach } - ) - end - end, - } -end diff --git a/lua/lsp/metals.lua b/lua/lsp/metals.lua deleted file mode 100644 index fe7416d..0000000 --- a/lua/lsp/metals.lua +++ /dev/null @@ -1,53 +0,0 @@ -local status, metals = pcall(require, "metals") -if (not status) then return function() end end - -return function(on_attach) - metals_config = metals.bare_config() - metals_config.init_options.statusBarProvider = "on" - metals_config.settings = { - showImplicitArguments = true, - superMethodLensesEnabled = true, - } - metals_config.on_attach = function(client, bufnr) - require("metals").setup_dap() - on_attach(client, bufnr) - end - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() - -- Debug settings if you're using nvim-dap - local dap = require("dap") - dap.configurations.scala = { - { - type = "scala", - request = "launch", - name = "RunOrTest", - metals = { - runType = "runOrTestFile", - --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example - }, - }, - { - type = "scala", - request = "launch", - name = "Test Target", - metals = { - runType = "testTarget", - }, - }, - } - - - -- Autocmd that will actually be in charging of starting the whole thing - local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) - vim.api.nvim_create_autocmd("FileType", { - -- NOTE: You may or may not want java included here. You will need it if you - -- want basic Java support but it may also conflict if you are using - -- something like nvim-jdtls which also works on a java filetype autocmd. - pattern = { "scala", "sbt" }, - callback = function() - require("metals").initialize_or_attach(metals_config) - end, - group = nvim_metals_group, - }) - - return metals_config -end diff --git a/lua/lsp/typescript.lua b/lua/lsp/typescript.lua deleted file mode 100644 index 560a7fe..0000000 --- a/lua/lsp/typescript.lua +++ /dev/null @@ -1,13 +0,0 @@ -local status, nvim_lsp = pcall(require, "lspconfig") -if (not status) then return function() end end - -return function(on_attach) - local protocol = require('vim.lsp.protocol') - - -- TypeScript - nvim_lsp.tsserver.setup { - on_attach = on_attach, - filetypes = { "typescript", "typescriptreact", "typescript.tsx" }, - cmd = { "typescript-language-server", "--stdio" } - } -end diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 09f3cb3..cbab29a 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,120 +1,119 @@ return { - { - "hrsh7th/nvim-cmp", - -- load cmp on InsertEnter - event = "InsertEnter", - -- these dependencies will only be loaded when cmp loads - -- dependencies are always lazy-loaded unless specified otherwise - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - -- 'hrsh7th/cmp-vsnip', - -- 'hrsh7th/vim-vsnip', - -- 'hrsh7th/vim-vsnip-integ', - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - 'onsails/lspkind.nvim', - { - 'zbirenbaum/copilot-cmp', - dependencies = { "hrsh7th/nvim-cmp", - { - 'zbirenbaum/copilot.lua', - opts = { - suggestion = { enabled = false }, - panel = { enabled = false }, - filetypes = { - mail = false, - text = false, - } - } - }, - }, - config = function() - require("copilot_cmp").setup() - end - }, - }, - config = function() - local cmp = require('cmp') - local lspkind = require('lspkind') - local luasnip = require('luasnip') - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end + { + "hrsh7th/nvim-cmp", + -- load cmp on InsertEnter + event = "InsertEnter", + -- these dependencies will only be loaded when cmp loads + -- dependencies are always lazy-loaded unless specified otherwise + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + -- 'hrsh7th/cmp-vsnip', + -- 'hrsh7th/vim-vsnip', + -- 'hrsh7th/vim-vsnip-integ', + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + 'onsails/lspkind.nvim', + { + 'zbirenbaum/copilot-cmp', + dependencies = { "hrsh7th/nvim-cmp", + { + 'zbirenbaum/copilot.lua', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { + mail = false, + text = false, + } + } + }, + }, + config = function() + require("copilot_cmp").setup() + end + }, + }, + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') + local luasnip = require('luasnip') + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end - cmp.setup({ - snippet = { - expand = function(args) - --vim.fn["vsnip#anonymous"](args.body) - require('luasnip').lsp_expand(args.body) - end, - }, - mapping = { - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [""] = cmp.mapping({ - i = function(fallback) - if cmp.visible() and cmp.get_active_entry() then - cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) - else - fallback() - end - end, - s = cmp.mapping.confirm({ select = true }), - c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = "copilot" }, - }, { - { name = 'buffer' }, - --{ name = 'path' }, - }), - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', -- show only symbol annotations - maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - symbol_map = { Copilot = "" }, - }) - }, - }) - end, - }, + cmp.setup({ + snippet = { + expand = function(args) + --vim.fn["vsnip#anonymous"](args.body) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = { + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping({ + i = function(fallback) + if cmp.visible() and cmp.get_active_entry() then + cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) + else + fallback() + end + end, + s = cmp.mapping.confirm({ select = true }), + c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = "copilot" }, + }, { + { name = 'buffer', option = { keyword_pattern = [[\k\+]] } }, + --{ name = 'path' }, + }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + symbol_map = { Copilot = "" }, + }) + }, + }) + end, + }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index ecc3208..d5e96e4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -2,7 +2,6 @@ return { "folke/which-key.nvim", 'pbrisbin/vim-mkdir', 'fladson/vim-kitty', - 'tpope/vim-repeat', 'tpope/vim-surround', 'tpope/vim-characterize', @@ -17,8 +16,6 @@ return { }, -- ii / ai 'michaeljsmith/vim-indent-object', - {'lewis6991/gitsigns.nvim', config=true}, - 'neovim/nvim-lspconfig', { 'nvim-telescope/telescope.nvim', @@ -34,15 +31,9 @@ return { 'folke/trouble.nvim', 'folke/lsp-colors.nvim', 'nvim-lua/popup.nvim', - 'junegunn/vim-easy-align', 'machakann/vim-highlightedyank', 'lambdalisue/suda.vim', - -- git - 'lambdalisue/gina.vim', - 'gregsexton/gitv', - 'gisphm/vim-gitignore', - 'sjl/splice.vim', 'jamessan/vim-gnupg', {'lervag/vimtex', @@ -62,5 +53,7 @@ return { 'Glench/Vim-Jinja2-Syntax', 'GEverding/vim-hocon', 'nfnty/vim-nftables', + 'nfnty/vim-nftables', + 'Everduin94/nvim-quick-switcher', } -- 'powerman/vim-plugin-AnsiEsc', diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index 0336192..e210668 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -13,7 +13,7 @@ return { tabline = { lualine_a = { 'branch' }, lualine_b = {}, - lualine_c = { { 'windows', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}}, + lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}}, lualine_x = {}, lualine_y = {}, lualine_z = { @@ -35,16 +35,16 @@ return { } } }, sections = { - lualine_a = { filename }, + lualine_a = { 'filename' }, lualine_b = { 'diff', 'diagnostics' }, lualine_x = { "require'lsp-status'.status()" }, lualine_y = { 'filetype' }, - lualine_z = { 'searchcount', 'location' } + lualine_z = { 'searchcount', 'selectioncount', 'location' } }, inactive_sections = { lualine_a = {}, lualine_b = {}, - lualine_c = { filename }, + lualine_c = { 'filename' }, lualine_x = { 'location' }, lualine_y = {}, lualine_z = {} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 218dd96..a38dfba 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -50,6 +50,5 @@ return { local telescope = require('telescope') telescope.setup(opts) telescope.load_extension('fzf') - telescope.load_extension('ui-select') end, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index ba6fee3..7a228e2 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,8 +1,9 @@ return { { 'stevearc/dressing.nvim', + enabled = true, dependencies = { - 'nvim-telescope/telescope-ui-select.nvim', + --'nvim-telescope/telescope-ui-select.nvim', }, opts = { select = { From 56f0d00f96cd9c5c3cc8882d1d090ef4bf8dc30e Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:15:26 +0100 Subject: [PATCH 50/81] Run formatter on all lua files --- after/ftplugin/java.lua | 16 +- after/plugin/treesitter.lua | 30 ++-- after/plugin/trouble.lua | 18 +- ftdetect/extensions.lua | 29 +-- ftdetect/sc.lua | 14 +- lua/common.lua | 114 ++++++------ lua/debug.lua | 48 ++--- lua/plugins/beamer.lua | 10 +- lua/plugins/chroma.lua | 12 +- lua/plugins/deepl.lua | 13 +- lua/plugins/exttools.lua | 1 - lua/plugins/fugitive.lua | 4 +- lua/plugins/gen.lua | 7 + lua/plugins/git.lua | 14 ++ lua/plugins/hover.lua | 40 ++--- lua/plugins/init.lua | 16 +- lua/plugins/lspconfig.lua | 346 ++++++++++++++++++------------------ lua/plugins/lush.lua | 2 +- lua/plugins/markdown.lua | 4 +- lua/plugins/metals.lua | 108 +++++------ lua/plugins/tabline.lua | 108 +++++------ lua/plugins/telescope.lua | 104 +++++------ lua/plugins/treesitter.lua | 212 +++++++++++----------- plugin/centerscroll.lua | 14 +- plugin/scaladeps.lua | 5 +- 25 files changed, 659 insertions(+), 630 deletions(-) create mode 100644 lua/plugins/gen.lua create mode 100644 lua/plugins/git.lua diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua index f039aac..9a8bec7 100644 --- a/after/ftplugin/java.lua +++ b/after/ftplugin/java.lua @@ -5,18 +5,18 @@ local bmap = vim.keymap.set local map_opt = { silent = true, buffer = true } bmap('n', 'ev', function() require('jdtls').extract_variable() end, - { silent = true, buffer = true, desc = 'Extract variable'}) + { silent = true, buffer = true, desc = 'Extract variable' }) bmap('v', 'ev', function() require('jdtls').extract_variable(true) end, - { silent = true, buffer = true, desc = 'Extract variable'}) + { silent = true, buffer = true, desc = 'Extract variable' }) bmap('n', 'ec', function() require('jdtls').extract_constant() end, - { silent = true, buffer = true, desc = 'Extract constant'}) + { silent = true, buffer = true, desc = 'Extract constant' }) bmap('v', 'ec', function() require('jdtls').extract_constant(true) end, - { silent = true, buffer = true, desc = 'Extract constant'}) + { silent = true, buffer = true, desc = 'Extract constant' }) bmap('v', 'em', function() require('jdtls').extract_method(true) end, - { silent = true, buffer = true, desc = 'Extract method'}) + { silent = true, buffer = true, desc = 'Extract method' }) bmap('n', 'ro', function() require('jdtls').organize_imports() end, - { silent = true, buffer = true, desc = 'Organize imports'}) + { silent = true, buffer = true, desc = 'Organize imports' }) bmap('n', 'tc', function() require 'jdtls'.test_class() end, - { silent = true, buffer = true, desc = 'Test class'}) + { silent = true, buffer = true, desc = 'Test class' }) bmap('n', 'tm', function() require 'jdtls'.test_nearest_method() end, - { silent = true, buffer = true, desc = 'Test nearest method'}) + { silent = true, buffer = true, desc = 'Test nearest method' }) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index 4d9554a..3271d2e 100644 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -1,16 +1,16 @@ -require'nvim-treesitter.configs'.setup { - ensure_installed = { "typescript" }, - sync_install = true, - auto_install = true, - highlight = { - enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true - }, +require 'nvim-treesitter.configs'.setup { + ensure_installed = { "typescript" }, + sync_install = true, + auto_install = true, + highlight = { + enable = true, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true + }, } diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua index a979067..e663d78 100644 --- a/after/plugin/trouble.lua +++ b/after/plugin/trouble.lua @@ -1,11 +1,11 @@ require("trouble").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below } -vim.api.nvim_set_keymap("n", "xx", "Trouble", {silent = true, noremap = true}) -vim.api.nvim_set_keymap("n", "xw", "Trouble workspace_diagnostics", {silent = true, noremap = true}) -vim.api.nvim_set_keymap("n", "xd", "Trouble document_diagnostics", {silent = true, noremap = true}) -vim.api.nvim_set_keymap("n", "xl", "Trouble loclist", {silent = true, noremap = true}) -vim.api.nvim_set_keymap("n", "xq", "Trouble quickfix", {silent = true, noremap = true}) -vim.api.nvim_set_keymap("n", "gR", "Trouble lsp_references", {silent = true, noremap = true}) +vim.api.nvim_set_keymap("n", "xx", "Trouble", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "xw", "Trouble workspace_diagnostics", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "xd", "Trouble document_diagnostics", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "xl", "Trouble loclist", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "xq", "Trouble quickfix", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "gR", "Trouble lsp_references", { silent = true, noremap = true }) diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua index c3b69da..50ad492 100644 --- a/ftdetect/extensions.lua +++ b/ftdetect/extensions.lua @@ -1,19 +1,20 @@ vim.filetype.add({ - extension = { - }, - filename = { - ['.scalafmt.conf'] = 'hocon', - ['kitty.conf'] = 'kitty', - ['neomuttrc'] = 'neomutt', - ['template'] = 'sh', - ['mbsyncrc'] = 'mbsyncrc', - }, - pattern = { - ['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty', - ['${XDG_CONFIG_HOME}/kitty/*.session'] = 'kitty-session', - }, + extension = { + ['vtt'] = 'vtt', + }, + filename = { + ['.scalafmt.conf'] = 'hocon', + ['kitty.conf'] = 'kitty', + ['neomuttrc'] = 'neomutt', + ['template'] = 'sh', + ['mbsyncrc'] = 'mbsyncrc', + }, + pattern = { + ['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty', + ['${XDG_CONFIG_HOME}/kitty/*.session'] = 'kitty-session', + }, }) -- au BufRead,BufNewFile *.ttl set filetype=rdf-turtle -- au! BufNewFile,BufRead *.xwiki set ft=xwiki syntax=xwiki --- +-- diff --git a/ftdetect/sc.lua b/ftdetect/sc.lua index 422a4f8..6d70f77 100644 --- a/ftdetect/sc.lua +++ b/ftdetect/sc.lua @@ -7,13 +7,13 @@ vim.filetype.add({ sc = function(path, bufnr) for _, line in ipairs(vim.filetype.getlines(bufnr, 1, 25)) do if - vim.filetype.findany(line, { - 'var%s<', - 'classvar%s<', - '%^this.*', - '%+%s%w*%s{', - '%*ar%s', - }) + vim.filetype.findany(line, { + 'var%s<', + 'classvar%s<', + '%^this.*', + '%+%s%w*%s{', + '%*ar%s', + }) then return 'supercollider' end diff --git a/lua/common.lua b/lua/common.lua index 7a25f61..97b43ca 100644 --- a/lua/common.lua +++ b/lua/common.lua @@ -1,61 +1,61 @@ -- Adapted from https://github.com/LazyVim/LazyVim/ -- SPDX-License-Identifier: Apache-2.0 return { - icons = { - dap = { - Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, - Breakpoint = " ", - BreakpointCondition = " ", - BreakpointRejected = { " ", "DiagnosticError" }, - LogPoint = ".>", - }, - diagnostics = { - Error = " ", - Warn = " ", - Hint = " ", - Info = " ", - }, - git = { - added = " ", - modified = " ", - removed = " ", - }, - kinds = { - Array = " ", - Boolean = " ", - Class = " ", - Color = " ", - Constant = " ", - Constructor = " ", - Copilot = " ", - Enum = " ", - EnumMember = " ", - Event = " ", - Field = " ", - File = " ", - Folder = " ", - Function = " ", - Interface = " ", - Key = " ", - Keyword = " ", - Method = " ", - Module = " ", - Namespace = " ", - Null = " ", - Number = " ", - Object = " ", - Operator = " ", - Package = " ", - Property = " ", - Reference = " ", - Snippet = " ", - String = " ", - Struct = " ", - Text = " ", - TypeParameter = " ", - Unit = " ", - Value = " ", - Variable = " ", - }, - }, + icons = { + dap = { + Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, + Breakpoint = " ", + BreakpointCondition = " ", + BreakpointRejected = { " ", "DiagnosticError" }, + LogPoint = ".>", + }, + diagnostics = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + }, + git = { + added = " ", + modified = " ", + removed = " ", + }, + kinds = { + Array = " ", + Boolean = " ", + Class = " ", + Color = " ", + Constant = " ", + Constructor = " ", + Copilot = " ", + Enum = " ", + EnumMember = " ", + Event = " ", + Field = " ", + File = " ", + Folder = " ", + Function = " ", + Interface = " ", + Key = " ", + Keyword = " ", + Method = " ", + Module = " ", + Namespace = " ", + Null = " ", + Number = " ", + Object = " ", + Operator = " ", + Package = " ", + Property = " ", + Reference = " ", + Snippet = " ", + String = " ", + Struct = " ", + Text = " ", + TypeParameter = " ", + Unit = " ", + Value = " ", + Variable = " ", + }, + }, } diff --git a/lua/debug.lua b/lua/debug.lua index e40b4af..63bc743 100644 --- a/lua/debug.lua +++ b/lua/debug.lua @@ -1,34 +1,34 @@ -- Setup nvim-cmp. -local cmp = require'cmp' +local cmp = require 'cmp' cmp.setup({ - snippet = { - expand = function(args) - --vim.fn["vsnip#anonymous"](args.body) - require('luasnip').lsp_expand(args.body) - end, - }, - mapping = { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ select = true }), - }, - sources = { - { name = 'nvim_lsp' }, + snippet = { + expand = function(args) + --vim.fn["vsnip#anonymous"](args.body) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ select = true }), + }, + sources = { + { name = 'nvim_lsp' }, - -- For vsnip user. - { name = 'vsnip' }, + -- For vsnip user. + { name = 'vsnip' }, - -- For luasnip user. - -- { name = 'luasnip' }, + -- For luasnip user. + -- { name = 'luasnip' }, - -- For ultisnips user. - -- { name = 'ultisnips' }, + -- For ultisnips user. + -- { name = 'ultisnips' }, - { name = 'buffer' }, - } + { name = 'buffer' }, + } }) -- Setup lsp. diff --git a/lua/plugins/beamer.lua b/lua/plugins/beamer.lua index b3fa6cd..fb0cf3f 100644 --- a/lua/plugins/beamer.lua +++ b/lua/plugins/beamer.lua @@ -1,7 +1,7 @@ return { - 'uloco/bluloco.nvim', - dependencies = { 'rktjmp/lush.nvim' }, - opts = { - italics = true, - }, + 'uloco/bluloco.nvim', + dependencies = { 'rktjmp/lush.nvim' }, + opts = { + italics = true, + }, } diff --git a/lua/plugins/chroma.lua b/lua/plugins/chroma.lua index 470d7fb..49bd750 100644 --- a/lua/plugins/chroma.lua +++ b/lua/plugins/chroma.lua @@ -1,8 +1,8 @@ return { - 'crater2150/vim-theme-chroma', - dev = true, - lazy = false, - branch = 'lush', - priority = 1000, - config = function() vim.cmd.colorscheme("chroma") end + 'crater2150/vim-theme-chroma', + dev = true, + lazy = false, + branch = 'lush', + priority = 1000, + config = function() vim.cmd.colorscheme("chroma") end } diff --git a/lua/plugins/deepl.lua b/lua/plugins/deepl.lua index 0e2c2a6..65d0302 100644 --- a/lua/plugins/deepl.lua +++ b/lua/plugins/deepl.lua @@ -1,15 +1,16 @@ -return { 'ryicoh/deepl.vim', +return { + 'ryicoh/deepl.vim', keys = { - { '', function() vim.fn['deepl#v']("EN") end, mode = 'v' }, { '', function() vim.fn['deepl#v']("DE") end, mode = 'v' }, }, - dependencies = {{ 'tsuyoshicho/vim-pass', - init = function () + dependencies = { { + 'tsuyoshicho/vim-pass', + init = function() vim.g.pass_use_agent = 1 end - }}, - config = function () + } }, + config = function() vim.g['deepl#endpoint'] = "https://api-free.deepl.com/v2/translate" vim.g['deepl#auth_key'] = vim.fn['pass#get']('web/deepl.com', 'apikey') end diff --git a/lua/plugins/exttools.lua b/lua/plugins/exttools.lua index 2ac70ac..f288631 100644 --- a/lua/plugins/exttools.lua +++ b/lua/plugins/exttools.lua @@ -1,6 +1,5 @@ return { 'mfussenegger/nvim-lint', - { 'mhartington/formatter.nvim', opts = function() diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index db4be56..b986ebf 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,3 +1 @@ -return { - 'tpope/vim-fugitive' -} +return { 'tpope/vim-fugitive' } diff --git a/lua/plugins/gen.lua b/lua/plugins/gen.lua new file mode 100644 index 0000000..6336f72 --- /dev/null +++ b/lua/plugins/gen.lua @@ -0,0 +1,7 @@ +return { + "David-Kunz/gen.nvim", + opts = { + model = "mistral", -- The default model to use. + init = false, + } +} diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua new file mode 100644 index 0000000..1b183d5 --- /dev/null +++ b/lua/plugins/git.lua @@ -0,0 +1,14 @@ +return { + 'lambdalisue/gina.vim', + 'gisphm/vim-gitignore', + 'sjl/splice.vim', + { + 'lewis6991/gitsigns.nvim', + config = { + signs = { + add = { text = '▌' }, + change = { text = '▐' }, + }, + } + }, +} diff --git a/lua/plugins/hover.lua b/lua/plugins/hover.lua index 111ec84..7cb1652 100644 --- a/lua/plugins/hover.lua +++ b/lua/plugins/hover.lua @@ -1,23 +1,23 @@ return { - "lewis6991/hover.nvim", - config = function() - require("hover").setup { - init = function() - require("hover.providers.lsp") - require('hover.providers.gh') - require('hover.providers.man') - end, - preview_opts = { - border = nil - }, - -- Whether the contents of a currently open hover window should be moved - -- to a :h preview-window when pressing the hover keymap. - preview_window = false, - title = true - } + "lewis6991/hover.nvim", + config = function() + require("hover").setup { + init = function() + require("hover.providers.lsp") + require('hover.providers.gh') + require('hover.providers.man') + end, + preview_opts = { + border = nil + }, + -- Whether the contents of a currently open hover window should be moved + -- to a :h preview-window when pressing the hover keymap. + preview_window = false, + title = true + } - -- Setup keymaps - vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"}) - vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"}) - end + -- Setup keymaps + vim.keymap.set("n", "K", require("hover").hover, { desc = "hover.nvim" }) + vim.keymap.set("n", "gK", require("hover").hover_select, { desc = "hover.nvim (select)" }) + end } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index d5e96e4..e2449dd 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -8,21 +8,24 @@ return { 'tpope/vim-commentary', 'tpope/vim-sleuth', - {"chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim"}, + { "chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim" }, -- ic / ac - {'glts/vim-textobj-comment', + { + 'glts/vim-textobj-comment', dependencies = { 'kana/vim-textobj-user' } }, -- ii / ai 'michaeljsmith/vim-indent-object', 'neovim/nvim-lspconfig', - { 'nvim-telescope/telescope.nvim', + { + 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } }, - { 'ray-x/lsp_signature.nvim', + { + 'ray-x/lsp_signature.nvim', config = function() require('lsp_signature').setup({}) end @@ -36,9 +39,10 @@ return { 'lambdalisue/suda.vim', 'jamessan/vim-gnupg', - {'lervag/vimtex', + { + 'lervag/vimtex', init = function() - vim.g.tex_conceal="agm" + vim.g.tex_conceal = "agm" vim.g.vimtex_quickfix_ignorefilters = { 'overfull', 'underfull' } vim.g.vimtex_syntax_enabled = 0 end, diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 814cae2..51ce1d2 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -1,183 +1,185 @@ return { - -- lspconfig - { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, - { "folke/neodev.nvim", opts = {} }, - "mason.nvim", - "williamboman/mason-lspconfig.nvim", - 'nvim-lua/lsp-status.nvim', - "hrsh7th/cmp-nvim-lsp", - }, - ---@class PluginLspOpts - opts = function() return { - -- options for vim.diagnostic.config() - diagnostics = { - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 4, - source = "if_many", - prefix = "●", - -- this will set set the prefix to a function that returns the diagnostics icon based on the severity - -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported - -- prefix = "icons", - }, - severity_sort = true, - }, - -- add any global capabilities here - capabilities = { require'lsp-status'.capabilities }, - servers = { - jsonls = {}, - lua_ls = { - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = "Replace", - }, - telemetry = { enable = false }, - }, - }, - }, - pylsp = { - settings = { - pylsp = { - plugins = { - rope_autoimport = { enabled = true, }, - isort = { enabled = true, }, - } - } - } - } - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - -- tsserver = function(_, opts) - -- require("typescript").setup({ server = opts }) - -- return true - -- end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - } end, - ---@param opts PluginLspOpts - config = function(_, opts) - -- diagnostics - for name, icon in pairs(require("common").icons.diagnostics) do - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) - end + -- lspconfig + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, + { "folke/neodev.nvim", opts = {} }, + "mason.nvim", + "williamboman/mason-lspconfig.nvim", + 'nvim-lua/lsp-status.nvim', + "hrsh7th/cmp-nvim-lsp", + }, + ---@class PluginLspOpts + opts = function() + return { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + }, + severity_sort = true, + }, + -- add any global capabilities here + capabilities = { require 'lsp-status'.capabilities }, + servers = { + jsonls = {}, + lua_ls = { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = "Replace", + }, + telemetry = { enable = false }, + }, + }, + }, + pylsp = { + settings = { + pylsp = { + plugins = { + rope_autoimport = { enabled = true, }, + isort = { enabled = true, }, + } + } + } + } + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + -- tsserver = function(_, opts) + -- require("typescript").setup({ server = opts }) + -- return true + -- end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + } + end, + ---@param opts PluginLspOpts + config = function(_, opts) + -- diagnostics + for name, icon in pairs(require("common").icons.diagnostics) do + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end - if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then - opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" - or function(diagnostic) - local icons = require("common").icons.diagnostics - for d, icon in pairs(icons) do - if diagnostic.severity == vim.diagnostic.severity[d:upper()] then - return icon - end - end - end - end + if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then + opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" + or function(diagnostic) + local icons = require("common").icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon + end + end + end + end - vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) - local servers = opts.servers - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - require("cmp_nvim_lsp").default_capabilities(), - opts.capabilities or {} - ) + local servers = opts.servers + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + require("cmp_nvim_lsp").default_capabilities(), + opts.capabilities or {} + ) - local function setup(server) - local server_opts = vim.tbl_deep_extend("force", { - capabilities = vim.deepcopy(capabilities), - }, servers[server] or {}) + local function setup(server) + local server_opts = vim.tbl_deep_extend("force", { + capabilities = vim.deepcopy(capabilities), + }, servers[server] or {}) - if opts.setup[server] then - if opts.setup[server](server, server_opts) then - return - end - elseif opts.setup["*"] then - if opts.setup["*"](server, server_opts) then - return - end - end - require("lspconfig")[server].setup(server_opts) - end + if opts.setup[server] then + if opts.setup[server](server, server_opts) then + return + end + elseif opts.setup["*"] then + if opts.setup["*"](server, server_opts) then + return + end + end + require("lspconfig")[server].setup(server_opts) + end - -- get all the servers that are available thourgh mason-lspconfig - local have_mason, mlsp = pcall(require, "mason-lspconfig") - local all_mslp_servers = {} - if have_mason then - all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) - end + -- get all the servers that are available thourgh mason-lspconfig + local have_mason, mlsp = pcall(require, "mason-lspconfig") + local all_mslp_servers = {} + if have_mason then + all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) + end - local ensure_installed = {} ---@type string[] - for server, server_opts in pairs(servers) do - if server_opts then - server_opts = server_opts == true and {} or server_opts - -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - setup(server) - else - ensure_installed[#ensure_installed + 1] = server - end - end - end + local ensure_installed = {} ---@type string[] + for server, server_opts in pairs(servers) do + if server_opts then + server_opts = server_opts == true and {} or server_opts + -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + setup(server) + else + ensure_installed[#ensure_installed + 1] = server + end + end + end - if have_mason then - mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) - end - end, - }, + if have_mason then + mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) + end + end, + }, - -- formatters - -- cmdline tools and lsp servers - { - "williamboman/mason.nvim", - cmd = "Mason", - opts = { - ensure_installed = { - "jdtls", - "lua-language-server", - }, - }, - ---@param opts MasonSettings | {ensure_installed: string[]} - config = function(_, opts) - require("mason").setup(opts) - local mr = require("mason-registry") - local function ensure_installed() - for _, tool in ipairs(opts.ensure_installed) do - local p = mr.get_package(tool) - if not p:is_installed() then - p:install() - end - end - end - if mr.refresh then - mr.refresh(ensure_installed) - else - ensure_installed() - end - end, - }, - 'mfussenegger/nvim-jdtls', - {'nvim-lua/lsp-status.nvim', - config = function(_, opts) - local lsp_status = require('lsp-status') - lsp_status.register_progress() - end - } + -- formatters + -- cmdline tools and lsp servers + { + "williamboman/mason.nvim", + cmd = "Mason", + opts = { + ensure_installed = { + "jdtls", + "lua-language-server", + }, + }, + ---@param opts MasonSettings | {ensure_installed: string[]} + config = function(_, opts) + require("mason").setup(opts) + local mr = require("mason-registry") + local function ensure_installed() + for _, tool in ipairs(opts.ensure_installed) do + local p = mr.get_package(tool) + if not p:is_installed() then + p:install() + end + end + end + if mr.refresh then + mr.refresh(ensure_installed) + else + ensure_installed() + end + end, + }, + 'mfussenegger/nvim-jdtls', + { + 'nvim-lua/lsp-status.nvim', + config = function(_, opts) + local lsp_status = require('lsp-status') + lsp_status.register_progress() + end + } } - diff --git a/lua/plugins/lush.lua b/lua/plugins/lush.lua index c4fcc84..78e3086 100644 --- a/lua/plugins/lush.lua +++ b/lua/plugins/lush.lua @@ -1,4 +1,4 @@ return { 'rktjmp/lush.nvim', - 'rktjmp/shipwright.nvim', + 'rktjmp/shipwright.nvim', } diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index 77a4522..851d7ef 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -1,4 +1,4 @@ return { - 'euclio/vim-markdown-composer', - build = 'cargo build --release' + 'euclio/vim-markdown-composer', + build = 'cargo build --release' } diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua index 8d7d25b..5e704e5 100644 --- a/lua/plugins/metals.lua +++ b/lua/plugins/metals.lua @@ -1,59 +1,59 @@ return { - 'scalameta/nvim-metals', - dependencies = { - 'nvim-lua/plenary.nvim', - 'mfussenegger/nvim-dap', - "hrsh7th/cmp-nvim-lsp", - }, - ft = { 'scala', 'sbt' }, - config = function() - local metals_config = require('metals').bare_config() - metals_config.init_options.statusBarProvider = "on" - metals_config.settings = { - showImplicitArguments = true, - superMethodLensesEnabled = true, - } - metals_config.on_attach = function(client, bufnr) - require("metals").setup_dap() - require("my_lsp").on_attach(client, bufnr) - end - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() - -- Debug settings if you're using nvim-dap - local dap = require("dap") - dap.configurations.scala = { - { - type = "scala", - request = "launch", - name = "RunOrTest", - metals = { - runType = "runOrTestFile", - --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example - }, - }, - { - type = "scala", - request = "launch", - name = "Test Target", - metals = { - runType = "testTarget", - }, - }, - } + 'scalameta/nvim-metals', + dependencies = { + 'nvim-lua/plenary.nvim', + 'mfussenegger/nvim-dap', + "hrsh7th/cmp-nvim-lsp", + }, + ft = { 'scala', 'sbt' }, + config = function() + local metals_config = require('metals').bare_config() + metals_config.init_options.statusBarProvider = "on" + metals_config.settings = { + showImplicitArguments = true, + superMethodLensesEnabled = true, + } + metals_config.on_attach = function(client, bufnr) + require("metals").setup_dap() + require("my_lsp").on_attach(client, bufnr) + end + metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() + -- Debug settings if you're using nvim-dap + local dap = require("dap") + dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example + }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", + }, + }, + } - -- Autocmd that will actually be in charging of starting the whole thing - local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) - vim.api.nvim_create_autocmd("FileType", { - -- NOTE: You may or may not want java included here. You will need it if you - -- want basic Java support but it may also conflict if you are using - -- something like nvim-jdtls which also works on a java filetype autocmd. - pattern = { "scala", "sbt" }, - callback = function() - require("metals").initialize_or_attach(metals_config) - end, - group = nvim_metals_group, - }) + -- Autocmd that will actually be in charging of starting the whole thing + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + -- NOTE: You may or may not want java included here. You will need it if you + -- want basic Java support but it may also conflict if you are using + -- something like nvim-jdtls which also works on a java filetype autocmd. + pattern = { "scala", "sbt" }, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) - return metals_config - end + return metals_config + end } diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index e210668..0365eb1 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -1,57 +1,59 @@ return { - 'nvim-lualine/lualine.nvim', - dependencies = { - { 'kyazdani42/nvim-web-devicons', lazy = true }, - 'nvim-lua/lsp-status.nvim', - 'crater2150/vim-theme-chroma', - }, - event = "VeryLazy", - opts = function(_, opts) return { - options = { - theme = require('chroma-theme.lualine') - }, - tabline = { - lualine_a = { 'branch' }, - lualine_b = {}, - lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { - {'tabs', - mode=1, - fmt = function(name, context) - local buflist = vim.fn.tabpagebuflist(context.tabnr) - local mod = not vim.tbl_isempty(vim.tbl_filter( - function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end, - buflist)) + 'nvim-lualine/lualine.nvim', + dependencies = { + { 'kyazdani42/nvim-web-devicons', lazy = true }, + 'nvim-lua/lsp-status.nvim', + 'crater2150/vim-theme-chroma', + }, + event = "VeryLazy", + opts = function(_, opts) + return { + options = { + theme = require('chroma-theme.lualine') + }, + tabline = { + lualine_a = { 'branch' }, + lualine_b = {}, + lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁" }, } }, + lualine_x = {}, + lualine_y = {}, + lualine_z = { + { + 'tabs', + mode = 1, + fmt = function(name, context) + local buflist = vim.fn.tabpagebuflist(context.tabnr) + local mod = not vim.tbl_isempty(vim.tbl_filter( + function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end, + buflist)) - local wincount = #vim.tbl_filter( - function(i) return i == 'leaf' end, - vim.tbl_flatten(vim.fn.winlayout(context.tabnr)) - ) + local wincount = #vim.tbl_filter( + function(i) return i == 'leaf' end, + vim.tbl_flatten(vim.fn.winlayout(context.tabnr)) + ) - return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '') - end - } } - }, - sections = { - lualine_a = { 'filename' }, - lualine_b = { 'diff', 'diagnostics' }, - lualine_x = { "require'lsp-status'.status()" }, - lualine_y = { 'filetype' }, - lualine_z = { 'searchcount', 'selectioncount', 'location' } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, - winbar = {}, - inactive_winbar = {}, - extensions = {} - } - end, + return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '') + end + } } + }, + sections = { + lualine_a = { 'filename' }, + lualine_b = { 'diff', 'diagnostics' }, + lualine_x = { "require'lsp-status'.status()" }, + lualine_y = { 'filetype' }, + lualine_z = { 'searchcount', 'selectioncount', 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index a38dfba..5579eb0 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,54 +1,54 @@ return { - "nvim-telescope/telescope.nvim", - dependencies = { - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = - 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', - }, - 'gbrlsnchs/telescope-lsp-handlers.nvim', - }, - cmd = "Telescope", - version = false, - keys = function() - local builtin = require("telescope.builtin") - local utils = require("telescope.utils") - return { - { ',,', function() builtin.fd { cwd = utils.buffer_dir() } end, desc = "Find files in current file's dir" }, - { ',ff', builtin.fd, desc = "Find files" }, - { ',fg', builtin.git_files, desc = "Find files (git)" }, - { ',gs', builtin.git_status, desc = "Git status" }, - { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, - { 'g/', builtin.live_grep, desc = "Live grep" }, - { 'g:', builtin.command_history, desc = "Command history" }, - { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, - { '*', builtin.grep_string, desc = "Find at cursor" }, - { 'gb', builtin.buffers, desc = "Switch buffer" }, - { ":", builtin.command_history, desc = "Command History" }, - { ";", builtin.commands, desc = "Commands" }, - } - end, - opts = { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown {} - }, - }, - }, - config = function(_, opts) - local telescope = require('telescope') - telescope.setup(opts) - telescope.load_extension('fzf') - end, + "nvim-telescope/telescope.nvim", + dependencies = { + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = + 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', + }, + 'gbrlsnchs/telescope-lsp-handlers.nvim', + }, + cmd = "Telescope", + version = false, + keys = function() + local builtin = require("telescope.builtin") + local utils = require("telescope.utils") + return { + { ',,', function() builtin.fd { cwd = utils.buffer_dir() } end, desc = "Find files in current file's dir" }, + { ',ff', builtin.fd, desc = "Find files" }, + { ',fg', builtin.git_files, desc = "Find files (git)" }, + { ',gs', builtin.git_status, desc = "Git status" }, + { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, + { 'g/', builtin.live_grep, desc = "Live grep" }, + { 'g:', builtin.command_history, desc = "Command history" }, + { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, + { '*', builtin.grep_string, desc = "Find at cursor" }, + { 'gb', builtin.buffers, desc = "Switch buffer" }, + { ":", builtin.command_history, desc = "Command History" }, + { ";", builtin.commands, desc = "Commands" }, + } + end, + opts = { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown {} + }, + }, + }, + config = function(_, opts) + local telescope = require('telescope') + telescope.setup(opts) + telescope.load_extension('fzf') + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 5e1d743..ca161a6 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,111 +1,113 @@ local function ts_disable(_, bufnr) - return vim.api.nvim_buf_line_count(bufnr) > 5000 + return vim.api.nvim_buf_line_count(bufnr) > 5000 end return { - { - "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows - build = ":TSUpdate", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { - { - "nvim-treesitter/nvim-treesitter-textobjects", - init = function() - -- PERF: no need to load the plugin, if we only need its queries for mini.ai - local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"] - local opts = require("lazy.core.plugin").values(plugin, "opts", false) - local enabled = false - if opts.textobjects then - for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do - if opts.textobjects[mod] and opts.textobjects[mod].enable then - enabled = true - break - end - end - end - if not enabled then - require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects") - end - end, - }, - }, - keys = { - { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, - }, - ---@type TSConfig - opts = { - highlight = { enable = true, disable = ts_disable }, - indent = { enable = true }, - ensure_installed = { - "bash", - "gitignore", - "html", - "java", - "json", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "scala", - "tsx", - "typescript", - "vim", - "vimdoc", - "yaml", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }, - ---@param opts TSConfig - config = function(_, opts) - if type(opts.ensure_installed) == "table" then - ---@type table - local added = {} - opts.ensure_installed = vim.tbl_filter(function(lang) - if added[lang] then - return false - end - added[lang] = true - return true - end, opts.ensure_installed --[[@as string[] ]]) - end - require("nvim-treesitter.configs").setup(opts) - end, - }, - { 'nvim-treesitter/playground', - dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = { - 'TSPlaygroundToggle', - 'TSHighlightCapturesUnderCursor', - 'TSNodeUnderCursor', - } - }, - { "nvim-treesitter/nvim-treesitter-context", - event = "VeryLazy", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = { 'TSContextEnable', 'TSContextDisable', 'TSContextToggle' }, - keys = { - { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start" }, - }, - opts = { enable = true }, - config = function(_, opts) - require'treesitter-context'.setup(opts) - vim.api.nvim_set_hl(0, 'TreesitterContext', { bg = "#555555" }) - vim.api.nvim_set_hl(0, 'TreesitterContextLineNumber', { link = "Special" }) - end, - } + { + "nvim-treesitter/nvim-treesitter", + version = false, -- last release is way too old and doesn't work on Windows + build = ":TSUpdate", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + { + "nvim-treesitter/nvim-treesitter-textobjects", + init = function() + -- PERF: no need to load the plugin, if we only need its queries for mini.ai + local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"] + local opts = require("lazy.core.plugin").values(plugin, "opts", false) + local enabled = false + if opts.textobjects then + for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do + if opts.textobjects[mod] and opts.textobjects[mod].enable then + enabled = true + break + end + end + end + if not enabled then + require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects") + end + end, + }, + }, + keys = { + { "", desc = "Increment selection" }, + { "", desc = "Decrement selection", mode = "x" }, + }, + ---@type TSConfig + opts = { + highlight = { enable = true, disable = ts_disable }, + indent = { enable = true }, + ensure_installed = { + "bash", + "gitignore", + "html", + "java", + "json", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "scala", + "tsx", + "typescript", + "vim", + "vimdoc", + "yaml", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }, + ---@param opts TSConfig + config = function(_, opts) + if type(opts.ensure_installed) == "table" then + ---@type table + local added = {} + opts.ensure_installed = vim.tbl_filter(function(lang) + if added[lang] then + return false + end + added[lang] = true + return true + end, opts.ensure_installed --[[@as string[] ]]) + end + require("nvim-treesitter.configs").setup(opts) + end, + }, + { + 'nvim-treesitter/playground', + dependencies = { "nvim-treesitter/nvim-treesitter" }, + cmd = { + 'TSPlaygroundToggle', + 'TSHighlightCapturesUnderCursor', + 'TSNodeUnderCursor', + } + }, + { + "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + cmd = { 'TSContextEnable', 'TSContextDisable', 'TSContextToggle' }, + keys = { + { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start" }, + }, + opts = { enable = true }, + config = function(_, opts) + require 'treesitter-context'.setup(opts) + vim.api.nvim_set_hl(0, 'TreesitterContext', { bg = "#555555" }) + vim.api.nvim_set_hl(0, 'TreesitterContextLineNumber', { link = "Special" }) + end, + } } diff --git a/plugin/centerscroll.lua b/plugin/centerscroll.lua index 860d652..54202a4 100644 --- a/plugin/centerscroll.lua +++ b/plugin/centerscroll.lua @@ -6,11 +6,11 @@ vim.api.nvim_create_augroup("KeepCentered", { clear = true }) vim.api.nvim_create_autocmd("CursorMoved", { - group = "KeepCentered", - pattern = '*', - callback = function() - if vim.o.buftype == '' then - vim.cmd([[normal! zz]]) - end - end, + group = "KeepCentered", + pattern = '*', + callback = function() + if vim.o.buftype == '' then + vim.cmd([[normal! zz]]) + end + end, }) diff --git a/plugin/scaladeps.lua b/plugin/scaladeps.lua index 2291f59..e15cde5 100644 --- a/plugin/scaladeps.lua +++ b/plugin/scaladeps.lua @@ -1,7 +1,6 @@ - local sbtToScalaCLI = function() - vim.cmd[[s/\s*libraryDependencies\s*+=\s*/\/\/> using dep /]] - vim.cmd[[s/" \(%\+\) "/\=repeat(":", strlen(submatch(1)))/g]] + vim.cmd [[s/\s*libraryDependencies\s*+=\s*/\/\/> using dep /]] + vim.cmd [[s/" \(%\+\) "/\=repeat(":", strlen(submatch(1)))/g]] end vim.keymap.set("n", "dep", sbtToScalaCLI, { noremap = true, silent = true, desc = "Convert sbt dependency to Scala CLI" }) From 302df4ef17c72407db090be4546a9ac7e6263d5b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:16:38 +0100 Subject: [PATCH 51/81] Add function to jump to scss class definition from tsx --- after/ftplugin/scss.lua | 1 + after/ftplugin/typescript.lua | 56 +++++++++++++++++++++++++ lazy-lock.json | 79 +++++++++++++++++------------------ 3 files changed, 96 insertions(+), 40 deletions(-) create mode 100644 after/ftplugin/scss.lua diff --git a/after/ftplugin/scss.lua b/after/ftplugin/scss.lua new file mode 100644 index 0000000..99e3338 --- /dev/null +++ b/after/ftplugin/scss.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "s", function() require('nvim-quick-switcher').toggle('tsx', 'scss') end, { buffer = true }) diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua index e5ad9bf..2fb23d6 100644 --- a/after/ftplugin/typescript.lua +++ b/after/ftplugin/typescript.lua @@ -2,3 +2,59 @@ vim.keymap.set("n", "o", function() vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) end, { desc = "Organize imports" } ) +vim.keymap.set("n", "s", function() require('nvim-quick-switcher').toggle('tsx', 'scss') end, { buffer = true }) + +local function goToCSSClassDefinition() + local node = vim.treesitter.get_node() + if not node then return false end + + local parent = node:parent() + if not parent then return false end + + local grandparent = parent:parent() + if not grandparent then return false end + + local className + if node:type() == "string_fragment" and grandparent:type() == "jsx_attribute" and vim.treesitter.get_node_text(grandparent:named_child(0), 0) == "className" then + className = vim.treesitter.get_node_text(node, 0) + elseif parent:type() == "jsx_attribute" and vim.treesitter.get_node_text(parent:named_child(0), 0) == "className" then + className = vim.treesitter.get_node_text(parent:named_child(1):named_child(0), 0) + elseif node:type() == "jsx_attribute" and vim.treesitter.get_node_text(node:named_child(0), 0) == "className" then + className = vim.treesitter.get_node_text(node:named_child(1):named_child(0), 0) + end + + if className then + require('nvim-quick-switcher').toggle('tsx', 'scss', { only_existing = true }) + local query = vim.treesitter.query.parse("scss", "((class_name) @cn (#eq? @cn \"" .. className .. "\"))") + local tree = vim.treesitter.get_node():tree() + vim.fn.setqflist({}) + local start, _, stop, _ = tree:root():range() + local anyMatch = false + for _, match, _ in query:iter_matches(tree:root(), 0, start, stop) do + anyMatch = true + for _, node in pairs(match) do + local row, col = node:start() + vim.api.nvim_win_set_cursor(0, { row + 1, col }) + vim.fn.setqflist({ { + lnum = row + 1, + col = col + 1, + text = "class selector: " .. className, + filename = vim.fn.expand('%:p'), + bufnr = vim.fn.bufnr('%'), + } }, 'a') + end + end + if not anyMatch then + require('nvim-quick-switcher').toggle('tsx', 'scss', { only_existing = true }) + end + return true + end + return false +end + +vim.api.nvim_create_autocmd("LspAttach", { + callback = function() + vim.keymap.set("n", "gd", function() if not goToCSSClassDefinition() then require('telescope.builtin').lsp_definitions() end end, + { buffer = true }) + end +}) diff --git a/lazy-lock.json b/lazy-lock.json index e75f5f9..2488756 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,72 +1,72 @@ { - "LuaSnip": { "branch": "master", "commit": "6a001360cea89df50f7c5cc8c7a75e6a21f1ef5c" }, + "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, - "bluloco.nvim": { "branch": "main", "commit": "efd790d690febdab74d8d012b6109e490a2db68d" }, + "bluloco.nvim": { "branch": "main", "commit": "c585fa3b1b892453b1f68df4c52b4f684a7ed7fe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "38a41d0d78f8823cc144c99784528b9a68bdd608" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "8b7ae53d7f04f33be3439a441db8071c96092d19" }, + "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, + "gen.nvim": { "branch": "main", "commit": "85a739cea06148a56d52f26b01d63de6671ce4ce" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, - "gitv": { "branch": "master", "commit": "a73599c34202709eaa7da78f4fe32b97c6ef83f8" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "0a0dd1baf1bb9415e3358207b6ab35747fb5f3ba" }, - "indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, - "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "hover.nvim": { "branch": "main", "commit": "1084aa544477cf878d466cacaec0d8d4692c7360" }, + "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, + "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" }, - "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, - "lush.nvim": { "branch": "main", "commit": "f76741886b356586f9dfe8e312fbd1ab0fd1084f" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, - "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, - "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, - "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-dap": { "branch": "master", "commit": "bbe2c6f3438542a37cc2141a8e385f7dfe07d87d" }, - "nvim-genghis": { "branch": "main", "commit": "884d98393d434e8e284bb7b32a9144b3dc6823e1" }, - "nvim-jdtls": { "branch": "master", "commit": "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8" }, - "nvim-lint": { "branch": "master", "commit": "849ccb610de3f6ce1a239ea1e68568ef1a53d5df" }, - "nvim-lspconfig": { "branch": "master", "commit": "f451052bd6804e9e5ccd0ac874d7df8d3d4c55b9" }, - "nvim-metals": { "branch": "main", "commit": "826b7542b8bccf9a120d1c613481fb0496f93724" }, - "nvim-treesitter": { "branch": "master", "commit": "42381aae7c1f785e4658cdb34a750be9851ba9af" }, - "nvim-treesitter-context": { "branch": "master", "commit": "cfa8ee19ac9bae9b7fb2958eabe2b45b70c56ccb" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, - "nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" }, + "lsp_signature.nvim": { "branch": "master", "commit": "e92b4e7073345b2a30a56b20db3d541a9aa2771e" }, + "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" }, + "lush.nvim": { "branch": "main", "commit": "2e8d34e748642621d761a65e3c2a198154b914e8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, + "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "neoconf.nvim": { "branch": "main", "commit": "db1d1bd45f4e91da6abc898281711fa47eda0ece" }, + "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, + "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, + "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, + "nvim-lint": { "branch": "master", "commit": "e824adb9bc01647f71e55457353a68f0f37f9931" }, + "nvim-lspconfig": { "branch": "master", "commit": "94cf4adb81158817520e18d2174963d8e1424df9" }, + "nvim-metals": { "branch": "main", "commit": "4f9bf0c821092f20dd34c1a4ea5b07b0500ff089" }, + "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, + "nvim-treesitter": { "branch": "master", "commit": "57205313dda0ac82ac69e21d5e2a80f3297c14cc" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" }, + "telescope.nvim": { "branch": "master", "commit": "7472420f8734c710bd7009081cef9b97f08a3821" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, - "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, + "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, + "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, - "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, + "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, - "vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" }, - "vim-kitty": { "branch": "main", "commit": "891475671feebc4bf0f29f0a0987067913a81686" }, + "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, + "vim-kitty": { "branch": "main", "commit": "dc5086d4bdd3cc99133015dad0a1f1b3b61f5aaf" }, "vim-ledger": { "branch": "master", "commit": "281346a221434574dd7f8767a352b2bf0b218b74" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, - "vim-pandoc": { "branch": "master", "commit": "84ff781925a28346df99d3764ec697c3088862a7" }, + "vim-pandoc": { "branch": "master", "commit": "fae27ec62606b6b914de5270985a69d1b5da1287" }, "vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" }, "vim-pass": { "branch": "master", "commit": "21062970709f72a3e5eebf6605050743de2c1d97" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, @@ -74,7 +74,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "29b6c052707b2d713fe2097cd5df54ce12ba2f90" }, + "vimtex": { "branch": "master", "commit": "a77d14b2e4391c0d3e860708bb1fd56161ab68eb" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file From 99468565f27fa28a0525082b3fab0fb4051bd0e5 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:17:00 +0100 Subject: [PATCH 52/81] update config --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f3d462c..794c233 100644 --- a/init.lua +++ b/init.lua @@ -40,6 +40,8 @@ vim.opt.timeout = false vim.opt.foldenable = false +vim.opt.diffopt:append("vertical") +vim.opt.diffopt:append("linematch:50") -- todo visualbell needed? vim.opt.shell = "/bin/zsh" @@ -47,7 +49,7 @@ vim.opt.ignorecase = true vim.opt.smartcase = true vim.opt.inccommand = "split" vim.opt.listchars = "tab:⇥\\ ,trail:-,nbsp:+,lead:␣" -vim.opt.list = true +--vim.opt.list = true vim.cmd [[hi link Whitespace Comment]] vim.opt.wildmode = { "list:longest", "list:full" } From 24ae47af7f746f74edb65a47384f17bbe40e0098 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:18:13 +0100 Subject: [PATCH 53/81] Override genghis :Trash command to use rm --- after/plugin/genghis.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 after/plugin/genghis.lua diff --git a/after/plugin/genghis.lua b/after/plugin/genghis.lua new file mode 100644 index 0000000..c9cacd0 --- /dev/null +++ b/after/plugin/genghis.lua @@ -0,0 +1 @@ +vim.api.nvim_create_user_command("Trash", function() require("genghis").trashFile({ trashCmd = "rm" }) end, { desc = "Delete current file" }) From 898639c4ea7e1bddeb6433f5e5709a8ae43d842c Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 15 Mar 2024 15:19:04 +0100 Subject: [PATCH 54/81] Add minimal WebVTT syntax file --- syntax/vtt.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 syntax/vtt.vim diff --git a/syntax/vtt.vim b/syntax/vtt.vim new file mode 100644 index 0000000..0ad221d --- /dev/null +++ b/syntax/vtt.vim @@ -0,0 +1,25 @@ +" Vim syntax file +" Language: Web Video Text Tracks Format (VTT) +" Filenames: *.vtt +" Vim syntax file +" SeeAlso: +" Maintainer: Alexander Gehrke +" Created: 2023-12-19 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn region vttComment start="^NOTE .*" end="^$" +syn match vttTimings "\d\{2}:\d\{2}\.\d\{3}" +syn match vttArrow "-->" +syn keyword vttHeader WEBVTT + +hi def link vttTimings Number +hi def link vttArrow Special +hi def link vttComment Comment +hi def link vttHeader Keyword + +let b:current_syntax = "vtt" From 0dee46da504b93946423c992c342a7e5cd8a16a1 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 22 Mar 2024 13:55:51 +0100 Subject: [PATCH 55/81] some typescript settings --- after/ftplugin/typescript.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua index 2fb23d6..ba05ac5 100644 --- a/after/ftplugin/typescript.lua +++ b/after/ftplugin/typescript.lua @@ -1,3 +1,5 @@ +vim.o.textwidth = 120 + vim.keymap.set("n", "o", function() vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) end, { desc = "Organize imports" } @@ -58,3 +60,6 @@ vim.api.nvim_create_autocmd("LspAttach", { { buffer = true }) end }) + +vim.o.foldmethod = "expr" +vim.o.foldexpr = "nvim_treesitter#foldexpr()" From 855db2feee9153702dc28f63a72394ceb467b97e Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 25 Mar 2024 14:48:17 +0100 Subject: [PATCH 56/81] update --- ftdetect/extensions.lua | 1 + lazy-lock.json | 56 ++++++++++++++++++++--------------------- plugin/on-attach.lua | 4 +++ 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua index 50ad492..5268f3f 100644 --- a/ftdetect/extensions.lua +++ b/ftdetect/extensions.lua @@ -1,6 +1,7 @@ vim.filetype.add({ extension = { ['vtt'] = 'vtt', + ['typ'] = 'typst', }, filename = { ['.scalafmt.conf'] = 'hocon', diff --git a/lazy-lock.json b/lazy-lock.json index 2488756..49f3d29 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,67 +1,67 @@ { "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, - "bluloco.nvim": { "branch": "main", "commit": "c585fa3b1b892453b1f68df4c52b4f684a7ed7fe" }, + "bluloco.nvim": { "branch": "main", "commit": "a41b4f849043dd32188e3d56758d8259e5ff7ae7" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, - "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, - "gen.nvim": { "branch": "main", "commit": "85a739cea06148a56d52f26b01d63de6671ce4ce" }, + "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, + "gen.nvim": { "branch": "main", "commit": "46ab810130097494bbcf12b1426a7166f4c2995e" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, "hover.nvim": { "branch": "main", "commit": "1084aa544477cf878d466cacaec0d8d4692c7360" }, - "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, - "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "e92b4e7073345b2a30a56b20db3d541a9aa2771e" }, + "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" }, - "lush.nvim": { "branch": "main", "commit": "2e8d34e748642621d761a65e3c2a198154b914e8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "neoconf.nvim": { "branch": "main", "commit": "db1d1bd45f4e91da6abc898281711fa47eda0ece" }, - "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, + "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, + "lush.nvim": { "branch": "main", "commit": "bc12f010b34cfeefac35720656eb777753b165d9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "neoconf.nvim": { "branch": "main", "commit": "9a419c4fa772c4c61839a8f7fdd8e863679a8c94" }, + "neodev.nvim": { "branch": "main", "commit": "6a533ed9d3435dcaa456380d833ea04da37ea2ed" }, + "nvim-cmp": { "branch": "main", "commit": "6ed1c93465c33f6a53b4c3f103bf9d1ab696382a" }, + "nvim-dap": { "branch": "master", "commit": "c1695e500c7d552a0a19953a9aefcc89178fb1af" }, "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, - "nvim-lint": { "branch": "master", "commit": "e824adb9bc01647f71e55457353a68f0f37f9931" }, - "nvim-lspconfig": { "branch": "master", "commit": "94cf4adb81158817520e18d2174963d8e1424df9" }, + "nvim-lint": { "branch": "master", "commit": "2669aabb8362fdc36aced5ba864b7135636ea863" }, + "nvim-lspconfig": { "branch": "master", "commit": "24662f92c18edd397ef12d635b11dbdedef2d094" }, "nvim-metals": { "branch": "main", "commit": "4f9bf0c821092f20dd34c1a4ea5b07b0500ff089" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "57205313dda0ac82ac69e21d5e2a80f3297c14cc" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, + "nvim-treesitter": { "branch": "master", "commit": "a951dcb7ec253544b0150251008de8b06a0874cd" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, + "nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, - "suda.vim": { "branch": "master", "commit": "8b0fc3711760195aba104e2d190cff9af8267052" }, + "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "7472420f8734c710bd7009081cef9b97f08a3821" }, + "telescope.nvim": { "branch": "master", "commit": "221778e93bfaa58bce4be4e055ed2edecc26f799" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" }, + "vim-fugitive": { "branch": "master", "commit": "193ba9b393931bad768c1d2eed688b0bcc240858" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "dc5086d4bdd3cc99133015dad0a1f1b3b61f5aaf" }, + "vim-kitty": { "branch": "main", "commit": "4f3f2901717320f80a1e16a868f706762be8535b" }, "vim-ledger": { "branch": "master", "commit": "281346a221434574dd7f8767a352b2bf0b218b74" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, @@ -74,6 +74,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "a77d14b2e4391c0d3e860708bb1fd56161ab68eb" }, + "vimtex": { "branch": "master", "commit": "73605f8b7655301ea47a2c355500ab4984f41b91" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 73da198..21b018c 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -32,6 +32,10 @@ local on_attach = function(args) { "dso", function() require("dap").step_over() end, "Debug: Step over" }, { "dsi", function() require("dap").step_into() end, "Debug: Step into" }, { "dl", function() require("dap").run_last() end, "Debug: Run last" }, + { "", function() require("dap").continue() end, "Debug: Continue" }, + { "", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, + { "", function() require("dap").step_over() end, "Debug: Step over" }, + { "", function() require("dap").step_into() end, "Debug: Step into" }, { "aa", vim.diagnostic.setqflist, "Add all diagnostics to quickfix list" }, { "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, "Add all warnings to quickfix list" }, { "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, "Add all errors to quickfix list" }, From b1e951ef1df095668d74c4bfe8d29ce43ed5f2b6 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 4 Apr 2024 18:18:22 +0200 Subject: [PATCH 57/81] Use conform.nvim for fold-preserving formatting --- after/ftplugin/scala.vim | 4 ++++ lazy-lock.json | 2 +- lua/plugins/conform.lua | 37 +++++++++++++++++++++++++++++++++++++ lua/plugins/exttools.lua | 8 -------- plugin/on-attach.lua | 18 ++++++++++-------- 5 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 lua/plugins/conform.lua diff --git a/after/ftplugin/scala.vim b/after/ftplugin/scala.vim index 60759ed..ba52db4 100644 --- a/after/ftplugin/scala.vim +++ b/after/ftplugin/scala.vim @@ -3,3 +3,7 @@ map cl :call jobstart(['codelines', '.']) set tw=120 set foldlevel=99 + +set foldmethod=indent +"set foldmethod=expr +"set foldexpr=nvim_treesitter#foldexpr() diff --git a/lazy-lock.json b/lazy-lock.json index 49f3d29..1e2486c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,11 +7,11 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, - "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, "gen.nvim": { "branch": "main", "commit": "46ab810130097494bbcf12b1426a7166f4c2995e" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..e1683db --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,37 @@ +return { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + -- Customize or remove this keymap to your liking + "f", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = "", + desc = "Format buffer", + }, + }, + -- Everything in opts will be passed to setup() + opts = { + -- Define your formatters + formatters_by_ft = { + lua = { "stylua" }, + python = { "isort", "black" }, + javascript = { { "prettierd", "prettier" } }, + }, + -- Set up format-on-save + format_on_save = { timeout_ms = 500, lsp_fallback = true }, + -- Customize formatters + formatters = { + shfmt = { + prepend_args = { "-i", "2" }, + }, + }, + }, + init = function() + -- If you want the formatexpr, here is the place to set it + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + end, +} diff --git a/lua/plugins/exttools.lua b/lua/plugins/exttools.lua index f288631..583154d 100644 --- a/lua/plugins/exttools.lua +++ b/lua/plugins/exttools.lua @@ -1,11 +1,3 @@ return { 'mfussenegger/nvim-lint', - { - 'mhartington/formatter.nvim', - opts = function() - return { - - } - end - } } diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 21b018c..1e45654 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -10,7 +10,7 @@ local on_attach = function(args) -- -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions + -- stylua: ignore start for _, mapping in ipairs({ { 'gD', vim.lsp.buf.declaration, "Go to declaration" }, { 'gd', require('telescope.builtin').lsp_definitions, "Go to definition" }, @@ -25,29 +25,31 @@ local on_attach = function(args) { '[d', vim.diagnostic.goto_prev, "Go to previous diagnostic" }, { '[d', vim.diagnostic.goto_prev, "Go to next diagnostic" }, { '', vim.diagnostic.setloclist, "Add buffer diagnostics to location list" }, - { "f", function() vim.lsp.buf.format { async = true } end, "Format buffer" }, { "dc", function() require("dap").continue() end, "Debug: Continue" }, { "dK", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, { "dt", function() require("dap").toggle_breakpoint() end, "Debug: Toggle breakpoint" }, { "dso", function() require("dap").step_over() end, "Debug: Step over" }, { "dsi", function() require("dap").step_into() end, "Debug: Step into" }, { "dl", function() require("dap").run_last() end, "Debug: Run last" }, - { "", function() require("dap").continue() end, "Debug: Continue" }, - { "", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, + { "", function() require("dap").continue() end, "Debug: Continue" }, + { "", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, { "", function() require("dap").step_over() end, "Debug: Step over" }, { "", function() require("dap").step_into() end, "Debug: Step into" }, { "aa", vim.diagnostic.setqflist, "Add all diagnostics to quickfix list" }, { "aw", function() vim.diagnostic.setqflist({ severity = "W" }) end, "Add all warnings to quickfix list" }, { "ae", function() vim.diagnostic.setqflist({ severity = "E" }) end, "Add all errors to quickfix list" }, }) do - vim.keymap.set('n', mapping[1], mapping[2], { silent = true, buffer = args.buf, desc = mapping[3] }) + vim.keymap.set("n", mapping[1], mapping[2], { silent = true, buffer = args.buf, desc = mapping[3] }) end + -- stylua: ignore end - vim.keymap.set("n", "dr", function() require("dap").repl.toggle() end, { silent = true, desc = "Toogle debug REPL" }) + vim.keymap.set("n", "dr", function() + require("dap").repl.toggle() + end, { silent = true, desc = "Toogle debug REPL" }) if client.server_capabilities.signatureHelpProvider then - vim.cmd [[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]] - vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]] + vim.cmd([[autocmd CursorHoldI * silent! lua vim.lsp.buf.signature_help()]]) + vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float({max_width = 100, focusable = false})]]) end if client.server_capabilities.documentHighlightingProvider then From 05638653606e3135e734c9ea2bbd6e232b8c7ea3 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 11 Apr 2024 20:03:52 +0200 Subject: [PATCH 58/81] default to treesitter foldexpr --- init.lua | 4 +++- lua/plugins/conform.lua | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 794c233..17579ac 100644 --- a/init.lua +++ b/init.lua @@ -38,7 +38,9 @@ vim.opt.whichwrap = "b,s,<,>,[,],h,l" vim.opt.timeout = false -vim.opt.foldenable = false +vim.opt.foldmethod = "expr" +vim.opt.foldlevel = 99 +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.diffopt:append("vertical") vim.opt.diffopt:append("linematch:50") diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index e1683db..44487d1 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -30,8 +30,4 @@ return { }, }, }, - init = function() - -- If you want the formatexpr, here is the place to set it - vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" - end, } From 2c0362678fd8ec9e1298a48bda0a15812e092cfd Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 11 Apr 2024 20:06:27 +0200 Subject: [PATCH 59/81] plugin stuff --- init.lua | 92 +++++++++++++++++++++++--------------- lua/plugins/init.lua | 76 +++++++++++++------------------ lua/plugins/treesitter.lua | 62 ++++++++++++++++++------- lua/plugins/vimtex.lua | 9 ++++ lua/plugins/which-key.lua | 9 ++++ 5 files changed, 152 insertions(+), 96 deletions(-) create mode 100644 lua/plugins/vimtex.lua create mode 100644 lua/plugins/which-key.lua diff --git a/init.lua b/init.lua index 17579ac..d540976 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,4 @@ -if vim.env['VIRTUAL_ENV'] ~= nil then +if vim.env["VIRTUAL_ENV"] ~= nil then vim.g.python3_host_prog = vim.fn.system("which -a python3 | sed -n 2p | tr -d '\n'") else vim.g.python3_host_prog = vim.fn.system("which python3 | tr -d '\n'") @@ -21,8 +21,8 @@ require("lazy").setup("plugins", { dev = { path = "~/projects/nvim/", patterns = { "crater2150" }, - fallback = true - } + fallback = true, + }, }) vim.opt.background = "dark" @@ -52,22 +52,36 @@ vim.opt.smartcase = true vim.opt.inccommand = "split" vim.opt.listchars = "tab:⇥\\ ,trail:-,nbsp:+,lead:␣" --vim.opt.list = true -vim.cmd [[hi link Whitespace Comment]] +vim.cmd([[hi link Whitespace Comment]]) vim.opt.wildmode = { "list:longest", "list:full" } vim.opt.wildignore = { "*.so", "*.swp", "*.zip", "*.o" } vim.opt.suffixes = { - ".bak", "~", ".h", ".info", ".swp", ".obj", ".info", ".aux", ".dvi", ".bbl", ".out", ".o", ".lo", - "\\.class", ".pdf" } + ".bak", + "~", + ".h", + ".info", + ".swp", + ".obj", + ".info", + ".aux", + ".dvi", + ".bbl", + ".out", + ".o", + ".lo", + "\\.class", + ".pdf", +} vim.opt.completeopt = "menu,menuone,noselect" -vim.opt.mouse = '' +vim.opt.mouse = "" vim.opt.shortmess = vim.o.shortmess .. "c" vim.opt.cursorline = true vim.opt.undofile = true -vim.opt.spelllang = 'de,en' +vim.opt.spelllang = "de,en" vim.opt.termguicolors = true vim.opt.pumblend = 10 @@ -75,44 +89,48 @@ vim.opt.pumblend = 10 vim.opt.updatetime = 300 local command = vim.api.nvim_create_user_command -local initlua = vim.fn.stdpath('config') .. '/init.lua' -command('RC', function() vim.cmd.edit(initlua) end, { desc = 'edit init.lua' }) -command('CD', ':cd %:h', { desc = 'cd to current file' }) -command('TrailingSpace', '%s/\\s*$//g', { desc = 'remove trailing spaces' }) +local initlua = vim.fn.stdpath("config") .. "/init.lua" +command("RC", function() + vim.cmd.edit(initlua) +end, { desc = "edit init.lua" }) +command("CD", ":cd %:h", { desc = "cd to current file" }) +command("TrailingSpace", "%s/\\s*$//g", { desc = "remove trailing spaces" }) -vim.g.tex_flavor = 'latex' +vim.g.tex_flavor = "latex" local key = vim.keymap.set -key('n', '', 'za', { desc = 'toggle fold' }) -key('v', '.', 'normal .', { desc = 'repeat last command in visual mode' }) -key('n', 'cy', '"*y', { desc = 'copy to system clipboard' }) +key("n", "", "za", { desc = "toggle fold" }) +key("v", ".", "normal .", { desc = "repeat last command in visual mode" }) +key("n", "cy", '"*y', { desc = "copy to system clipboard" }) -key('t', '', '', { desc = 'exit terminal mode' }) +key("t", "", "", { desc = "exit terminal mode" }) -- Arrow keys for window movement and resizing -key('n', '', 'h') -key('n', '', 'j') -key('n', '', 'k') -key('n', '', 'l') +key("n", "", "h") +key("n", "", "j") +key("n", "", "k") +key("n", "", "l") -- -key('n', '', "<") -key('n', '', ">") -key('n', '', "-") -key('n', '', "+") +key("n", "", "<") +key("n", "", ">") +key("n", "", "-") +key("n", "", "+") -key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' }) -key('n', '', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' }) +key("n", "", function() + vim.fn.search("^[^[:space:])\\]}]", "be") +end, { desc = "jump to previous unindented line" }) +key("n", "", function() + vim.fn.search("^[^[:space:])\\]}]", "e") +end, { desc = "jump to next unindented line" }) -key('i', '', 'u') -key('n', '&', ':&&') -key('x', '&', ':&&') -key('n', 'Y', 'y$') +key("i", "", "u") +key("n", "&", ":&&") +key("x", "&", ":&&") +key("n", "Y", "y$") +key("i", "", "", { desc = "completion" }) +key("n", "", "nohredraw!", { desc = "clear search highlight" }) +key("v", "gs", "'<,'>sort", { desc = "sort selection" }) -key('i', '', '', { desc = 'completion' }) -key('n', '', 'nohredraw!', { desc = 'clear search highlight' }) -key('v', 'gs', "'<,'>sort", { desc = 'sort selection' }) - - -key({ 'n', 'x' }, '', "(EasyAlign)", { desc = 'align selection' }) +key({ "n", "x" }, "", "(EasyAlign)", { desc = "align selection" }) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e2449dd..fd92acd 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,63 +1,51 @@ return { - "folke/which-key.nvim", - 'pbrisbin/vim-mkdir', - 'fladson/vim-kitty', - 'tpope/vim-repeat', - 'tpope/vim-surround', - 'tpope/vim-characterize', - 'tpope/vim-commentary', - 'tpope/vim-sleuth', + "pbrisbin/vim-mkdir", + "fladson/vim-kitty", + "tpope/vim-repeat", + "tpope/vim-surround", + "tpope/vim-characterize", + "tpope/vim-commentary", { "chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim" }, -- ic / ac { - 'glts/vim-textobj-comment', - dependencies = { 'kana/vim-textobj-user' } + "glts/vim-textobj-comment", + dependencies = { "kana/vim-textobj-user" }, }, -- ii / ai - 'michaeljsmith/vim-indent-object', - 'neovim/nvim-lspconfig', + "michaeljsmith/vim-indent-object", + "neovim/nvim-lspconfig", { - 'nvim-telescope/telescope.nvim', - dependencies = { 'nvim-lua/plenary.nvim' } + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, }, { - 'ray-x/lsp_signature.nvim', + "ray-x/lsp_signature.nvim", config = function() - require('lsp_signature').setup({}) - end - }, - 'kyazdani42/nvim-web-devicons', - 'folke/trouble.nvim', - 'folke/lsp-colors.nvim', - 'nvim-lua/popup.nvim', - 'junegunn/vim-easy-align', - 'machakann/vim-highlightedyank', - 'lambdalisue/suda.vim', - 'jamessan/vim-gnupg', - - { - 'lervag/vimtex', - init = function() - vim.g.tex_conceal = "agm" - vim.g.vimtex_quickfix_ignorefilters = { 'overfull', 'underfull' } - vim.g.vimtex_syntax_enabled = 0 + require("lsp_signature").setup({}) end, - ft = "tex", }, - 'ledger/vim-ledger', - 'anekos/hledger-vim', + "kyazdani42/nvim-web-devicons", + "folke/trouble.nvim", + "folke/lsp-colors.nvim", + "nvim-lua/popup.nvim", + "junegunn/vim-easy-align", + "machakann/vim-highlightedyank", + "lambdalisue/suda.vim", + "jamessan/vim-gnupg", + "ledger/vim-ledger", + "anekos/hledger-vim", - 'vim-pandoc/vim-pandoc', - 'vim-pandoc/vim-pandoc-syntax', - 'isobit/vim-caddyfile', - 'Glench/Vim-Jinja2-Syntax', - 'GEverding/vim-hocon', - 'nfnty/vim-nftables', - 'nfnty/vim-nftables', - 'Everduin94/nvim-quick-switcher', + "vim-pandoc/vim-pandoc", + "vim-pandoc/vim-pandoc-syntax", + "isobit/vim-caddyfile", + "Glench/Vim-Jinja2-Syntax", + "GEverding/vim-hocon", + "nfnty/vim-nftables", + "nfnty/vim-nftables", + "Everduin94/nvim-quick-switcher", } -- 'powerman/vim-plugin-AnsiEsc', diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ca161a6..51fc43f 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -5,7 +5,7 @@ end return { { "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows + version = false, build = ":TSUpdate", event = { "BufReadPost", "BufNewFile" }, dependencies = { @@ -32,10 +32,11 @@ return { }, keys = { { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, + { "", desc = "Decrement selection", mode = "x" }, }, - ---@type TSConfig opts = { + auto_install = true, + ignore_install = {}, highlight = { enable = true, disable = ts_disable }, indent = { enable = true }, ensure_installed = { @@ -68,6 +69,36 @@ return { node_decremental = "", }, }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + -- stylua: ignore start + ["af"] = { query = "@function.outer", desc = "outer function" }, + ["if"] = { query = "@function.inner", desc = "inner function" }, + ["ac"] = { query = "@class.outer", desc = "outer class" }, + ["ic"] = { query = "@class.inner", desc = "inner class" }, + ["ap"] = { query = "@parameter.outer", desc = "outer parameter" }, + ["ip"] = { query = "@parameter.inner", desc = "inner parameter" }, + -- stylua: ignore end + }, + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + ["@class.outer"] = "V", + }, + }, + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["A"] = "@parameter.inner", + }, + }, + }, }, ---@param opts TSConfig config = function(_, opts) @@ -86,28 +117,29 @@ return { end, }, { - 'nvim-treesitter/playground', + "nvim-treesitter/playground", dependencies = { "nvim-treesitter/nvim-treesitter" }, cmd = { - 'TSPlaygroundToggle', - 'TSHighlightCapturesUnderCursor', - 'TSNodeUnderCursor', - } + "TSPlaygroundToggle", + "TSHighlightCapturesUnderCursor", + "TSNodeUnderCursor", + }, }, { "nvim-treesitter/nvim-treesitter-context", event = "VeryLazy", dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = { 'TSContextEnable', 'TSContextDisable', 'TSContextToggle' }, + cmd = { "TSContextEnable", "TSContextDisable", "TSContextToggle" }, keys = { - { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start" }, + -- stylua: ignore start + { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start", }, + -- stylua: ignore end }, opts = { enable = true }, config = function(_, opts) - require 'treesitter-context'.setup(opts) - vim.api.nvim_set_hl(0, 'TreesitterContext', { bg = "#555555" }) - vim.api.nvim_set_hl(0, 'TreesitterContextLineNumber', { link = "Special" }) + require("treesitter-context").setup(opts) + vim.api.nvim_set_hl(0, "TreesitterContext", { bg = "#555555" }) + vim.api.nvim_set_hl(0, "TreesitterContextLineNumber", { link = "Special" }) end, - } - + }, } diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua new file mode 100644 index 0000000..b675f73 --- /dev/null +++ b/lua/plugins/vimtex.lua @@ -0,0 +1,9 @@ +return { + "lervag/vimtex", + init = function() + vim.g.tex_conceal = "agm" + vim.g.vimtex_quickfix_ignorefilters = { "overfull", "underfull" } + vim.g.vimtex_syntax_enabled = 0 + end, + ft = "tex", +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..183fcb3 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,9 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = {}, +} From 8798045ac270291c117b6e5434ba3a1d9e85df24 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 17 Apr 2024 16:55:32 +0200 Subject: [PATCH 60/81] Enable timeout for WhichKey --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index d540976..7360cbe 100644 --- a/init.lua +++ b/init.lua @@ -36,7 +36,7 @@ vim.opt.shiftwidth = 2 vim.opt.whichwrap = "b,s,<,>,[,],h,l" -vim.opt.timeout = false +--vim.opt.timeout = false vim.opt.foldmethod = "expr" vim.opt.foldlevel = 99 From 3219ec838fe984a9f4e8928f6293477fab980da1 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 25 Mar 2024 14:49:17 +0100 Subject: [PATCH 61/81] updates --- lazy-lock.json | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 1e2486c..db11ff0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -18,7 +18,7 @@ "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, "hover.nvim": { "branch": "main", "commit": "1084aa544477cf878d466cacaec0d8d4692c7360" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" }, + "lazy.nvim": { "branch": "main", "commit": "08954f723bf2d442ea020551e3acc956f4dc6dc7" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, @@ -29,27 +29,27 @@ "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "neoconf.nvim": { "branch": "main", "commit": "9a419c4fa772c4c61839a8f7fdd8e863679a8c94" }, "neodev.nvim": { "branch": "main", "commit": "6a533ed9d3435dcaa456380d833ea04da37ea2ed" }, - "nvim-cmp": { "branch": "main", "commit": "6ed1c93465c33f6a53b4c3f103bf9d1ab696382a" }, + "nvim-cmp": { "branch": "main", "commit": "97dc716fc914c46577a4f254035ebef1aa72558a" }, "nvim-dap": { "branch": "master", "commit": "c1695e500c7d552a0a19953a9aefcc89178fb1af" }, "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, "nvim-lint": { "branch": "master", "commit": "2669aabb8362fdc36aced5ba864b7135636ea863" }, - "nvim-lspconfig": { "branch": "master", "commit": "24662f92c18edd397ef12d635b11dbdedef2d094" }, + "nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" }, "nvim-metals": { "branch": "main", "commit": "4f9bf0c821092f20dd34c1a4ea5b07b0500ff089" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "a951dcb7ec253544b0150251008de8b06a0874cd" }, + "nvim-treesitter": { "branch": "master", "commit": "20042941df6c014f611e948cd656afd482823d81" }, "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, - "nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" }, + "nvim-web-devicons": { "branch": "master", "commit": "6662f059bf78e6092ba90cd1929599625f448f55" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "221778e93bfaa58bce4be4e055ed2edecc26f799" }, + "telescope.nvim": { "branch": "master", "commit": "c2b8311dfacd08b3056b8f0249025d633a4e71a8" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, @@ -74,6 +74,7 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, + "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, "vimtex": { "branch": "master", "commit": "73605f8b7655301ea47a2c355500ab4984f41b91" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file From 7f9b25ac217082dcc7c44c7b182614a7c96827db Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 19 Apr 2024 11:57:31 +0200 Subject: [PATCH 62/81] formatter --- lua/plugins/exttools.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/exttools.lua b/lua/plugins/exttools.lua index 583154d..c7d513a 100644 --- a/lua/plugins/exttools.lua +++ b/lua/plugins/exttools.lua @@ -1,3 +1,3 @@ return { - 'mfussenegger/nvim-lint', + "mfussenegger/nvim-lint", } From eaaabbf2cde80ca18c30f0b5744e6718974e2b4b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 19 Apr 2024 12:00:16 +0200 Subject: [PATCH 63/81] Plugin updates --- lazy-lock.json | 57 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index db11ff0..6a59b1c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,5 @@ { - "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "bluloco.nvim": { "branch": "main", "commit": "a41b4f849043dd32188e3d56758d8259e5ff7ae7" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -7,55 +7,55 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, + "conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, - "gen.nvim": { "branch": "main", "commit": "46ab810130097494bbcf12b1426a7166f4c2995e" }, + "gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, + "gitsigns.nvim": { "branch": "main", "commit": "7e38f07cab0e5387f9f41e92474db174a63a4725" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, "hover.nvim": { "branch": "main", "commit": "1084aa544477cf878d466cacaec0d8d4692c7360" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "08954f723bf2d442ea020551e3acc956f4dc6dc7" }, + "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, - "lush.nvim": { "branch": "main", "commit": "bc12f010b34cfeefac35720656eb777753b165d9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "neoconf.nvim": { "branch": "main", "commit": "9a419c4fa772c4c61839a8f7fdd8e863679a8c94" }, - "neodev.nvim": { "branch": "main", "commit": "6a533ed9d3435dcaa456380d833ea04da37ea2ed" }, - "nvim-cmp": { "branch": "main", "commit": "97dc716fc914c46577a4f254035ebef1aa72558a" }, - "nvim-dap": { "branch": "master", "commit": "c1695e500c7d552a0a19953a9aefcc89178fb1af" }, - "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, + "neoconf.nvim": { "branch": "main", "commit": "a7da418753379af428f5d26ac91aa6fc18baf86e" }, + "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, + "nvim-genghis": { "branch": "main", "commit": "1e6855be88e2266c612903dbc337222b59a06e44" }, "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, - "nvim-lint": { "branch": "master", "commit": "2669aabb8362fdc36aced5ba864b7135636ea863" }, - "nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" }, + "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lspconfig": { "branch": "master", "commit": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5" }, "nvim-metals": { "branch": "main", "commit": "4f9bf0c821092f20dd34c1a4ea5b07b0500ff089" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "20042941df6c014f611e948cd656afd482823d81" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, - "nvim-web-devicons": { "branch": "master", "commit": "6662f059bf78e6092ba90cd1929599625f448f55" }, + "nvim-treesitter": { "branch": "master", "commit": "fea5808a58dc00b7131163886fe2648bbcae9dff" }, + "nvim-treesitter-context": { "branch": "master", "commit": "e6e71047bb323fb36f5664993a42adaac252bb36" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, + "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "shipwright.nvim": { "branch": "master", "commit": "ab70e80bb67b7ed3350bec89dd73473539893932" }, + "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, - "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, + "suda.vim": { "branch": "master", "commit": "04469d855e36fffcda6be036eb7ff005f64fa0d6" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "c2b8311dfacd08b3056b8f0249025d633a4e71a8" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, - "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, - "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "193ba9b393931bad768c1d2eed688b0bcc240858" }, + "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, + "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, @@ -68,13 +68,12 @@ "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, "vim-pandoc": { "branch": "master", "commit": "fae27ec62606b6b914de5270985a69d1b5da1287" }, "vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" }, - "vim-pass": { "branch": "master", "commit": "21062970709f72a3e5eebf6605050743de2c1d97" }, + "vim-pass": { "branch": "master", "commit": "71adc31459d2ebd5d51c9d8214b111be8c86b833" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "73605f8b7655301ea47a2c355500ab4984f41b91" }, + "vimtex": { "branch": "master", "commit": "4a0ea3fc7eb67fd1949aba6a9bbd91cb5c875743" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file From b40055513b7835c6d78d0576b6fdc3fe6ae6f674 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 29 Apr 2024 11:50:29 +0200 Subject: [PATCH 64/81] Disable pandoc for now --- lua/plugins/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index fd92acd..dc02e37 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -39,8 +39,8 @@ return { "ledger/vim-ledger", "anekos/hledger-vim", - "vim-pandoc/vim-pandoc", - "vim-pandoc/vim-pandoc-syntax", + --"vim-pandoc/vim-pandoc", + --"vim-pandoc/vim-pandoc-syntax", "isobit/vim-caddyfile", "Glench/Vim-Jinja2-Syntax", "GEverding/vim-hocon", From 8725cbfe5453f46d01e7679afb26b9ee2bca9505 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 3 May 2024 11:41:47 +0200 Subject: [PATCH 65/81] Update plugins --- lazy-lock.json | 48 +++++++++++++++++++-------------------- lua/plugins/telescope.lua | 7 +++--- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 6a59b1c..524e351 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,5 @@ { - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "bluloco.nvim": { "branch": "main", "commit": "a41b4f849043dd32188e3d56758d8259e5ff7ae7" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -7,73 +7,71 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" }, + "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "7e38f07cab0e5387f9f41e92474db174a63a4725" }, + "gitsigns.nvim": { "branch": "main", "commit": "9cafac31a091267838e1e90fd6e083d37611f516" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "1084aa544477cf878d466cacaec0d8d4692c7360" }, + "hover.nvim": { "branch": "main", "commit": "ebdc4c0f967bb36b70bb27763397dd71064c2067" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "neoconf.nvim": { "branch": "main", "commit": "a7da418753379af428f5d26ac91aa6fc18baf86e" }, + "neoconf.nvim": { "branch": "main", "commit": "d4a48c2a6fdeec138605cee4eb6f8c6fafd0b3ed" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, - "nvim-genghis": { "branch": "main", "commit": "1e6855be88e2266c612903dbc337222b59a06e44" }, + "nvim-genghis": { "branch": "main", "commit": "01eeb090ea4947df6b6b9d8589b324b9f1aaf851" }, "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, - "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, - "nvim-lspconfig": { "branch": "master", "commit": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5" }, - "nvim-metals": { "branch": "main", "commit": "4f9bf0c821092f20dd34c1a4ea5b07b0500ff089" }, + "nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, + "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, + "nvim-metals": { "branch": "main", "commit": "c6268555d0b471262af78818f11a086ddf30688b" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "fea5808a58dc00b7131163886fe2648bbcae9dff" }, - "nvim-treesitter-context": { "branch": "master", "commit": "e6e71047bb323fb36f5664993a42adaac252bb36" }, + "nvim-treesitter": { "branch": "master", "commit": "c0c32abc51181d735e24c93991324050b28429de" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, - "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, - "suda.vim": { "branch": "master", "commit": "04469d855e36fffcda6be036eb7ff005f64fa0d6" }, + "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, + "telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "vim-fugitive": { "branch": "master", "commit": "ce882460cf3db12e99f8bf579cbf99e331f6dd4f" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, "vim-kitty": { "branch": "main", "commit": "4f3f2901717320f80a1e16a868f706762be8535b" }, - "vim-ledger": { "branch": "master", "commit": "281346a221434574dd7f8767a352b2bf0b218b74" }, + "vim-ledger": { "branch": "master", "commit": "58561ed511753c4ef0fd446010daa1c2b7979d42" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, - "vim-pandoc": { "branch": "master", "commit": "fae27ec62606b6b914de5270985a69d1b5da1287" }, - "vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" }, "vim-pass": { "branch": "master", "commit": "71adc31459d2ebd5d51c9d8214b111be8c86b833" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "4a0ea3fc7eb67fd1949aba6a9bbd91cb5c875743" }, + "vimtex": { "branch": "master", "commit": "e4e659b088a082f6b7bb895ccbefb1f96a5b2710" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 5579eb0..1df1a0f 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -2,11 +2,10 @@ return { "nvim-telescope/telescope.nvim", dependencies = { { - 'nvim-telescope/telescope-fzf-native.nvim', - build = - 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', + "nvim-telescope/telescope-fzf-native.nvim", + build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", }, - 'gbrlsnchs/telescope-lsp-handlers.nvim', + "gbrlsnchs/telescope-lsp-handlers.nvim", }, cmd = "Telescope", version = false, From 80cbab3afb4a86014f700ab09839ae29988db6ff Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 3 May 2024 11:46:25 +0200 Subject: [PATCH 66/81] Add findroot function for selecting telescope file search base dir --- lua/findroot.lua | 50 +++++++++++++++++++++++++++++++++++++++ lua/plugins/luadev.lua | 3 +++ lua/plugins/telescope.lua | 46 +++++++++++++++++++---------------- 3 files changed, 79 insertions(+), 20 deletions(-) create mode 100644 lua/findroot.lua create mode 100644 lua/plugins/luadev.lua diff --git a/lua/findroot.lua b/lua/findroot.lua new file mode 100644 index 0000000..a301dec --- /dev/null +++ b/lua/findroot.lua @@ -0,0 +1,50 @@ +local Path = require("plenary.path") +local source_basedir_markers = { + ".telescope-root", + ".editorconfig", + "build.sbt", + "package.json", + "setup.py", + ".git", +} +function find_upwards_any(base, filenames) + local folder = Path:new(base) + local root = Path.path.root(folder) + + while folder:absolute() ~= root do + for _, filename in ipairs(filenames) do + local p = folder:joinpath(filename) + if p:exists() then + return p + end + end + folder = folder:parent() + end + return "" +end + +local function find_dir(base) + print("base: ", base) + if base == nil then + base = vim.loop.cwd() + end + --@type Path + local search_root + search_root = find_upwards_any(base, source_basedir_markers) + print("search_root: ", search_root) + if search_root ~= "" then + local file = search_root:_split() + if file[#file] == ".telescope-root" then + local target = search_root:parent():joinpath(search_root:head(1)) + if target:exists() then + return tostring(target) + end + else + return tostring(search_root:parent()) + end + else + return base + end +end + +return find_dir diff --git a/lua/plugins/luadev.lua b/lua/plugins/luadev.lua new file mode 100644 index 0000000..bac9479 --- /dev/null +++ b/lua/plugins/luadev.lua @@ -0,0 +1,3 @@ +return { + "bfredl/nvim-luadev", +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 1df1a0f..f3c210d 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -12,21 +12,28 @@ return { keys = function() local builtin = require("telescope.builtin") local utils = require("telescope.utils") + -- stylua: ignore start return { - { ',,', function() builtin.fd { cwd = utils.buffer_dir() } end, desc = "Find files in current file's dir" }, - { ',ff', builtin.fd, desc = "Find files" }, - { ',fg', builtin.git_files, desc = "Find files (git)" }, - { ',gs', builtin.git_status, desc = "Git status" }, - { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, - { 'g/', builtin.live_grep, desc = "Live grep" }, - { 'g:', builtin.command_history, desc = "Command history" }, - { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, - { '*', builtin.grep_string, desc = "Find at cursor" }, - { 'gb', builtin.buffers, desc = "Switch buffer" }, - { ":", builtin.command_history, desc = "Command History" }, - { ";", builtin.commands, desc = "Commands" }, + { ',,', + function() + builtin.fd { cwd = require("findroot")(utils.buffer_dir()) } + end, + desc = "Find files in base dir (defined by .telescope-root file)" + }, + { ',ff', builtin.fd, desc = "Find files" }, + { ',fg', builtin.git_files, desc = "Find files (git)" }, + { ',gs', builtin.git_status, desc = "Git status" }, + { ',s', builtin.lsp_dynamic_workspace_symbols, desc = "Symbols" }, + { 'g/', builtin.live_grep, desc = "Live grep" }, + { 'g:', builtin.command_history, desc = "Command history" }, + { '', builtin.current_buffer_fuzzy_find, desc = "Fuzzy find" }, + { '*', builtin.grep_string, desc = "Find at cursor" }, + { 'gb', builtin.buffers, desc = "Switch buffer" }, + { ":", builtin.command_history, desc = "Command History" }, + { ";", builtin.commands, desc = "Commands" }, } end, + --stylua: ignore end opts = { defaults = { prompt_prefix = " ", @@ -34,20 +41,19 @@ return { }, extensions = { fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", }, ["ui-select"] = { - require("telescope.themes").get_dropdown {} + require("telescope.themes").get_dropdown({}), }, }, }, config = function(_, opts) - local telescope = require('telescope') + local telescope = require("telescope") telescope.setup(opts) - telescope.load_extension('fzf') + telescope.load_extension("fzf") end, } From be860e4e6d2d7bf879c265941c8a48622d438de8 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 3 May 2024 11:51:43 +0200 Subject: [PATCH 67/81] fix: remove wrong require call --- lua/plugins/metals.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua index 5e704e5..5edb2c6 100644 --- a/lua/plugins/metals.lua +++ b/lua/plugins/metals.lua @@ -1,13 +1,13 @@ return { - 'scalameta/nvim-metals', + "scalameta/nvim-metals", dependencies = { - 'nvim-lua/plenary.nvim', - 'mfussenegger/nvim-dap', + "nvim-lua/plenary.nvim", + "mfussenegger/nvim-dap", "hrsh7th/cmp-nvim-lsp", }, - ft = { 'scala', 'sbt' }, + ft = { "scala", "sbt" }, config = function() - local metals_config = require('metals').bare_config() + local metals_config = require("metals").bare_config() metals_config.init_options.statusBarProvider = "on" metals_config.settings = { showImplicitArguments = true, @@ -15,7 +15,6 @@ return { } metals_config.on_attach = function(client, bufnr) require("metals").setup_dap() - require("my_lsp").on_attach(client, bufnr) end metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() -- Debug settings if you're using nvim-dap @@ -40,7 +39,6 @@ return { }, } - -- Autocmd that will actually be in charging of starting the whole thing local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) vim.api.nvim_create_autocmd("FileType", { @@ -55,5 +53,5 @@ return { }) return metals_config - end + end, } From 0223565b9a6333f2beb8e513abb92ccced60ba6c Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sun, 19 May 2024 00:35:00 +0200 Subject: [PATCH 68/81] update --- lazy-lock.json | 52 +++++++++++++++++++------------------- lua/plugins/treesitter.lua | 2 ++ lua/plugins/ui.lua | 19 +++++++------- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 524e351..41dfff6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,47 +1,47 @@ { - "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, + "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "bluloco.nvim": { "branch": "main", "commit": "a41b4f849043dd32188e3d56758d8259e5ff7ae7" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, + "conform.nvim": { "branch": "master", "commit": "00f9d91391b04b1935e2f15948bd96cc111e7d3a" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, - "gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, + "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, + "gen.nvim": { "branch": "main", "commit": "bd19cf584b5b82123de977b44105e855e61e5f39" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "9cafac31a091267838e1e90fd6e083d37611f516" }, + "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "ebdc4c0f967bb36b70bb27763397dd71064c2067" }, + "hover.nvim": { "branch": "main", "commit": "82684ebd5f2a812d6d05a629b14109618b54cbfc" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lazy.nvim": { "branch": "main", "commit": "5d29ffeaa0f2d91f1dfbc21943d19a11e59a6fc6" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, + "lsp_signature.nvim": { "branch": "master", "commit": "aed5d1162b0f07bb3af34bedcc5f70a2b6466ed8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "neoconf.nvim": { "branch": "main", "commit": "d4a48c2a6fdeec138605cee4eb6f8c6fafd0b3ed" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "neoconf.nvim": { "branch": "main", "commit": "0065de89c834e1090a847a9aa126af5dce1db4dc" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, - "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, "nvim-genghis": { "branch": "main", "commit": "01eeb090ea4947df6b6b9d8589b324b9f1aaf851" }, - "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, - "nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" }, - "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, + "nvim-jdtls": { "branch": "master", "commit": "29255ea26dfb51ef0213f7572bff410f1afb002d" }, + "nvim-lint": { "branch": "master", "commit": "1f98d6c863f91706369d74aeb2eb3f02b2e96861" }, + "nvim-lspconfig": { "branch": "master", "commit": "6d2ae9fdc3111a6e8fd5db2467aca11737195a30" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, "nvim-metals": { "branch": "main", "commit": "c6268555d0b471262af78818f11a086ddf30688b" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "c0c32abc51181d735e24c93991324050b28429de" }, - "nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, - "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, + "nvim-treesitter": { "branch": "master", "commit": "1eabe69bfa8f78e14fcf5d42a2b3881babaca30a" }, + "nvim-treesitter-context": { "branch": "master", "commit": "55e29081e73d2e4b2d62fb4dc3eebe21bf66a1e2" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, + "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -50,20 +50,20 @@ "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" }, + "telescope.nvim": { "branch": "master", "commit": "0c12735d5aff6a48ffd8111bf144dc2ff44e5975" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "ce882460cf3db12e99f8bf579cbf99e331f6dd4f" }, + "vim-fugitive": { "branch": "master", "commit": "5a9bd42dd8dd127779f3cd8982a0419b7ca9c7f5" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "4f3f2901717320f80a1e16a868f706762be8535b" }, - "vim-ledger": { "branch": "master", "commit": "58561ed511753c4ef0fd446010daa1c2b7979d42" }, + "vim-kitty": { "branch": "main", "commit": "f16222cbfd061eda28e832dd407df6d6ec995a67" }, + "vim-ledger": { "branch": "master", "commit": "7b97c8765bf920e92fd950a7a5bc37cb2b13a494" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, @@ -72,6 +72,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "e4e659b088a082f6b7bb895ccbefb1f96a5b2710" }, + "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 51fc43f..ae1daff 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -81,6 +81,8 @@ return { ["ic"] = { query = "@class.inner", desc = "inner class" }, ["ap"] = { query = "@parameter.outer", desc = "outer parameter" }, ["ip"] = { query = "@parameter.inner", desc = "inner parameter" }, + ["ar"] = { query = "@return_type.outer", desc = "outer return type" }, + ["ir"] = { query = "@return_type.inner", desc = "inner return type" }, -- stylua: ignore end }, selection_modes = { diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 7a228e2..d209a3f 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,23 +1,24 @@ return { { - 'stevearc/dressing.nvim', + "stevearc/dressing.nvim", enabled = true, dependencies = { --'nvim-telescope/telescope-ui-select.nvim', }, opts = { select = { - backend = { 'telescope' } - } - } + backend = { "telescope" }, + }, + }, }, { - 'lukas-reineke/indent-blankline.nvim', - main = 'ibl', + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + tag = "v3.5.4", opts = { - whitespace = { highlight = { "Whitespace", "CursorLine" }, remove_blankline_trail = false, }, + whitespace = { highlight = { "Whitespace", "CursorLine" }, remove_blankline_trail = false }, indent = { highlight = { "Whitespace", "CursorLine" }, char = "" }, - scope = { enabled = true, }, + scope = { enabled = true }, }, - } + }, } From c6010628ca851ddd9a2e97a1b9b854f886bc6d65 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 29 May 2024 15:24:43 +0200 Subject: [PATCH 69/81] Change filetype detection for .sc The code used deprecated functions and I don't use Supercollider anyway, so make .sc always be a scala file --- ftdetect/extensions.lua | 19 ++++++++++--------- ftdetect/sc.lua | 24 ------------------------ 2 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 ftdetect/sc.lua diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua index 5268f3f..b37e045 100644 --- a/ftdetect/extensions.lua +++ b/ftdetect/extensions.lua @@ -1,18 +1,19 @@ vim.filetype.add({ extension = { - ['vtt'] = 'vtt', - ['typ'] = 'typst', + ["vtt"] = "vtt", + ["typ"] = "typst", + ["sc"] = "scala", }, filename = { - ['.scalafmt.conf'] = 'hocon', - ['kitty.conf'] = 'kitty', - ['neomuttrc'] = 'neomutt', - ['template'] = 'sh', - ['mbsyncrc'] = 'mbsyncrc', + [".scalafmt.conf"] = "hocon", + ["kitty.conf"] = "kitty", + ["neomuttrc"] = "neomutt", + ["template"] = "sh", + ["mbsyncrc"] = "mbsyncrc", }, pattern = { - ['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty', - ['${XDG_CONFIG_HOME}/kitty/*.session'] = 'kitty-session', + ["${XDG_CONFIG_HOME}/kitty/*.conf"] = "kitty", + ["${XDG_CONFIG_HOME}/kitty/*.session"] = "kitty-session", }, }) diff --git a/ftdetect/sc.lua b/ftdetect/sc.lua deleted file mode 100644 index 6d70f77..0000000 --- a/ftdetect/sc.lua +++ /dev/null @@ -1,24 +0,0 @@ --- Override detection from lua/vim/filetype/detect.lua --- removes match on |%w+| for SuperCollider -vim.filetype.add({ - extension = { - -- This function checks the first 25 lines of file extension "sc" to resolve - -- detection between scala and SuperCollider - sc = function(path, bufnr) - for _, line in ipairs(vim.filetype.getlines(bufnr, 1, 25)) do - if - vim.filetype.findany(line, { - 'var%s<', - 'classvar%s<', - '%^this.*', - '%+%s%w*%s{', - '%*ar%s', - }) - then - return 'supercollider' - end - end - return 'scala' - end - } -}) From 23c87b8983dc8a4d61862a6fad8a370e02adf827 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 12 Jun 2024 12:22:23 +0200 Subject: [PATCH 70/81] Update lazy-lock.json --- lazy-lock.json | 63 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 41dfff6..f5a68b7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,68 +1,68 @@ { - "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, + "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, - "bluloco.nvim": { "branch": "main", "commit": "a41b4f849043dd32188e3d56758d8259e5ff7ae7" }, + "bluloco.nvim": { "branch": "main", "commit": "5e70851f396decd0d28a10655d5235ddf507fd95" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "00f9d91391b04b1935e2f15948bd96cc111e7d3a" }, + "conform.nvim": { "branch": "master", "commit": "07d1298739cd7c616cb683bfd848f6b369f93297" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, - "gen.nvim": { "branch": "main", "commit": "bd19cf584b5b82123de977b44105e855e61e5f39" }, + "dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" }, + "gen.nvim": { "branch": "main", "commit": "b1230ce2993b2be38a1e22606750d05a94307380" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, + "gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" }, "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "82684ebd5f2a812d6d05a629b14109618b54cbfc" }, + "hover.nvim": { "branch": "main", "commit": "4d2cef11e03879bbb5514f6fa26fe13ec5a210bd" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "5d29ffeaa0f2d91f1dfbc21943d19a11e59a6fc6" }, + "lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "aed5d1162b0f07bb3af34bedcc5f70a2b6466ed8" }, + "lsp_signature.nvim": { "branch": "master", "commit": "2ec2ba23882329c1302dff773b0d3620371d634f" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, - "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, - "neoconf.nvim": { "branch": "main", "commit": "0065de89c834e1090a847a9aa126af5dce1db4dc" }, - "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, - "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, - "nvim-genghis": { "branch": "main", "commit": "01eeb090ea4947df6b6b9d8589b324b9f1aaf851" }, - "nvim-jdtls": { "branch": "master", "commit": "29255ea26dfb51ef0213f7572bff410f1afb002d" }, - "nvim-lint": { "branch": "master", "commit": "1f98d6c863f91706369d74aeb2eb3f02b2e96861" }, - "nvim-lspconfig": { "branch": "master", "commit": "6d2ae9fdc3111a6e8fd5db2467aca11737195a30" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8db12610bcb7ce67013cfdfaba4dd47a23c6e851" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "neoconf.nvim": { "branch": "main", "commit": "c81b91fbb39d4d46aedca2d1eacaa2389ae0eeaa" }, + "neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, + "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, + "nvim-genghis": { "branch": "main", "commit": "7055134943460d962b4909b43b4c3cd5f011c153" }, + "nvim-jdtls": { "branch": "master", "commit": "40e8494e04c1bcd5dd6c0d0bc187d2d10965017d" }, + "nvim-lint": { "branch": "master", "commit": "941fa1220a61797a51f3af9ec6b7d74c8c7367ce" }, + "nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, - "nvim-metals": { "branch": "main", "commit": "c6268555d0b471262af78818f11a086ddf30688b" }, + "nvim-metals": { "branch": "main", "commit": "1b87e6bfa4174b5fbaee9ca7ec79d8eae8df7f18" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "1eabe69bfa8f78e14fcf5d42a2b3881babaca30a" }, - "nvim-treesitter-context": { "branch": "master", "commit": "55e29081e73d2e4b2d62fb4dc3eebe21bf66a1e2" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, - "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "nvim-treesitter": { "branch": "master", "commit": "26171d8f105d97746371d1b6c07c8d88bf13fec2" }, + "nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "0c12735d5aff6a48ffd8111bf144dc2ff44e5975" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" }, + "trouble.nvim": { "branch": "main", "commit": "3609bb9a82bbab1ef95cf2c27ce7e52267a7d40d" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "5a9bd42dd8dd127779f3cd8982a0419b7ca9c7f5" }, + "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "f16222cbfd061eda28e832dd407df6d6ec995a67" }, + "vim-kitty": { "branch": "main", "commit": "029f565b0411c62075f3a9ba2c0acb58e6f6934c" }, "vim-ledger": { "branch": "master", "commit": "7b97c8765bf920e92fd950a7a5bc37cb2b13a494" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, @@ -72,6 +72,7 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, + "vimtex": { "branch": "master", "commit": "0587a064f675fd85cdfb8a76d6a3ff698af3944b" }, + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } } \ No newline at end of file From 4103cdc4d2d6be0bc7b4057ee0a6cb79d7dd55e3 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 10 Jul 2024 16:44:43 +0200 Subject: [PATCH 71/81] markdown-composer: disable, if cargo not available --- lua/plugins/markdown.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index 851d7ef..46a817a 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -1,4 +1,5 @@ return { 'euclio/vim-markdown-composer', - build = 'cargo build --release' + build = 'cargo build --release', + enabled = function() return vim.fn.executable("cargo") end } From babd4bc6f50b87f04dc04dd3fea44aef37167455 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 25 Jul 2024 19:11:32 +0200 Subject: [PATCH 72/81] clean up plugins --- init.lua | 12 ++++++++ lazy-lock.json | 61 +++++++++++++++++++-------------------- lua/plugins/beamer.lua | 7 ----- lua/plugins/filetypes.lua | 14 +++++++++ lua/plugins/gen.lua | 6 +++- lua/plugins/init.lua | 10 +++---- lua/plugins/lspconfig.lua | 43 ++++++++++++++------------- lua/plugins/lush.lua | 11 +++++-- 8 files changed, 96 insertions(+), 68 deletions(-) delete mode 100644 lua/plugins/beamer.lua create mode 100644 lua/plugins/filetypes.lua diff --git a/init.lua b/init.lua index 7360cbe..804c570 100644 --- a/init.lua +++ b/init.lua @@ -25,6 +25,18 @@ require("lazy").setup("plugins", { }, }) +vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy("+"), + ["*"] = require("vim.ui.clipboard.osc52").copy("*"), + }, + paste = { + ["+"] = require("vim.ui.clipboard.osc52").paste("+"), + ["*"] = require("vim.ui.clipboard.osc52").paste("*"), + }, +} + vim.opt.background = "dark" vim.opt.number = true vim.opt.title = true diff --git a/lazy-lock.json b/lazy-lock.json index f5a68b7..2366949 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,45 +1,43 @@ { - "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, - "bluloco.nvim": { "branch": "main", "commit": "5e70851f396decd0d28a10655d5235ddf507fd95" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "07d1298739cd7c616cb683bfd848f6b369f93297" }, - "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "conform.nvim": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, + "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" }, + "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, "gen.nvim": { "branch": "main", "commit": "b1230ce2993b2be38a1e22606750d05a94307380" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" }, - "hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" }, - "hover.nvim": { "branch": "main", "commit": "4d2cef11e03879bbb5514f6fa26fe13ec5a210bd" }, + "gitsigns.nvim": { "branch": "main", "commit": "7178d1a430dcfff8a4c92d78b9e39e0297a779c0" }, + "hover.nvim": { "branch": "main", "commit": "4339cbbcb572b1934c53dcb66ad4bf6a0abb7918" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" }, + "lazy.nvim": { "branch": "main", "commit": "d1de92dffab5a862332fdd1892889d362369c12f" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp_signature.nvim": { "branch": "master", "commit": "2ec2ba23882329c1302dff773b0d3620371d634f" }, + "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8db12610bcb7ce67013cfdfaba4dd47a23c6e851" }, - "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, - "neoconf.nvim": { "branch": "main", "commit": "c81b91fbb39d4d46aedca2d1eacaa2389ae0eeaa" }, - "neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" }, + "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, + "lush.nvim": { "branch": "main", "commit": "1b66ab197b177aabc2270a2c9cb8019fa5a367df" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, + "neoconf.nvim": { "branch": "main", "commit": "ef1bfbb192b8d0b49a95b6a919bb578aa5b06867" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, - "nvim-genghis": { "branch": "main", "commit": "7055134943460d962b4909b43b4c3cd5f011c153" }, + "nvim-genghis": { "branch": "main", "commit": "8b10f06735e1ecef93be61347e6c083d5263b331" }, "nvim-jdtls": { "branch": "master", "commit": "40e8494e04c1bcd5dd6c0d0bc187d2d10965017d" }, - "nvim-lint": { "branch": "master", "commit": "941fa1220a61797a51f3af9ec6b7d74c8c7367ce" }, - "nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" }, + "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, + "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, "nvim-metals": { "branch": "main", "commit": "1b87e6bfa4174b5fbaee9ca7ec79d8eae8df7f18" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "26171d8f105d97746371d1b6c07c8d88bf13fec2" }, - "nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" }, + "nvim-treesitter": { "branch": "master", "commit": "465840f8c14126e5193d777bbff94036eb875bd5" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f56a1430f21334868a86eb980b12e0af55690e98" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, @@ -48,31 +46,30 @@ "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" }, - "trouble.nvim": { "branch": "main", "commit": "3609bb9a82bbab1ef95cf2c27ce7e52267a7d40d" }, + "telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, + "trouble.nvim": { "branch": "main", "commit": "4453fea6bb597830fbd58d2c484612f37b97bd8c" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" }, + "vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, - "vim-hocon": { "branch": "master", "commit": "bb8fb14e00f8fc1eec27dd39dcc605aac43328a3" }, + "vim-hocon": { "branch": "main", "commit": "5df6dc1b7c8f5811afe663b0441e6304a729dcaf" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "029f565b0411c62075f3a9ba2c0acb58e6f6934c" }, + "vim-kitty": { "branch": "main", "commit": "9cc594a634308aa3bfaf3da5b5e741da1c0144c1" }, "vim-ledger": { "branch": "master", "commit": "7b97c8765bf920e92fd950a7a5bc37cb2b13a494" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, "vim-pass": { "branch": "master", "commit": "71adc31459d2ebd5d51c9d8214b111be8c86b833" }, - "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "0587a064f675fd85cdfb8a76d6a3ff698af3944b" }, - "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } + "vimtex": { "branch": "master", "commit": "fdb5618e05964e1cfcfd3bc1f2463ef3148ae8ff" }, + "which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" } } \ No newline at end of file diff --git a/lua/plugins/beamer.lua b/lua/plugins/beamer.lua deleted file mode 100644 index fb0cf3f..0000000 --- a/lua/plugins/beamer.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'uloco/bluloco.nvim', - dependencies = { 'rktjmp/lush.nvim' }, - opts = { - italics = true, - }, -} diff --git a/lua/plugins/filetypes.lua b/lua/plugins/filetypes.lua new file mode 100644 index 0000000..da0cd63 --- /dev/null +++ b/lua/plugins/filetypes.lua @@ -0,0 +1,14 @@ +return { + { + "ledger/vim-ledger", + ft = "ledger", + }, + { + "nfnty/vim-nftables", + ft = "nftables", + }, + { + "jvirtanen/vim-hocon", + ft = "hocon", + }, +} diff --git a/lua/plugins/gen.lua b/lua/plugins/gen.lua index 6336f72..eaabe4c 100644 --- a/lua/plugins/gen.lua +++ b/lua/plugins/gen.lua @@ -3,5 +3,9 @@ return { opts = { model = "mistral", -- The default model to use. init = false, - } + }, + cmd = "Gen", + keys = { + { "llm", ":Gen", mode = "n" }, + }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index dc02e37..5dcc2b0 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -32,20 +32,18 @@ return { "folke/trouble.nvim", "folke/lsp-colors.nvim", "nvim-lua/popup.nvim", - "junegunn/vim-easy-align", + { + "junegunn/vim-easy-align", + keys = { { "", "(EasyAlign)", mode = { "n", "x" } } }, + }, "machakann/vim-highlightedyank", "lambdalisue/suda.vim", "jamessan/vim-gnupg", - "ledger/vim-ledger", - "anekos/hledger-vim", --"vim-pandoc/vim-pandoc", --"vim-pandoc/vim-pandoc-syntax", "isobit/vim-caddyfile", "Glench/Vim-Jinja2-Syntax", - "GEverding/vim-hocon", - "nfnty/vim-nftables", - "nfnty/vim-nftables", "Everduin94/nvim-quick-switcher", } -- 'powerman/vim-plugin-AnsiEsc', diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 51ce1d2..cf15a31 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -5,10 +5,10 @@ return { event = { "BufReadPre", "BufNewFile" }, dependencies = { { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, - { "folke/neodev.nvim", opts = {} }, + { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", - 'nvim-lua/lsp-status.nvim', + "nvim-lua/lsp-status.nvim", "hrsh7th/cmp-nvim-lsp", }, ---@class PluginLspOpts @@ -29,7 +29,7 @@ return { severity_sort = true, }, -- add any global capabilities here - capabilities = { require 'lsp-status'.capabilities }, + capabilities = { require("lsp-status").capabilities }, servers = { jsonls = {}, lua_ls = { @@ -49,12 +49,15 @@ return { settings = { pylsp = { plugins = { - rope_autoimport = { enabled = true, }, - isort = { enabled = true, }, - } - } - } - } + rope_autoimport = { enabled = true }, + isort = { enabled = true }, + }, + }, + }, + }, + lemminx = { + settings = { xml = { server = { workDir = "~/.cache/lemminx" } } }, + }, }, -- you can do any additional lsp server setup here -- return true if you don't want this server to be setup with lspconfig @@ -80,14 +83,14 @@ return { if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" - or function(diagnostic) - local icons = require("common").icons.diagnostics - for d, icon in pairs(icons) do - if diagnostic.severity == vim.diagnostic.severity[d:upper()] then - return icon - end + or function(diagnostic) + local icons = require("common").icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon end end + end end vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) @@ -174,12 +177,12 @@ return { end end, }, - 'mfussenegger/nvim-jdtls', + "mfussenegger/nvim-jdtls", { - 'nvim-lua/lsp-status.nvim', + "nvim-lua/lsp-status.nvim", config = function(_, opts) - local lsp_status = require('lsp-status') + local lsp_status = require("lsp-status") lsp_status.register_progress() - end - } + end, + }, } diff --git a/lua/plugins/lush.lua b/lua/plugins/lush.lua index 78e3086..4b1345b 100644 --- a/lua/plugins/lush.lua +++ b/lua/plugins/lush.lua @@ -1,4 +1,11 @@ return { - 'rktjmp/lush.nvim', - 'rktjmp/shipwright.nvim', + "rktjmp/lush.nvim", + cmd = { + "Lushify", + "LushImport", + "LushRunTutorial", + }, + dependencies = { + "rktjmp/shipwright.nvim", + }, } From c5a3ea61cde7d5d48f88d4d5ab79301bb30dbcec Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 25 Jul 2024 19:13:26 +0200 Subject: [PATCH 73/81] ftdetect: nftables --- ftdetect/extensions.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ftdetect/extensions.lua b/ftdetect/extensions.lua index b37e045..24da699 100644 --- a/ftdetect/extensions.lua +++ b/ftdetect/extensions.lua @@ -3,6 +3,7 @@ vim.filetype.add({ ["vtt"] = "vtt", ["typ"] = "typst", ["sc"] = "scala", + ["nft"] = "nftables", }, filename = { [".scalafmt.conf"] = "hocon", @@ -10,6 +11,7 @@ vim.filetype.add({ ["neomuttrc"] = "neomutt", ["template"] = "sh", ["mbsyncrc"] = "mbsyncrc", + ["nftables.conf"] = "nftables", }, pattern = { ["${XDG_CONFIG_HOME}/kitty/*.conf"] = "kitty", From 5cab0a1769147ad7de12a201f3403e53aa303af0 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 25 Jul 2024 19:17:54 +0200 Subject: [PATCH 74/81] more cleanup --- init.lua | 16 ---------------- lua/plugins/vimtex.lua | 1 + plugin/osc52.lua | 11 +++++++++++ 3 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 plugin/osc52.lua diff --git a/init.lua b/init.lua index 804c570..96442cd 100644 --- a/init.lua +++ b/init.lua @@ -25,18 +25,6 @@ require("lazy").setup("plugins", { }, }) -vim.g.clipboard = { - name = "OSC 52", - copy = { - ["+"] = require("vim.ui.clipboard.osc52").copy("+"), - ["*"] = require("vim.ui.clipboard.osc52").copy("*"), - }, - paste = { - ["+"] = require("vim.ui.clipboard.osc52").paste("+"), - ["*"] = require("vim.ui.clipboard.osc52").paste("*"), - }, -} - vim.opt.background = "dark" vim.opt.number = true vim.opt.title = true @@ -108,8 +96,6 @@ end, { desc = "edit init.lua" }) command("CD", ":cd %:h", { desc = "cd to current file" }) command("TrailingSpace", "%s/\\s*$//g", { desc = "remove trailing spaces" }) -vim.g.tex_flavor = "latex" - local key = vim.keymap.set key("n", "", "za", { desc = "toggle fold" }) @@ -144,5 +130,3 @@ key("n", "Y", "y$") key("i", "", "", { desc = "completion" }) key("n", "", "nohredraw!", { desc = "clear search highlight" }) key("v", "gs", "'<,'>sort", { desc = "sort selection" }) - -key({ "n", "x" }, "", "(EasyAlign)", { desc = "align selection" }) diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua index b675f73..a0850cd 100644 --- a/lua/plugins/vimtex.lua +++ b/lua/plugins/vimtex.lua @@ -1,6 +1,7 @@ return { "lervag/vimtex", init = function() + vim.g.tex_flavor = "latex" vim.g.tex_conceal = "agm" vim.g.vimtex_quickfix_ignorefilters = { "overfull", "underfull" } vim.g.vimtex_syntax_enabled = 0 diff --git a/plugin/osc52.lua b/plugin/osc52.lua new file mode 100644 index 0000000..fd032cc --- /dev/null +++ b/plugin/osc52.lua @@ -0,0 +1,11 @@ +vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy("+"), + ["*"] = require("vim.ui.clipboard.osc52").copy("*"), + }, + paste = { + ["+"] = require("vim.ui.clipboard.osc52").paste("+"), + ["*"] = require("vim.ui.clipboard.osc52").paste("*"), + }, +} From 04a589a130fefd168289dde6a0ea13349e78977b Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sat, 27 Jul 2024 01:04:02 +0200 Subject: [PATCH 75/81] Add binding to toggle context view --- lua/plugins/treesitter.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ae1daff..a85d4c3 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -135,6 +135,7 @@ return { keys = { -- stylua: ignore start { "[c", function() require("treesitter-context").go_to_context() end, desc = "Go to context start", }, + { "c", function() require("treesitter-context").toggle() end, desc = "Toggle context view", }, -- stylua: ignore end }, opts = { enable = true }, From 77e8e0b88bd51334a799a4a31d7d0447f585ef97 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sat, 27 Jul 2024 01:05:40 +0200 Subject: [PATCH 76/81] codelines: change binding in scala to --- after/ftplugin/scala.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/ftplugin/scala.vim b/after/ftplugin/scala.vim index ba52db4..94c88ca 100644 --- a/after/ftplugin/scala.vim +++ b/after/ftplugin/scala.vim @@ -1,4 +1,4 @@ -imap //< (codelines-close) +imap (codelines-close) map cl :call jobstart(['codelines', '.']) set tw=120 From 7d42f1af297749aa6414c4799890869c31690adb Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 11 Sep 2024 10:05:14 +0200 Subject: [PATCH 77/81] update plugin configs --- lua/plugins/conform.lua | 2 +- lua/plugins/metals.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 44487d1..cf939f5 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -19,7 +19,7 @@ return { formatters_by_ft = { lua = { "stylua" }, python = { "isort", "black" }, - javascript = { { "prettierd", "prettier" } }, + javascript = { "prettierd", "prettier", stop_after_first = true }, }, -- Set up format-on-save format_on_save = { timeout_ms = 500, lsp_fallback = true }, diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua index 5edb2c6..cab27e8 100644 --- a/lua/plugins/metals.lua +++ b/lua/plugins/metals.lua @@ -29,6 +29,14 @@ return { --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example }, }, + { + type = "scala", + request = "attach", + buildTarget = "main", + name = "attach to service", + hostName = "localhost", + port = 9999, + }, { type = "scala", request = "launch", From 2c5d7faba6bdcee7fa9c44aac34ab72ff2b31fb1 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 11 Sep 2024 10:18:23 +0200 Subject: [PATCH 78/81] Switch unmaintained lsp-status to lsp-progress --- lazy-lock.json | 63 ++++++++++++++++++++------------------- lua/plugins/lspconfig.lua | 12 ++------ lua/plugins/tabline.lua | 32 +++++++++++++++++--- 3 files changed, 62 insertions(+), 45 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 2366949..e803f98 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,67 +1,67 @@ { - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, + "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, + "conform.nvim": { "branch": "master", "commit": "936f2413e6c57185cd873623a29a0685bce4b423" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, + "copilot.lua": { "branch": "master", "commit": "f9e2c140643bd4519a4517a78a51f6ae8b8b2a95" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, - "gen.nvim": { "branch": "main", "commit": "b1230ce2993b2be38a1e22606750d05a94307380" }, + "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, + "gen.nvim": { "branch": "main", "commit": "c9a73d8c0d462333da6d2191806ff98f2884d706" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "7178d1a430dcfff8a4c92d78b9e39e0297a779c0" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "hover.nvim": { "branch": "main", "commit": "4339cbbcb572b1934c53dcb66ad4bf6a0abb7918" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "d1de92dffab5a862332fdd1892889d362369c12f" }, + "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, - "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, + "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, - "lush.nvim": { "branch": "main", "commit": "1b66ab197b177aabc2270a2c9cb8019fa5a367df" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, - "neoconf.nvim": { "branch": "main", "commit": "ef1bfbb192b8d0b49a95b6a919bb578aa5b06867" }, + "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "neoconf.nvim": { "branch": "main", "commit": "206f6c0d96ff7ca1698e17cfe84d5b531050282e" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, - "nvim-genghis": { "branch": "main", "commit": "8b10f06735e1ecef93be61347e6c083d5263b331" }, - "nvim-jdtls": { "branch": "master", "commit": "40e8494e04c1bcd5dd6c0d0bc187d2d10965017d" }, - "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, - "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "20a4859ebde1c9bc8e96f8cc11a20667e7fdd516" }, + "nvim-genghis": { "branch": "main", "commit": "382ddb90a31313f0b2e059db50df0ca4dd2859d2" }, + "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, + "nvim-lint": { "branch": "master", "commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5" }, + "nvim-lspconfig": { "branch": "master", "commit": "8c45e7270302f5a0e5371147c46ac56715117872" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, "nvim-metals": { "branch": "main", "commit": "1b87e6bfa4174b5fbaee9ca7ec79d8eae8df7f18" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "465840f8c14126e5193d777bbff94036eb875bd5" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f56a1430f21334868a86eb980b12e0af55690e98" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "nvim-treesitter": { "branch": "master", "commit": "d22166e3d8d375b761c32b303176f3e955560b0c" }, + "nvim-treesitter-context": { "branch": "master", "commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, + "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, - "trouble.nvim": { "branch": "main", "commit": "4453fea6bb597830fbd58d2c484612f37b97bd8c" }, + "telescope.nvim": { "branch": "master", "commit": "fe999db6e0c39c8984519ead75660e0e2d3245d3" }, + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-hocon": { "branch": "main", "commit": "5df6dc1b7c8f5811afe663b0441e6304a729dcaf" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, "vim-kitty": { "branch": "main", "commit": "9cc594a634308aa3bfaf3da5b5e741da1c0144c1" }, - "vim-ledger": { "branch": "master", "commit": "7b97c8765bf920e92fd950a7a5bc37cb2b13a494" }, + "vim-ledger": { "branch": "master", "commit": "dbc683e24bd5338b8c12540227a58b2d247e097a" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, @@ -70,6 +70,7 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "fdb5618e05964e1cfcfd3bc1f2463ef3148ae8ff" }, - "which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" } + "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, + "vimtex": { "branch": "master", "commit": "ec3b648af5092372ddd72404fb5db46b2f78beb5" }, + "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } } \ No newline at end of file diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index cf15a31..b2b053d 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -8,7 +8,6 @@ return { { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", - "nvim-lua/lsp-status.nvim", "hrsh7th/cmp-nvim-lsp", }, ---@class PluginLspOpts @@ -29,7 +28,7 @@ return { severity_sort = true, }, -- add any global capabilities here - capabilities = { require("lsp-status").capabilities }, + capabilities = {}, servers = { jsonls = {}, lua_ls = { @@ -177,12 +176,5 @@ return { end end, }, - "mfussenegger/nvim-jdtls", - { - "nvim-lua/lsp-status.nvim", - config = function(_, opts) - local lsp_status = require("lsp-status") - lsp_status.register_progress() - end, - }, + 'mfussenegger/nvim-jdtls', } diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index 0365eb1..236f7e6 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -2,8 +2,13 @@ return { 'nvim-lualine/lualine.nvim', dependencies = { { 'kyazdani42/nvim-web-devicons', lazy = true }, - 'nvim-lua/lsp-status.nvim', 'crater2150/vim-theme-chroma', + { + 'linrongbin16/lsp-progress.nvim', + config = function() + require('lsp-progress').setup() + end + }, }, event = "VeryLazy", opts = function(_, opts) @@ -24,7 +29,10 @@ return { fmt = function(name, context) local buflist = vim.fn.tabpagebuflist(context.tabnr) local mod = not vim.tbl_isempty(vim.tbl_filter( - function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end, + function(bufnr) + return vim.fn.getbufvar(bufnr, '&mod') == + 1 + end, buflist)) local wincount = #vim.tbl_filter( @@ -32,14 +40,21 @@ return { vim.tbl_flatten(vim.fn.winlayout(context.tabnr)) ) - return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '') + return name .. + (wincount > 1 and ' +' .. (wincount - 1) or '') .. + (mod and ' [✏️]]' or '') end } } }, sections = { lualine_a = { 'filename' }, lualine_b = { 'diff', 'diagnostics' }, - lualine_x = { "require'lsp-status'.status()" }, + lualine_x = { + function() + -- invoke `progress` here. + return require('lsp-progress').progress() + end + }, lualine_y = { 'filetype' }, lualine_z = { 'searchcount', 'selectioncount', 'location' } }, @@ -56,4 +71,13 @@ return { extensions = {} } end, + config = function(_, opts) + require("lualine").setup(opts) + vim.api.nvim_create_augroup("lualine_augroup", { clear = true }) + vim.api.nvim_create_autocmd("User", { + group = "lualine_augroup", + pattern = "LspProgressStatusUpdated", + callback = require("lualine").refresh, + }) + end, } From 473d78494e170c2fb049498f4e95090e4236cbee Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Fri, 13 Sep 2024 17:14:12 +0200 Subject: [PATCH 79/81] use telescope for go to references --- lazy-lock.json | 25 ++++++++++++------------- plugin/on-attach.lua | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index e803f98..1c94620 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,14 +1,14 @@ { - "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "936f2413e6c57185cd873623a29a0685bce4b423" }, + "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "f9e2c140643bd4519a4517a78a51f6ae8b8b2a95" }, + "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, "gen.nvim": { "branch": "main", "commit": "c9a73d8c0d462333da6d2191806ff98f2884d706" }, @@ -25,21 +25,21 @@ "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "neoconf.nvim": { "branch": "main", "commit": "206f6c0d96ff7ca1698e17cfe84d5b531050282e" }, + "neoconf.nvim": { "branch": "main", "commit": "ce074ec29a6a65bfe2064dbed99a25f3d6ddd1fa" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "20a4859ebde1c9bc8e96f8cc11a20667e7fdd516" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, "nvim-genghis": { "branch": "main", "commit": "382ddb90a31313f0b2e059db50df0ca4dd2859d2" }, "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, - "nvim-lint": { "branch": "master", "commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5" }, - "nvim-lspconfig": { "branch": "master", "commit": "8c45e7270302f5a0e5371147c46ac56715117872" }, + "nvim-lint": { "branch": "master", "commit": "2bb7cc049d129d7fdbf31db0bc34fad5dd216f0d" }, + "nvim-lspconfig": { "branch": "master", "commit": "bb682c167a0878338b4313b55538953d1c039085" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, "nvim-metals": { "branch": "main", "commit": "1b87e6bfa4174b5fbaee9ca7ec79d8eae8df7f18" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "d22166e3d8d375b761c32b303176f3e955560b0c" }, + "nvim-treesitter": { "branch": "master", "commit": "e0338f2b74fbad808f2569c7d4eadd8796af2118" }, "nvim-treesitter-context": { "branch": "master", "commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, - "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, + "nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -48,7 +48,7 @@ "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "fe999db6e0c39c8984519ead75660e0e2d3245d3" }, + "telescope.nvim": { "branch": "master", "commit": "927c10f748e49c543b2d544c321a1245302ff324" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, @@ -70,7 +70,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "ec3b648af5092372ddd72404fb5db46b2f78beb5" }, + "vimtex": { "branch": "master", "commit": "539a203f19531c6b9d2d1b093ee8911fb7050bbc" }, "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } -} \ No newline at end of file +} diff --git a/plugin/on-attach.lua b/plugin/on-attach.lua index 1e45654..69c82c6 100644 --- a/plugin/on-attach.lua +++ b/plugin/on-attach.lua @@ -20,10 +20,10 @@ local on_attach = function(args) { 'rn', vim.lsp.buf.rename, "Rename" }, { '', vim.lsp.buf.code_action, "Code action" }, { '', vim.lsp.codelens.run, "Run code lens" }, - { 'gr', vim.lsp.buf.references, "Go to references" }, + { 'gr', function() require('telescope.builtin').lsp_references() end,"Go to references" }, { '', vim.diagnostic.open_float, "Open diagnostics" }, { '[d', vim.diagnostic.goto_prev, "Go to previous diagnostic" }, - { '[d', vim.diagnostic.goto_prev, "Go to next diagnostic" }, + { ']d', vim.diagnostic.goto_next, "Go to next diagnostic" }, { '', vim.diagnostic.setloclist, "Add buffer diagnostics to location list" }, { "dc", function() require("dap").continue() end, "Debug: Continue" }, { "dK", function() require("dap.ui.widgets").hover() end, "Debug: Hover" }, From e90763e2231cd6524ae961ef8a75ff5a6e6d45e9 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 26 Feb 2025 11:22:27 +0100 Subject: [PATCH 80/81] chore: format everything with stylua and update --- .editorconfig | 1 + after/ftplugin/java.lua | 44 ++++++++++-------- after/ftplugin/scss.lua | 4 +- after/ftplugin/typescript.lua | 64 ++++++++++++++++---------- after/plugin/genghis.lua | 4 +- after/plugin/treesitter.lua | 6 +-- after/plugin/trouble.lua | 4 +- ftplugin/java.lua | 21 +++++---- lazy-lock.json | 84 +++++++++++++++++------------------ lua/debug.lua | 24 +++++----- lua/plugins/chroma.lua | 8 ++-- lua/plugins/cmp.lua | 60 +++++++++++++------------ lua/plugins/deepl.lua | 28 ++++++++---- lua/plugins/filetypes.lua | 15 ++----- lua/plugins/fugitive.lua | 2 +- lua/plugins/git.lua | 14 +++--- lua/plugins/hover.lua | 14 +++--- lua/plugins/lspconfig.lua | 2 +- lua/plugins/markdown.lua | 8 ++-- lua/plugins/tabline.lua | 73 +++++++++++++++--------------- plugin/centerscroll.lua | 4 +- plugin/scaladeps.lua | 11 +++-- 22 files changed, 273 insertions(+), 222 deletions(-) diff --git a/.editorconfig b/.editorconfig index a48dce9..585e17e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,7 @@ charset = utf-8 [*.{lua,vim}] indent_size = tab indent_style = tab +tab_width = 4 trim_trailing_whitespace = true [*.{lua}] diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua index 9a8bec7..5284c6d 100644 --- a/after/ftplugin/java.lua +++ b/after/ftplugin/java.lua @@ -1,22 +1,30 @@ -vim.api.nvim_buf_set_option(0, 'textwidth', 120) -vim.cmd.iabbrev('syso', 'System.out.println') +vim.api.nvim_buf_set_option(0, "textwidth", 120) +vim.cmd.iabbrev("syso", "System.out.println") local bmap = vim.keymap.set local map_opt = { silent = true, buffer = true } -bmap('n', 'ev', function() require('jdtls').extract_variable() end, - { silent = true, buffer = true, desc = 'Extract variable' }) -bmap('v', 'ev', function() require('jdtls').extract_variable(true) end, - { silent = true, buffer = true, desc = 'Extract variable' }) -bmap('n', 'ec', function() require('jdtls').extract_constant() end, - { silent = true, buffer = true, desc = 'Extract constant' }) -bmap('v', 'ec', function() require('jdtls').extract_constant(true) end, - { silent = true, buffer = true, desc = 'Extract constant' }) -bmap('v', 'em', function() require('jdtls').extract_method(true) end, - { silent = true, buffer = true, desc = 'Extract method' }) -bmap('n', 'ro', function() require('jdtls').organize_imports() end, - { silent = true, buffer = true, desc = 'Organize imports' }) -bmap('n', 'tc', function() require 'jdtls'.test_class() end, - { silent = true, buffer = true, desc = 'Test class' }) -bmap('n', 'tm', function() require 'jdtls'.test_nearest_method() end, - { silent = true, buffer = true, desc = 'Test nearest method' }) +bmap("n", "ev", function() + require("jdtls").extract_variable() +end, { silent = true, buffer = true, desc = "Extract variable" }) +bmap("v", "ev", function() + require("jdtls").extract_variable(true) +end, { silent = true, buffer = true, desc = "Extract variable" }) +bmap("n", "ec", function() + require("jdtls").extract_constant() +end, { silent = true, buffer = true, desc = "Extract constant" }) +bmap("v", "ec", function() + require("jdtls").extract_constant(true) +end, { silent = true, buffer = true, desc = "Extract constant" }) +bmap("v", "em", function() + require("jdtls").extract_method(true) +end, { silent = true, buffer = true, desc = "Extract method" }) +bmap("n", "ro", function() + require("jdtls").organize_imports() +end, { silent = true, buffer = true, desc = "Organize imports" }) +bmap("n", "tc", function() + require("jdtls").test_class() +end, { silent = true, buffer = true, desc = "Test class" }) +bmap("n", "tm", function() + require("jdtls").test_nearest_method() +end, { silent = true, buffer = true, desc = "Test nearest method" }) diff --git a/after/ftplugin/scss.lua b/after/ftplugin/scss.lua index 99e3338..a2c958b 100644 --- a/after/ftplugin/scss.lua +++ b/after/ftplugin/scss.lua @@ -1 +1,3 @@ -vim.keymap.set("n", "s", function() require('nvim-quick-switcher').toggle('tsx', 'scss') end, { buffer = true }) +vim.keymap.set("n", "s", function() + require("nvim-quick-switcher").toggle("tsx", "scss") +end, { buffer = true }) diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua index ba05ac5..3a77af2 100644 --- a/after/ftplugin/typescript.lua +++ b/after/ftplugin/typescript.lua @@ -1,33 +1,46 @@ vim.o.textwidth = 120 -vim.keymap.set("n", "o", - function() vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) end, - { desc = "Organize imports" } -) -vim.keymap.set("n", "s", function() require('nvim-quick-switcher').toggle('tsx', 'scss') end, { buffer = true }) +vim.keymap.set("n", "o", function() + vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) +end, { desc = "Organize imports" }) +vim.keymap.set("n", "s", function() + require("nvim-quick-switcher").toggle("tsx", "scss") +end, { buffer = true }) local function goToCSSClassDefinition() local node = vim.treesitter.get_node() - if not node then return false end + if not node then + return false + end local parent = node:parent() - if not parent then return false end + if not parent then + return false + end local grandparent = parent:parent() - if not grandparent then return false end + if not grandparent then + return false + end local className - if node:type() == "string_fragment" and grandparent:type() == "jsx_attribute" and vim.treesitter.get_node_text(grandparent:named_child(0), 0) == "className" then + if + node:type() == "string_fragment" + and grandparent:type() == "jsx_attribute" + and vim.treesitter.get_node_text(grandparent:named_child(0), 0) == "className" + then className = vim.treesitter.get_node_text(node, 0) - elseif parent:type() == "jsx_attribute" and vim.treesitter.get_node_text(parent:named_child(0), 0) == "className" then + elseif + parent:type() == "jsx_attribute" and vim.treesitter.get_node_text(parent:named_child(0), 0) == "className" + then className = vim.treesitter.get_node_text(parent:named_child(1):named_child(0), 0) elseif node:type() == "jsx_attribute" and vim.treesitter.get_node_text(node:named_child(0), 0) == "className" then className = vim.treesitter.get_node_text(node:named_child(1):named_child(0), 0) end if className then - require('nvim-quick-switcher').toggle('tsx', 'scss', { only_existing = true }) - local query = vim.treesitter.query.parse("scss", "((class_name) @cn (#eq? @cn \"" .. className .. "\"))") + require("nvim-quick-switcher").toggle("tsx", "scss", { only_existing = true }) + local query = vim.treesitter.query.parse("scss", '((class_name) @cn (#eq? @cn "' .. className .. '"))') local tree = vim.treesitter.get_node():tree() vim.fn.setqflist({}) local start, _, stop, _ = tree:root():range() @@ -37,17 +50,19 @@ local function goToCSSClassDefinition() for _, node in pairs(match) do local row, col = node:start() vim.api.nvim_win_set_cursor(0, { row + 1, col }) - vim.fn.setqflist({ { - lnum = row + 1, - col = col + 1, - text = "class selector: " .. className, - filename = vim.fn.expand('%:p'), - bufnr = vim.fn.bufnr('%'), - } }, 'a') + vim.fn.setqflist({ + { + lnum = row + 1, + col = col + 1, + text = "class selector: " .. className, + filename = vim.fn.expand("%:p"), + bufnr = vim.fn.bufnr("%"), + }, + }, "a") end end if not anyMatch then - require('nvim-quick-switcher').toggle('tsx', 'scss', { only_existing = true }) + require("nvim-quick-switcher").toggle("tsx", "scss", { only_existing = true }) end return true end @@ -56,9 +71,12 @@ end vim.api.nvim_create_autocmd("LspAttach", { callback = function() - vim.keymap.set("n", "gd", function() if not goToCSSClassDefinition() then require('telescope.builtin').lsp_definitions() end end, - { buffer = true }) - end + vim.keymap.set("n", "gd", function() + if not goToCSSClassDefinition() then + require("telescope.builtin").lsp_definitions() + end + end, { buffer = true }) + end, }) vim.o.foldmethod = "expr" diff --git a/after/plugin/genghis.lua b/after/plugin/genghis.lua index c9cacd0..87e4534 100644 --- a/after/plugin/genghis.lua +++ b/after/plugin/genghis.lua @@ -1 +1,3 @@ -vim.api.nvim_create_user_command("Trash", function() require("genghis").trashFile({ trashCmd = "rm" }) end, { desc = "Delete current file" }) +vim.api.nvim_create_user_command("Trash", function() + require("genghis").trashFile({ trashCmd = "rm" }) +end, { desc = "Delete current file" }) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index 3271d2e..7433b51 100644 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -1,4 +1,4 @@ -require 'nvim-treesitter.configs'.setup { +require("nvim-treesitter.configs").setup({ ensure_installed = { "typescript" }, sync_install = true, auto_install = true, @@ -11,6 +11,6 @@ require 'nvim-treesitter.configs'.setup { additional_vim_regex_highlighting = false, }, indent = { - enable = true + enable = true, }, -} +}) diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua index e663d78..584dfac 100644 --- a/after/plugin/trouble.lua +++ b/after/plugin/trouble.lua @@ -1,8 +1,8 @@ -require("trouble").setup { +require("trouble").setup({ -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below -} +}) vim.api.nvim_set_keymap("n", "xx", "Trouble", { silent = true, noremap = true }) vim.api.nvim_set_keymap("n", "xw", "Trouble workspace_diagnostics", { silent = true, noremap = true }) vim.api.nvim_set_keymap("n", "xd", "Trouble document_diagnostics", { silent = true, noremap = true }) diff --git a/ftplugin/java.lua b/ftplugin/java.lua index d4bf73b..11223a0 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,21 +1,24 @@ local path = require("mason-core.path") local function mason_package(...) - return path.concat { vim.fn.stdpath("data"), "mason", "packages", ... } + return path.concat({ vim.fn.stdpath("data"), "mason", "packages", ... }) end local bundles = vim.fn.glob( - mason_package("java-debug-adapter", "extension", "server", "com.microsoft.java.debug.plugin-*.jar"), true, true) + mason_package("java-debug-adapter", "extension", "server", "com.microsoft.java.debug.plugin-*.jar"), + true, + true +) local extra_bundles = vim.fn.glob(mason_package("java-test", "extension", "server", "*.jar"), true, true) vim.list_extend(bundles, extra_bundles) -require('jdtls').start_or_attach({ +require("jdtls").start_or_attach({ cmd = { mason_package("jdtls", "bin", "jdtls") }, on_attach = function(client, bufnr) - require 'jdtls'.setup_dap() + require("jdtls").setup_dap() end, init_options = { - bundles = extra_bundles + bundles = extra_bundles, }, settings = { java = { @@ -27,7 +30,7 @@ require('jdtls').start_or_attach({ "org.junit.jupiter.api.Assertions.*", "java.util.Objects.requireNonNull", "java.util.Objects.requireNonNullElse", - "org.mockito.Mockito.*" + "org.mockito.Mockito.*", }, filteredTypes = { "com.sun.*", @@ -39,7 +42,7 @@ require('jdtls').start_or_attach({ }, codeGeneration = { toString = { - template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}" + template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}", }, hashCodeEquals = { useJava7Objects = true, @@ -52,6 +55,6 @@ require('jdtls').start_or_attach({ staticStarThreshold = 5, }, }, - } - } + }, + }, }) diff --git a/lazy-lock.json b/lazy-lock.json index 1c94620..1a9a310 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,67 +1,67 @@ { - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, - "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, - "gen.nvim": { "branch": "main", "commit": "c9a73d8c0d462333da6d2191806ff98f2884d706" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "gen.nvim": { "branch": "main", "commit": "e09a8dbffa139ad60d5b47998fcc8669ead1ebf4" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, - "hover.nvim": { "branch": "main", "commit": "4339cbbcb572b1934c53dcb66ad4bf6a0abb7918" }, + "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, + "hover.nvim": { "branch": "main", "commit": "140c4d0ae9397b76baa46b87c574f5377de09309" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, - "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, - "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, + "lsp_signature.nvim": { "branch": "master", "commit": "693b75f1dc31f5af45ceb762966a6ab00af1850b" }, + "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, + "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "neoconf.nvim": { "branch": "main", "commit": "ce074ec29a6a65bfe2064dbed99a25f3d6ddd1fa" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "neoconf.nvim": { "branch": "main", "commit": "9cc9425be8360827b29d97e21d1a0e111f432099" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, - "nvim-genghis": { "branch": "main", "commit": "382ddb90a31313f0b2e059db50df0ca4dd2859d2" }, - "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, - "nvim-lint": { "branch": "master", "commit": "2bb7cc049d129d7fdbf31db0bc34fad5dd216f0d" }, - "nvim-lspconfig": { "branch": "master", "commit": "bb682c167a0878338b4313b55538953d1c039085" }, + "nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" }, + "nvim-dap": { "branch": "master", "commit": "379cf26e9c457b66a0152cd5d018418c03720d47" }, + "nvim-genghis": { "branch": "main", "commit": "99ca8b9e6e6bae0899cc2902f4103204572ac8ee" }, + "nvim-jdtls": { "branch": "master", "commit": "2f7bff9b8d2ee1918b36ca55f19547d9d335a268" }, + "nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" }, + "nvim-lspconfig": { "branch": "master", "commit": "99c75820f2606b6b446cad7c75ec2ef7ee8a1317" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, - "nvim-metals": { "branch": "main", "commit": "1b87e6bfa4174b5fbaee9ca7ec79d8eae8df7f18" }, + "nvim-metals": { "branch": "main", "commit": "5d27f4918ea954772725d6741f84a71cfaff932a" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "e0338f2b74fbad808f2569c7d4eadd8796af2118" }, - "nvim-treesitter-context": { "branch": "master", "commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, - "nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" }, + "nvim-treesitter": { "branch": "master", "commit": "93ce9feb4fabbb37b3e7f47d80f27be778f4d956" }, + "nvim-treesitter-context": { "branch": "master", "commit": "198720b4016af04c9590f375d714d5bf8afecc1a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, - "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "927c10f748e49c543b2d544c321a1245302ff324" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, - "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, - "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, + "vim-characterize": { "branch": "master", "commit": "a8bffac6cead6b2869d939ecad06312b187a4c79" }, + "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, - "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, + "vim-highlightedyank": { "branch": "master", "commit": "285a61425e79742997bbde76a91be6189bc988fb" }, "vim-hocon": { "branch": "main", "commit": "5df6dc1b7c8f5811afe663b0441e6304a729dcaf" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "9cc594a634308aa3bfaf3da5b5e741da1c0144c1" }, - "vim-ledger": { "branch": "master", "commit": "dbc683e24bd5338b8c12540227a58b2d247e097a" }, + "vim-kitty": { "branch": "main", "commit": "ceaae754267f9578b6313890596ee34a19c00dad" }, + "vim-ledger": { "branch": "master", "commit": "aabf1976dfefe5665233c600421aea2798ff7ea0" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, @@ -70,6 +70,6 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "539a203f19531c6b9d2d1b093ee8911fb7050bbc" }, - "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } + "vimtex": { "branch": "master", "commit": "096a0450261abccb7944630fae66788712be46a8" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/debug.lua b/lua/debug.lua index 63bc743..fecfb51 100644 --- a/lua/debug.lua +++ b/lua/debug.lua @@ -1,25 +1,25 @@ -- Setup nvim-cmp. -local cmp = require 'cmp' +local cmp = require("cmp") cmp.setup({ snippet = { expand = function(args) --vim.fn["vsnip#anonymous"](args.body) - require('luasnip').lsp_expand(args.body) + require("luasnip").lsp_expand(args.body) end, }, mapping = { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ select = true }), }, sources = { - { name = 'nvim_lsp' }, + { name = "nvim_lsp" }, -- For vsnip user. - { name = 'vsnip' }, + { name = "vsnip" }, -- For luasnip user. -- { name = 'luasnip' }, @@ -27,8 +27,8 @@ cmp.setup({ -- For ultisnips user. -- { name = 'ultisnips' }, - { name = 'buffer' }, - } + { name = "buffer" }, + }, }) -- Setup lsp. @@ -36,4 +36,4 @@ metals_config = require("metals").bare_config metals_config.init_options.statusBarProvider = "on" metals_config.settings = { showImplicitArguments = true } metals_config.on_attach = on_attach -metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +metals_config.capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) diff --git a/lua/plugins/chroma.lua b/lua/plugins/chroma.lua index 49bd750..dec027e 100644 --- a/lua/plugins/chroma.lua +++ b/lua/plugins/chroma.lua @@ -1,8 +1,10 @@ return { - 'crater2150/vim-theme-chroma', + "crater2150/vim-theme-chroma", dev = true, lazy = false, - branch = 'lush', + branch = "lush", priority = 1000, - config = function() vim.cmd.colorscheme("chroma") end + config = function() + vim.cmd.colorscheme("chroma") + end, } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index cbab29a..a87a0ff 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -8,62 +8,64 @@ return { dependencies = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", -- 'hrsh7th/cmp-vsnip', -- 'hrsh7th/vim-vsnip', -- 'hrsh7th/vim-vsnip-integ', - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - 'onsails/lspkind.nvim', + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "onsails/lspkind.nvim", { - 'zbirenbaum/copilot-cmp', - dependencies = { "hrsh7th/nvim-cmp", + "zbirenbaum/copilot-cmp", + dependencies = { + "hrsh7th/nvim-cmp", { - 'zbirenbaum/copilot.lua', + "zbirenbaum/copilot.lua", opts = { suggestion = { enabled = false }, panel = { enabled = false }, filetypes = { mail = false, text = false, - } - } + }, + }, }, }, config = function() require("copilot_cmp").setup() - end + end, }, }, config = function() - local cmp = require('cmp') - local lspkind = require('lspkind') - local luasnip = require('luasnip') + local cmp = require("cmp") + local lspkind = require("lspkind") + local luasnip = require("luasnip") local has_words_before = function() unpack = unpack or table.unpack local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + return col ~= 0 + and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end cmp.setup({ snippet = { expand = function(args) --vim.fn["vsnip#anonymous"](args.body) - require('luasnip').lsp_expand(args.body) + require("luasnip").lsp_expand(args.body) end, }, mapping = { - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }), - [""] = cmp.mapping({ + [""] = cmp.mapping({ i = function(fallback) if cmp.visible() and cmp.get_active_entry() then cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) @@ -98,20 +100,20 @@ return { end, { "i", "s" }), }, sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, + { name = "nvim_lsp" }, + { name = "luasnip" }, { name = "copilot" }, }, { - { name = 'buffer', option = { keyword_pattern = [[\k\+]] } }, + { name = "buffer", option = { keyword_pattern = [[\k\+]] } }, --{ name = 'path' }, }), formatting = { format = lspkind.cmp_format({ - mode = 'symbol_text', -- show only symbol annotations + mode = "symbol_text", -- show only symbol annotations maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + ellipsis_char = "…", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) symbol_map = { Copilot = "" }, - }) + }), }, }) end, diff --git a/lua/plugins/deepl.lua b/lua/plugins/deepl.lua index 65d0302..da06b92 100644 --- a/lua/plugins/deepl.lua +++ b/lua/plugins/deepl.lua @@ -1,17 +1,29 @@ return { - 'ryicoh/deepl.vim', + "ryicoh/deepl.vim", keys = { - { '', function() vim.fn['deepl#v']("EN") end, mode = 'v' }, - { '', function() vim.fn['deepl#v']("DE") end, mode = 'v' }, + { + "", + function() + vim.fn["deepl#v"]("EN") + end, + mode = "v", + }, + { + "", + function() + vim.fn["deepl#v"]("DE") + end, + mode = "v", + }, }, dependencies = { { - 'tsuyoshicho/vim-pass', + "tsuyoshicho/vim-pass", init = function() vim.g.pass_use_agent = 1 - end + end, } }, config = function() - vim.g['deepl#endpoint'] = "https://api-free.deepl.com/v2/translate" - vim.g['deepl#auth_key'] = vim.fn['pass#get']('web/deepl.com', 'apikey') - end + vim.g["deepl#endpoint"] = "https://api-free.deepl.com/v2/translate" + vim.g["deepl#auth_key"] = vim.fn["pass#get"]("web/deepl.com", "apikey") + end, } diff --git a/lua/plugins/filetypes.lua b/lua/plugins/filetypes.lua index da0cd63..a5e5dd3 100644 --- a/lua/plugins/filetypes.lua +++ b/lua/plugins/filetypes.lua @@ -1,14 +1,5 @@ return { - { - "ledger/vim-ledger", - ft = "ledger", - }, - { - "nfnty/vim-nftables", - ft = "nftables", - }, - { - "jvirtanen/vim-hocon", - ft = "hocon", - }, + { "ledger/vim-ledger", ft = "ledger" }, + { "nfnty/vim-nftables", ft = "nftables" }, + { "jvirtanen/vim-hocon", ft = "hocon" }, } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index b986ebf..8045e1a 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1 +1 @@ -return { 'tpope/vim-fugitive' } +return { "tpope/vim-fugitive" } diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua index 1b183d5..4551cf6 100644 --- a/lua/plugins/git.lua +++ b/lua/plugins/git.lua @@ -1,14 +1,14 @@ return { - 'lambdalisue/gina.vim', - 'gisphm/vim-gitignore', - 'sjl/splice.vim', + "lambdalisue/gina.vim", + "gisphm/vim-gitignore", + "sjl/splice.vim", { - 'lewis6991/gitsigns.nvim', + "lewis6991/gitsigns.nvim", config = { signs = { - add = { text = '▌' }, - change = { text = '▐' }, + add = { text = "▌" }, + change = { text = "▐" }, }, - } + }, }, } diff --git a/lua/plugins/hover.lua b/lua/plugins/hover.lua index 7cb1652..1f88ead 100644 --- a/lua/plugins/hover.lua +++ b/lua/plugins/hover.lua @@ -1,23 +1,23 @@ return { "lewis6991/hover.nvim", config = function() - require("hover").setup { + require("hover").setup({ init = function() require("hover.providers.lsp") - require('hover.providers.gh') - require('hover.providers.man') + require("hover.providers.gh") + require("hover.providers.man") end, preview_opts = { - border = nil + border = nil, }, -- Whether the contents of a currently open hover window should be moved -- to a :h preview-window when pressing the hover keymap. preview_window = false, - title = true - } + title = true, + }) -- Setup keymaps vim.keymap.set("n", "K", require("hover").hover, { desc = "hover.nvim" }) vim.keymap.set("n", "gK", require("hover").hover_select, { desc = "hover.nvim (select)" }) - end + end, } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index b2b053d..64f1731 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -176,5 +176,5 @@ return { end end, }, - 'mfussenegger/nvim-jdtls', + "mfussenegger/nvim-jdtls", } diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index 46a817a..4666219 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -1,5 +1,7 @@ return { - 'euclio/vim-markdown-composer', - build = 'cargo build --release', - enabled = function() return vim.fn.executable("cargo") end + "euclio/vim-markdown-composer", + build = "cargo build --release", + enabled = function() + return vim.fn.executable("cargo") + end, } diff --git a/lua/plugins/tabline.lua b/lua/plugins/tabline.lua index 236f7e6..977e0ad 100644 --- a/lua/plugins/tabline.lua +++ b/lua/plugins/tabline.lua @@ -1,74 +1,77 @@ return { - 'nvim-lualine/lualine.nvim', + "nvim-lualine/lualine.nvim", dependencies = { - { 'kyazdani42/nvim-web-devicons', lazy = true }, - 'crater2150/vim-theme-chroma', + { "kyazdani42/nvim-web-devicons", lazy = true }, + "crater2150/vim-theme-chroma", { - 'linrongbin16/lsp-progress.nvim', + "linrongbin16/lsp-progress.nvim", config = function() - require('lsp-progress').setup() - end + require("lsp-progress").setup() + end, }, }, event = "VeryLazy", opts = function(_, opts) return { options = { - theme = require('chroma-theme.lualine') + theme = require("chroma-theme.lualine"), }, tabline = { - lualine_a = { 'branch' }, + lualine_a = { "branch" }, lualine_b = {}, - lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁" }, } }, + lualine_c = { + { + "buffers", + show_filename_only = false, + symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁" }, + }, + }, lualine_x = {}, lualine_y = {}, lualine_z = { { - 'tabs', + "tabs", mode = 1, fmt = function(name, context) local buflist = vim.fn.tabpagebuflist(context.tabnr) - local mod = not vim.tbl_isempty(vim.tbl_filter( - function(bufnr) - return vim.fn.getbufvar(bufnr, '&mod') == - 1 - end, - buflist)) + local mod = not vim.tbl_isempty(vim.tbl_filter(function(bufnr) + return vim.fn.getbufvar(bufnr, "&mod") == 1 + end, buflist)) - local wincount = #vim.tbl_filter( - function(i) return i == 'leaf' end, - vim.tbl_flatten(vim.fn.winlayout(context.tabnr)) - ) + local wincount = #vim.tbl_filter(function(i) + return i == "leaf" + end, vim.tbl_flatten(vim.fn.winlayout(context.tabnr))) - return name .. - (wincount > 1 and ' +' .. (wincount - 1) or '') .. - (mod and ' [✏️]]' or '') - end - } } + return name + .. (wincount > 1 and " +" .. (wincount - 1) or "") + .. (mod and " [✏️]]" or "") + end, + }, + }, }, sections = { - lualine_a = { 'filename' }, - lualine_b = { 'diff', 'diagnostics' }, + lualine_a = { "filename" }, + lualine_b = { "diff", "diagnostics" }, lualine_x = { function() -- invoke `progress` here. - return require('lsp-progress').progress() - end + return require("lsp-progress").progress() + end, }, - lualine_y = { 'filetype' }, - lualine_z = { 'searchcount', 'selectioncount', 'location' } + lualine_y = { "filetype" }, + lualine_z = { "searchcount", "selectioncount", "location" }, }, inactive_sections = { lualine_a = {}, lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, + lualine_c = { "filename" }, + lualine_x = { "location" }, lualine_y = {}, - lualine_z = {} + lualine_z = {}, }, winbar = {}, inactive_winbar = {}, - extensions = {} + extensions = {}, } end, config = function(_, opts) diff --git a/plugin/centerscroll.lua b/plugin/centerscroll.lua index 54202a4..861d879 100644 --- a/plugin/centerscroll.lua +++ b/plugin/centerscroll.lua @@ -7,9 +7,9 @@ vim.api.nvim_create_augroup("KeepCentered", { clear = true }) vim.api.nvim_create_autocmd("CursorMoved", { group = "KeepCentered", - pattern = '*', + pattern = "*", callback = function() - if vim.o.buftype == '' then + if vim.o.buftype == "" then vim.cmd([[normal! zz]]) end end, diff --git a/plugin/scaladeps.lua b/plugin/scaladeps.lua index e15cde5..21d1f5b 100644 --- a/plugin/scaladeps.lua +++ b/plugin/scaladeps.lua @@ -1,6 +1,11 @@ local sbtToScalaCLI = function() - vim.cmd [[s/\s*libraryDependencies\s*+=\s*/\/\/> using dep /]] - vim.cmd [[s/" \(%\+\) "/\=repeat(":", strlen(submatch(1)))/g]] + vim.cmd([[s/\s*libraryDependencies\s*+=\s*/\/\/> using dep /]]) + vim.cmd([[s/" \(%\+\) "/\=repeat(":", strlen(submatch(1)))/g]]) end -vim.keymap.set("n", "dep", sbtToScalaCLI, { noremap = true, silent = true, desc = "Convert sbt dependency to Scala CLI" }) +vim.keymap.set( + "n", + "dep", + sbtToScalaCLI, + { noremap = true, silent = true, desc = "Convert sbt dependency to Scala CLI" } +) From d9f092adac79a7b62b701eeac1294c00e123fa57 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Wed, 26 Mar 2025 19:47:20 +0100 Subject: [PATCH 81/81] update --- after/ftplugin/html.vim | 0 after/ftplugin/markdown.lua | 3 +++ after/ftplugin/markdown.vim | 2 -- after/ftplugin/python.lua | 4 ++++ after/ftplugin/python.vim | 1 - after/ftplugin/text.lua | 1 + lazy-lock.json | 43 +++++++++++++++++++------------------ lua/plugins/lspconfig.lua | 13 +++++++++++ 8 files changed, 43 insertions(+), 24 deletions(-) delete mode 100644 after/ftplugin/html.vim create mode 100644 after/ftplugin/markdown.lua delete mode 100644 after/ftplugin/markdown.vim create mode 100644 after/ftplugin/python.lua delete mode 100644 after/ftplugin/python.vim create mode 100644 after/ftplugin/text.lua diff --git a/after/ftplugin/html.vim b/after/ftplugin/html.vim deleted file mode 100644 index e69de29..0000000 diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua new file mode 100644 index 0000000..cd54204 --- /dev/null +++ b/after/ftplugin/markdown.lua @@ -0,0 +1,3 @@ +vim.g.markdown_fenced_languages = { "html", "python", "scala", "js=javascript" } +vim.g.markdown_composer_autostart = 0 +vim.o.textwidth = 80 diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim deleted file mode 100644 index 2424615..0000000 --- a/after/ftplugin/markdown.vim +++ /dev/null @@ -1,2 +0,0 @@ -let g:markdown_fenced_languages = ['html', 'python', 'scala', 'js=javascript'] -let g:markdown_composer_autostart = 0 diff --git a/after/ftplugin/python.lua b/after/ftplugin/python.lua new file mode 100644 index 0000000..8412fc6 --- /dev/null +++ b/after/ftplugin/python.lua @@ -0,0 +1,4 @@ +vim.o.tabstop = 4 +vim.o.shiftwidth = 4 +vim.o.expandtab = true +vim.o.textwidth = 120 diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim deleted file mode 100644 index 6e9f958..0000000 --- a/after/ftplugin/python.vim +++ /dev/null @@ -1 +0,0 @@ -set ts=4 sw=4 et diff --git a/after/ftplugin/text.lua b/after/ftplugin/text.lua new file mode 100644 index 0000000..6ae2d3c --- /dev/null +++ b/after/ftplugin/text.lua @@ -0,0 +1 @@ +vim.o.textwidth = 80 diff --git a/lazy-lock.json b/lazy-lock.json index 1a9a310..68757de 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,49 +6,49 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, + "conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" }, "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, - "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, + "copilot.lua": { "branch": "master", "commit": "b9300fbd5eeeae294eb76ba6c35c44fbd8b71c1b" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "gen.nvim": { "branch": "main", "commit": "e09a8dbffa139ad60d5b47998fcc8669ead1ebf4" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, + "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "hover.nvim": { "branch": "main", "commit": "140c4d0ae9397b76baa46b87c574f5377de09309" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, - "lsp_signature.nvim": { "branch": "master", "commit": "693b75f1dc31f5af45ceb762966a6ab00af1850b" }, + "lsp_signature.nvim": { "branch": "master", "commit": "8b681c86b0bd7f932cd91987983d91497e43d83f" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, + "lualine.nvim": { "branch": "master", "commit": "9fef261b53fbe3a2ef01ee9667f6fde064b1ed10" }, "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "neoconf.nvim": { "branch": "main", "commit": "9cc9425be8360827b29d97e21d1a0e111f432099" }, + "neoconf.nvim": { "branch": "main", "commit": "fb1f139b5ed47262609c7d5eb4b894c3f32fb8ce" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" }, - "nvim-dap": { "branch": "master", "commit": "379cf26e9c457b66a0152cd5d018418c03720d47" }, - "nvim-genghis": { "branch": "main", "commit": "99ca8b9e6e6bae0899cc2902f4103204572ac8ee" }, + "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, + "nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" }, + "nvim-genghis": { "branch": "main", "commit": "a91692c49fefe13dffaf13d316589f9d76f2b1d2" }, "nvim-jdtls": { "branch": "master", "commit": "2f7bff9b8d2ee1918b36ca55f19547d9d335a268" }, - "nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" }, - "nvim-lspconfig": { "branch": "master", "commit": "99c75820f2606b6b446cad7c75ec2ef7ee8a1317" }, + "nvim-lint": { "branch": "master", "commit": "93b8040115c9114dac1047311763bef275e752dc" }, + "nvim-lspconfig": { "branch": "master", "commit": "e79193005821543b5b337b9d0350b9fe1ce5c92e" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, - "nvim-metals": { "branch": "main", "commit": "5d27f4918ea954772725d6741f84a71cfaff932a" }, + "nvim-metals": { "branch": "main", "commit": "f763b65fd71cb17d544753194fd91090e611c6e0" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, - "nvim-treesitter": { "branch": "master", "commit": "93ce9feb4fabbb37b3e7f47d80f27be778f4d956" }, - "nvim-treesitter-context": { "branch": "master", "commit": "198720b4016af04c9590f375d714d5bf8afecc1a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, + "nvim-treesitter": { "branch": "master", "commit": "85168f15808d89b0222313652b9d2777eda3cb08" }, + "nvim-treesitter-context": { "branch": "master", "commit": "93b29a32d5f4be10e39226c6b796f28d68a8b483" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, + "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, - "telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-characterize": { "branch": "master", "commit": "a8bffac6cead6b2869d939ecad06312b187a4c79" }, @@ -60,16 +60,17 @@ "vim-highlightedyank": { "branch": "master", "commit": "285a61425e79742997bbde76a91be6189bc988fb" }, "vim-hocon": { "branch": "main", "commit": "5df6dc1b7c8f5811afe663b0441e6304a729dcaf" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "ceaae754267f9578b6313890596ee34a19c00dad" }, + "vim-kitty": { "branch": "main", "commit": "cb2ecc9a08638c20f22dade37683a3e8e1ba657b" }, "vim-ledger": { "branch": "master", "commit": "aabf1976dfefe5665233c600421aea2798ff7ea0" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, - "vim-pass": { "branch": "master", "commit": "71adc31459d2ebd5d51c9d8214b111be8c86b833" }, + "vim-pass": { "branch": "master", "commit": "50632446a7887ef6334d1f2c718b9c4feff9bb6c" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "096a0450261abccb7944630fae66788712be46a8" }, + "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, + "vimtex": { "branch": "master", "commit": "bcb14eb6e3739f0c1902115a710292bc37c62d2e" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 64f1731..453fcb3 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -50,6 +50,7 @@ return { plugins = { rope_autoimport = { enabled = true }, isort = { enabled = true }, + pycodestyle = { maxLineLength = 120 }, }, }, }, @@ -57,6 +58,18 @@ return { lemminx = { settings = { xml = { server = { workDir = "~/.cache/lemminx" } } }, }, + tinymist = { + --- todo: these configuration from lspconfig maybe broken + single_file_support = true, + root_dir = function() + return vim.fn.getcwd() + end, + --- See [Tinymist Server Configuration](https://github.com/Myriad-Dreamin/tinymist/blob/main/Configuration.md) for references. + settings = { + exportPdf = "onType", + outputPath = "$root/target/$dir/$name", + }, + }, }, -- you can do any additional lsp server setup here -- return true if you don't want this server to be setup with lspconfig