From 804c104146742dc9c4e83e83d4e8f64db7647703 Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 17 May 2024 10:07:24 +0200 Subject: [PATCH 1/6] dev --- lua/plugins/completion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index a9c102f..95199de 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -155,7 +155,7 @@ return { { -- gh copilot 'zbirenbaum/copilot.lua', - enabled = false, + enabled = true, config = function() require('copilot').setup { suggestion = { From edd78f62c08a3a3bb8d9d775fb1ec19ddac32bbf Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 17 May 2024 15:42:11 +0200 Subject: [PATCH 2/6] feat: virtual text for dap --- lua/config/keymap.lua | 6 +++++ lua/plugins/debugging.lua | 49 +++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index 16332a1..ddad173 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -285,8 +285,14 @@ wk.register({ i = { new_terminal_ipython, 'new [i]python terminal' }, j = { new_terminal_julia, 'new [j]ulia terminal' }, }, + e = { + name = '[e]dit', + }, d = { name = '[d]ebug', + t = { + name = '[t]est', + }, }, f = { name = '[f]ind (telescope)', diff --git a/lua/plugins/debugging.lua b/lua/plugins/debugging.lua index 7ad09c2..fcb986d 100644 --- a/lua/plugins/debugging.lua +++ b/lua/plugins/debugging.lua @@ -27,22 +27,57 @@ return { 'nvim-neotest/nvim-nio', 'rcarriga/nvim-dap-ui', 'mfussenegger/nvim-dap-python', + 'theHamsta/nvim-dap-virtual-text', }, }, config = function() vim.fn.sign_define('DapBreakpoint', { text = '🦆', texthl = '', linehl = '', numhl = '' }) + local dap = require 'dap' + local ui = require 'dapui' require('dapui').setup() require('dap-python').setup() require('dap.ext.vscode').load_launchjs 'launch.json' + + require('nvim-dap-virtual-text').setup { + -- Hides tokens, secrets, and other sensitive information + -- From TJ DeVries' config + -- Not necessary, but also can't hurt + display_callback = function(variable) + local name = string.lower(variable.name) + local value = string.lower(variable.value) + if name:match 'secret' or name:match 'api' or value:match 'secret' or value:match 'api' then + return '*****' + end + + if #variable.value > 15 then + return ' ' .. string.sub(variable.value, 1, 15) .. '... ' + end + + return ' ' .. variable.value + end, + } + + dap.listeners.before.attach.dapui_config = function() + ui.open() + end + dap.listeners.before.launch.dapui_config = function() + ui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + ui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + ui.close() + end end, keys = { - { 'db', ":lua require'dap'.toggle_breakpoint()", desc = 'debug breakpoint' }, - { 'dc', ": lua require'dap'.continue()", desc = 'debug' }, - { 'do', ": lua require'dap'.step_over()", desc = 'debug over' }, - { 'dO', ": lua require'dap'.step_out()", desc = 'debug out' }, - { 'di', ": lua require'dap'.step_into()", desc = 'debug into' }, - { 'dr', ": lua require'dap'.repl_open()", desc = 'debug repl' }, - { 'du', ": lua require'dapui'.toggle()", desc = 'debug ui' }, + { 'db', ":lua require'dap'.toggle_breakpoint()", desc = 'debug [b]reakpoint' }, + { 'dc', ":lua require'dap'.continue()", desc = 'debug [c]ontinue' }, + { 'do', ":lua require'dap'.step_over()", desc = 'debug [o]ver' }, + { 'dO', ":lua require'dap'.step_out()", desc = 'debug [O]ut' }, + { 'di', ":lua require'dap'.step_into()", desc = 'debug [i]nto' }, + { 'dr', ":lua require'dap'.repl_open()", desc = 'debug [r]epl' }, + { 'du', ":lua require'dapui'.toggle()", desc = 'debug [u]i' }, }, }, } From 4e3e3abf7d267cfa109ad3d9e1a9cb9d7b52184a Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 17 May 2024 15:42:25 +0200 Subject: [PATCH 3/6] feat: oil.nvim to edit the filesystem as a buffer --- lua/plugins/ui.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 5d41213..c7d0105 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -116,6 +116,26 @@ return { opts = { signs = false }, }, + { -- edit the file system as a buffer + 'stevearc/oil.nvim', + opts = { + keymaps = { + [''] = false, + [''] = false, + [''] = false, + }, + view_options = { + show_hidden = true, + }, + }, + dependencies = { 'nvim-tree/nvim-web-devicons' }, + keys = { + { '-', ':Oil', desc = 'oil' }, + { 'ef', ':Oil', desc = 'edit [f]iles' }, + }, + cmd = 'Oil', + }, + { -- statusline -- PERF: I found this to slow down the editor 'nvim-lualine/lualine.nvim', From 8b7eb4276c4f903d2b923bfa55d06600b7f96d0d Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 17 May 2024 16:16:26 +0200 Subject: [PATCH 4/6] test cute colorschemes --- lua/config/global.lua | 3 +++ lua/plugins/colorthemes.lua | 37 ++++++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/lua/config/global.lua b/lua/config/global.lua index 284465b..0861819 100644 --- a/lua/config/global.lua +++ b/lua/config/global.lua @@ -5,6 +5,9 @@ local animals = require('misc.style').animals -- proper colors vim.opt.termguicolors = true +-- show insert mode in terminal buffers +vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) + -- disable fill chars (the ~ after the buffer) vim.o.fillchars = 'eob: ' diff --git a/lua/plugins/colorthemes.lua b/lua/plugins/colorthemes.lua index cc30eeb..02cb21a 100644 --- a/lua/plugins/colorthemes.lua +++ b/lua/plugins/colorthemes.lua @@ -5,17 +5,7 @@ return { { 'catppuccin/nvim', name = 'catppuccin', - -- using new default on nvim 0.10 now for a while to test - enabled = function() - -- only enabled catppuccin on lower versions - local has_new_default_theme = vim.fn.has 'nvim-0.10' == 1 - if has_new_default_theme then - -- change cursor color for terminal insert mode - -- (because cursor shape does not change for now) - vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) - end - return not has_new_default_theme - end, + enabled = false, lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() @@ -26,6 +16,31 @@ return { vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) end, }, + + { + 'oxfist/night-owl.nvim', + enabled = true, + lazy = false, + priority = 1000, + config = function() + -- load the colorscheme here + require('night-owl').setup() + vim.cmd.colorscheme 'night-owl' + vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) + end, + }, + + { + 'rebelot/kanagawa.nvim', + enabled = false, + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme 'kanagawa' + vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' }) + end, + }, + { 'olimorris/onedarkpro.nvim', enabled = false, From bb01a8866102e87b73f997c7177d963fd66e3b4d Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Fri, 17 May 2024 16:35:32 +0200 Subject: [PATCH 5/6] feat: kanagawa colorscheme --- lua/plugins/colorthemes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/colorthemes.lua b/lua/plugins/colorthemes.lua index 02cb21a..71196e1 100644 --- a/lua/plugins/colorthemes.lua +++ b/lua/plugins/colorthemes.lua @@ -19,7 +19,7 @@ return { { 'oxfist/night-owl.nvim', - enabled = true, + enabled = false, lazy = false, priority = 1000, config = function() @@ -32,7 +32,7 @@ return { { 'rebelot/kanagawa.nvim', - enabled = false, + enabled = true, lazy = false, priority = 1000, config = function() From 887f7986091c386fba8d44f0414930250b4022d5 Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Thu, 20 Jun 2024 11:49:03 +0200 Subject: [PATCH 6/6] feat: json ls --- lua/plugins/lsp.lua | 7 ++++++- lua/plugins/ui.lua | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index beb2a4b..387bdd0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -144,12 +144,17 @@ return { yaml = { schemaStore = { enable = true, - url = '', + -- url = '', }, }, }, } + lspconfig.jsonls.setup { + capabilities = capabilities, + flags = lsp_flags, + } + lspconfig.dotls.setup { capabilities = capabilities, flags = lsp_flags, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 9ec17c0..9b8fcd8 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -51,7 +51,6 @@ return { vimgrep_arguments = vimgrep_arguments, file_ignore_patterns = { 'node_modules', - '%_files/', '%_cache', '.git/', 'site_libs',