From 861cac2c02d0d6fb707447d240d70bc9d987776a Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 28 Feb 2025 18:12:19 +0100 Subject: [PATCH] wip --- init.lua | 5 +++-- lua/config/redir.lua | 33 +-------------------------------- lua/kickstart/health.lua | 4 +++- lua/plugins/colorthemes.lua | 11 +++++++++++ lua/plugins/common.lua | 10 ++++------ lua/plugins/completion.lua | 9 +++++---- lua/plugins/editing.lua | 2 ++ lua/plugins/lsp.lua | 29 ++++++++++++++++++----------- lua/plugins/ui.lua | 9 --------- 9 files changed, 47 insertions(+), 65 deletions(-) diff --git a/init.lua b/init.lua index 66bb39a..be8bc51 100644 --- a/init.lua +++ b/init.lua @@ -18,6 +18,7 @@ require 'config.global' require 'config.lazy' require 'config.autocommands' --- require 'config.redir' +require 'config.redir' -vim.cmd.colorscheme 'kanagawa' +vim.cmd.colorscheme 'rusty' +vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) diff --git a/lua/config/redir.lua b/lua/config/redir.lua index 7757b93..7c3f381 100644 --- a/lua/config/redir.lua +++ b/lua/config/redir.lua @@ -140,39 +140,8 @@ vim.api.nvim_create_user_command("Redir", redir, { range = true, bang = true, }) -vim.cmd([[cabbrev R Redir]]) -vim.api.nvim_create_user_command("Mes", function() +vim.api.nvim_create_user_command("Messsages", function() vim.cmd("Redir messages") end, { bar = true }) -vim.cmd([[cabbrev M Mes]]) -local function evaler(range) - return function(bang) - local line = vim.fn.getline(1) - local it = string.match(line, "^#!(.*)") - - local cmd = string.format("%sRedir%s !", range, bang and "!" or "") - - if it and it ~= "" then - vim.cmd(cmd .. it) - else - vim.fn.feedkeys(":" .. cmd, "tn") - end - end -end - -vim.api.nvim_create_user_command("EvalFile", function(args) - local bang = args.bang - evaler("%")(bang) -end, { bar = true, bang = true }) - -vim.api.nvim_create_user_command("EvalLine", function(args) - local bang = args.bang - evaler(".")(bang) -end, { bar = true, bang = true }) - -vim.api.nvim_create_user_command("EvalRange", function(args) - local bang = args.bang - evaler("'<,'>")(bang) -end, { bar = true, bang = true, range = true }) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index fa22d44..e457a37 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -79,6 +79,7 @@ local check_image_dependencies = function() end local v = vim.version.parse(kitty_version) local minimal = vim.version.parse '0.30.1' + assert(minimal, 'failed to parse version') if v and vim.version.cmp(v, minimal) < 0 then vim.health.warn 'kitty version is too old' return @@ -107,6 +108,7 @@ local check_image_dependencies = function() local version = out:gsub('tmux (%d+%.%d+)([a-z])', '%1.' .. number) local v = vim.version.parse(version) local minimal = vim.version.parse '3.3.1' + assert(minimal, 'failed to parse version') if v and vim.version.cmp(v, minimal) < 0 then vim.health.warn 'tmux version is too old' return @@ -114,7 +116,7 @@ local check_image_dependencies = function() end -- check if magick luarock is available - local ok, magick = pcall(require, 'magick') + local ok, _ = pcall(require, 'magick') if not ok then vim.health.warn 'magick luarock is not available' return diff --git a/lua/plugins/colorthemes.lua b/lua/plugins/colorthemes.lua index 0b04661..d2b39dd 100644 --- a/lua/plugins/colorthemes.lua +++ b/lua/plugins/colorthemes.lua @@ -11,6 +11,17 @@ return { priority = 1000, -- make sure to load this before all the other start plugins }, + { + "armannikoyan/rusty", + lazy = false, + priority = 1000, + opts = { + transparent = true, + italic_comments = true, + underline_current_line = true, + }, + }, + { 'oxfist/night-owl.nvim', enabled = false, diff --git a/lua/plugins/common.lua b/lua/plugins/common.lua index 6a84a86..a3cea31 100644 --- a/lua/plugins/common.lua +++ b/lua/plugins/common.lua @@ -7,12 +7,10 @@ return { lazy = false, opts = { styles = {}, - bigfile = { enabled = true, notify = false }, - notifier = { enabled = false }, - quickfile = { enabled = true }, - statuscolumn = { enabled = false }, - words = { enabled = false }, - picker = {} + bigfile = { notify = false }, + quickfile = {}, + picker = {}, + indent = {} }, }, } diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index 1c95d44..a0f2d0d 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -26,7 +26,7 @@ return { }, { 'jmbuhr/cmp-pandoc-references', - dev = false, + dev = true, ft = { 'quarto', 'markdown', 'rmarkdown' }, }, { 'kdheepak/cmp-latex-symbols' }, @@ -39,13 +39,13 @@ return { [''] = { 'show_documentation', 'hide_documentation' }, }, sources = { - default = { "lazydev", "lsp", "path", "git", "snippets", "buffer", "emoji" }, + default = { "lazydev", "lsp", "path", "references", "git", "snippets", "buffer", "emoji" }, cmdline = {}, providers = { emoji = { module = "blink-emoji", name = "Emoji", - score_offset = 15, -- Tune by preference + score_offset = -1, }, lazydev = { name = "LazyDev", @@ -63,7 +63,8 @@ return { }, references = { name = "pandoc_references", - module = "blink.compat.source", + module = "cmp-pandoc-references.blink", + score_offset = 2, }, symbols = { name = "symbols", module = "blink.compat.source" }, }, diff --git a/lua/plugins/editing.lua b/lua/plugins/editing.lua index 993a9a7..66826a2 100644 --- a/lua/plugins/editing.lua +++ b/lua/plugins/editing.lua @@ -40,6 +40,8 @@ return { lua = { 'mystylua' }, python = { 'isort', 'black' }, quarto = { 'injected' }, + markdown = { 'injected' }, + r = { 'styler' }, }, formatters = { mystylua = { diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index e87bdae..22c267c 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -2,19 +2,14 @@ return { { -- for lsp features in code cells / embedded code 'jmbuhr/otter.nvim', - dev = true, + dev = false, dependencies = { { 'neovim/nvim-lspconfig', 'nvim-treesitter/nvim-treesitter', }, }, - opts = { - buffers = { - set_filetype = true, - write_to_disk = false - } - } + opts = {} }, { @@ -93,11 +88,23 @@ return { map('gI', vim.lsp.buf.implementation, '[g]o to [I]mplementation') map('gr', vim.lsp.buf.references, '[g]o to [r]eferences') map(']d', - function() if vim.fn.has("nvim-0.11.0") == 1 then vim.diagnostic.jump({ count = 1 }) else vim.diagnostic - .goto_next() end end, 'next [d]iagnostic ') + function() + if vim.fn.has("nvim-0.11.0") == 1 then + vim.diagnostic.jump({ count = 1 }) + else + vim.diagnostic + .goto_next() + end + end, 'next [d]iagnostic ') map('[d', - function() if vim.fn.has("nvim-1.11.0") == 1 then vim.diagnostic.jump({ count = -1 }) else vim.diagnostic - .goto_prev() end end, 'previous [d]iagnostic ') + function() + if vim.fn.has("nvim-1.11.0") == 1 then + vim.diagnostic.jump({ count = -1 }) + else + vim.diagnostic + .goto_prev() + end + end, 'previous [d]iagnostic ') map('ll', vim.lsp.codelens.run, '[l]ens run') map('lR', vim.lsp.buf.rename, '[l]sp [R]ename') map('lf', vim.lsp.buf.format, '[l]sp [f]ormat') diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 6985f6a..78a05dc 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -373,15 +373,6 @@ return { end, }, - { -- show indent lines - 'lukas-reineke/indent-blankline.nvim', - enabled = false, - main = 'ibl', - opts = { - indent = { char = '│' }, - }, - }, - { -- highlight markdown headings and code blocks etc. 'lukas-reineke/headlines.nvim', enabled = false,