From 6b1e93235ab8ecd30027df7f7bed86039ede71a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:02:05 +0100 Subject: [PATCH 01/16] Wezterm update --- wezterm/.config/wezterm/wezterm.lua | 111 ++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index da5ce99..653dcb0 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -5,5 +5,116 @@ return { font_size=10, color_scheme = "GruvboxDark", use_fancy_tab_bar = false, + keys = { + { + key = 'h', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Left', + }, + { + key = 'l', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Right', + }, + { + key = 'k', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Up', + }, + { + key = 'j', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Down', + }, + { + key = 'LeftArrow', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Left', + size = {Percent = 50}, + }, + }, + { + key = 'l', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Right', + size = {Percent = 50}, + }, + }, + { + key = 'k', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Up', + size = {Percent = 50}, + }, + }, + { + key = 'j', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Down', + size = {Percent = 50}, + }, + }, + { key = 'g', mods = 'ALT', action = wezterm.action.ShowLauncher }, + { key = 't', mods = 'ALT', action = wezterm.action.ShowTabNavigator }, + { + key = 't', + mods = 'SHIFT|ALT', + action = wezterm.action.SpawnTab 'CurrentPaneDomain', + }, + { + key = "1", + mods = 'ALT', + action = wezterm.action.ActivateTab(0), + }, + { + key = "2", + mods = 'ALT', + action = wezterm.action.ActivateTab(1), + }, + { + key = "3", + mods = 'ALT', + action = wezterm.action.ActivateTab(2), + }, + { + key = "4", + mods = 'ALT', + action = wezterm.action.ActivateTab(3), + }, + { + key = "5", + mods = 'ALT', + action = wezterm.action.ActivateTab(4), + }, + { + key = "6", + mods = 'ALT', + action = wezterm.action.ActivateTab(5), + }, + { + key = "7", + mods = 'ALT', + action = wezterm.action.ActivateTab(6), + }, + { + key = "8", + mods = 'ALT', + action = wezterm.action.ActivateTab(7), + }, + { + key = "9", + mods = 'ALT', + action = wezterm.action.ActivateTab(8), + }, + { + key = "0", + mods = 'ALT', + action = wezterm.action.ActivateTab(9), + }, + }, } From fa169166894d7d72cd93a8991369015bf07fe747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:02:27 +0100 Subject: [PATCH 02/16] none ls for black formatting in nvim --- nvim/.config/nvim/lua/plugins.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index e7bb471..e5bcc0b 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -35,7 +35,14 @@ M.setup = function() { "neovim/nvim-lspconfig" }, { "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/nvim-cmp" }, - { "L3MON4D3/LuaSnip" }, + { "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + null_ls.builtins.formatting.black + }) + end + }, { "morhetz/gruvbox" }, { "nvim-neo-tree/neo-tree.nvim", From df0499fc3cb8f5bdc9668d9b4525bb6ec855d479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:08:45 +0100 Subject: [PATCH 03/16] ctw git config --- git/.gitconfig | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index b12b647..b3c7c24 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,25 +1,8 @@ [user] - email = joaj.freitas@gmail.com - name = João Freitas - signingkey = 7ED1B2BB849809852B25C6ECE7EF5BDBBED2E1E6 -[commit] - gpgsign = true + email = joao.mc.freitas@ctw.bmwgroup.com + name = João Freitas [core] editor = nvim - attributesfile = ~/.config/git/attributes - hooksPath=hooks - whitespace = trailing-space,space-before-tab -[merge "json"] - name = custom merge driver for json files - driver = git-json-merge %A %O %B -[filter "lfs"] - required = true - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process + whitespace = trailing-space,space-before-tab [apply] whitespace = fix -[rerere] - enabled = true -[push] - recurseSubmodules = check From 54de91223b69f3270da9328cf2ce2030dffe993a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:09:03 +0100 Subject: [PATCH 04/16] ctw aliases --- ctw/.ctw.aliases | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ctw/.ctw.aliases diff --git a/ctw/.ctw.aliases b/ctw/.ctw.aliases new file mode 100644 index 0000000..5dc2261 --- /dev/null +++ b/ctw/.ctw.aliases @@ -0,0 +1,6 @@ +alias clang-format-adp='bazel run //bazel/tools/clang_format:fix' +alias clang-check-adp='bazel run //bazel/tools/clang_format:check application/adp' +alias buildifier='bazel run //bazel/tools/buildifier:fix' +alias klockwork='bazel run //application/adp/tools/klocwork:klocwork_analysis -- -t "//application/adp/activities/driver:driver_activity" -o ~/klocwork' +alias carmen='wine "/home/joaj/.wine/drive_c/Program Files (x86)/Systemtesttools/CARMEN/bin/TopEd.exe"' +alias mapr='sshfs jmfreitas1@bmwdpdesp000104.advantagedp.org:/maprposix /home/joaj/mapr' From c12adba8dd2283ee086623e2fdb3b9d604c7194b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:10:38 +0100 Subject: [PATCH 05/16] format wezterm config --- wezterm/.config/wezterm/wezterm.lua | 182 ++++++++++------------------ 1 file changed, 67 insertions(+), 115 deletions(-) diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index 653dcb0..9c9201c 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -1,120 +1,72 @@ local wezterm = require 'wezterm' return { - font = wezterm.font 'FiraCode', - font_size=10, - color_scheme = "GruvboxDark", - use_fancy_tab_bar = false, - keys = { - { - key = 'h', - mods = 'ALT', - action = wezterm.action.ActivatePaneDirection 'Left', - }, - { - key = 'l', - mods = 'ALT', - action = wezterm.action.ActivatePaneDirection 'Right', - }, - { - key = 'k', - mods = 'ALT', - action = wezterm.action.ActivatePaneDirection 'Up', - }, - { - key = 'j', - mods = 'ALT', - action = wezterm.action.ActivatePaneDirection 'Down', - }, - { - key = 'LeftArrow', - mods = 'ALT|SHIFT', - action = wezterm.action.SplitPane { - direction = 'Left', - size = {Percent = 50}, - }, - }, - { - key = 'l', - mods = 'ALT|SHIFT', - action = wezterm.action.SplitPane { - direction = 'Right', - size = {Percent = 50}, - }, - }, - { - key = 'k', - mods = 'ALT|SHIFT', - action = wezterm.action.SplitPane { - direction = 'Up', - size = {Percent = 50}, - }, - }, - { - key = 'j', - mods = 'ALT|SHIFT', - action = wezterm.action.SplitPane { - direction = 'Down', - size = {Percent = 50}, - }, - }, - { key = 'g', mods = 'ALT', action = wezterm.action.ShowLauncher }, - { key = 't', mods = 'ALT', action = wezterm.action.ShowTabNavigator }, - { - key = 't', - mods = 'SHIFT|ALT', - action = wezterm.action.SpawnTab 'CurrentPaneDomain', - }, - { - key = "1", - mods = 'ALT', - action = wezterm.action.ActivateTab(0), - }, - { - key = "2", - mods = 'ALT', - action = wezterm.action.ActivateTab(1), - }, - { - key = "3", - mods = 'ALT', - action = wezterm.action.ActivateTab(2), - }, - { - key = "4", - mods = 'ALT', - action = wezterm.action.ActivateTab(3), - }, - { - key = "5", - mods = 'ALT', - action = wezterm.action.ActivateTab(4), - }, - { - key = "6", - mods = 'ALT', - action = wezterm.action.ActivateTab(5), - }, - { - key = "7", - mods = 'ALT', - action = wezterm.action.ActivateTab(6), - }, - { - key = "8", - mods = 'ALT', - action = wezterm.action.ActivateTab(7), - }, - { - key = "9", - mods = 'ALT', - action = wezterm.action.ActivateTab(8), - }, - { - key = "0", - mods = 'ALT', - action = wezterm.action.ActivateTab(9), - }, - }, + font = wezterm.font 'FiraCode', + font_size = 10, + color_scheme = "GruvboxDark", + use_fancy_tab_bar = false, + keys = { + { + key = 'h', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Left' + }, { + key = 'l', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Right' + }, + { + key = 'k', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Up' + }, + { + key = 'j', + mods = 'ALT', + action = wezterm.action.ActivatePaneDirection 'Down' + }, { + key = 'LeftArrow', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Left', + size = {Percent = 50} + } + }, { + key = 'l', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Right', + size = {Percent = 50} + } + }, { + key = 'k', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Up', + size = {Percent = 50} + } + }, { + key = 'j', + mods = 'ALT|SHIFT', + action = wezterm.action.SplitPane { + direction = 'Down', + size = {Percent = 50} + } + }, {key = 'g', mods = 'ALT', action = wezterm.action.ShowLauncher}, + {key = 't', mods = 'ALT', action = wezterm.action.ShowTabNavigator}, { + key = 't', + mods = 'SHIFT|ALT', + action = wezterm.action.SpawnTab 'CurrentPaneDomain' + }, {key = "1", mods = 'ALT', action = wezterm.action.ActivateTab(0)}, + {key = "2", mods = 'ALT', action = wezterm.action.ActivateTab(1)}, + {key = "3", mods = 'ALT', action = wezterm.action.ActivateTab(2)}, + {key = "4", mods = 'ALT', action = wezterm.action.ActivateTab(3)}, + {key = "5", mods = 'ALT', action = wezterm.action.ActivateTab(4)}, + {key = "6", mods = 'ALT', action = wezterm.action.ActivateTab(5)}, + {key = "7", mods = 'ALT', action = wezterm.action.ActivateTab(6)}, + {key = "8", mods = 'ALT', action = wezterm.action.ActivateTab(7)}, + {key = "9", mods = 'ALT', action = wezterm.action.ActivateTab(8)}, + {key = "0", mods = 'ALT', action = wezterm.action.ActivateTab(9)} + } } From 540450b339658aee0e577b2d55ac4c7ff752bb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Tue, 17 Sep 2024 14:11:25 +0100 Subject: [PATCH 06/16] Format neovim config --- nvim/.config/nvim/init.lua | 18 +- nvim/.config/nvim/lua/colorscheme.lua | 6 +- nvim/.config/nvim/lua/keybindings.lua | 57 ++-- nvim/.config/nvim/lua/lsp.lua | 49 ++- nvim/.config/nvim/lua/lvim.lua | 355 ++++++++++----------- nvim/.config/nvim/lua/plugins.lua | 88 ++--- nvim/.config/nvim/luasnippets/all.lua | 27 +- nvim/.config/nvim/luasnippets/markdown.lua | 133 +++++--- 8 files changed, 370 insertions(+), 363 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index bc380bd..c7b5f8a 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -4,16 +4,16 @@ vim.g.loaded_netrwPlugin = 1 require('plugins').setup() require('lsp').setup() -require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/luasnippets" }) +require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/luasnippets"}) require("telescope").setup({ - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case" + } + } }) require("telescope").load_extension("fzf") require('keybindings').setup() diff --git a/nvim/.config/nvim/lua/colorscheme.lua b/nvim/.config/nvim/lua/colorscheme.lua index c12380d..3008744 100644 --- a/nvim/.config/nvim/lua/colorscheme.lua +++ b/nvim/.config/nvim/lua/colorscheme.lua @@ -1,22 +1,20 @@ local M = {} local sunset = function(month) - local sunset = { 18, 18, 19, 20, 21, 22, 22, 21, 20, 19, 18, 18 } + local sunset = {18, 18, 19, 20, 21, 22, 22, 21, 20, 19, 18, 18} return sunset[month] end local sunrise = function(month) - local sunrise = { 8, 8, 7, 6, 7, 6, 6, 7, 7, 8, 7, 8 } + local sunrise = {8, 8, 7, 6, 7, 6, 6, 7, 7, 8, 7, 8} return sunrise[month] end - M.setup = function() vim.opt.termguicolors = true vim.cmd.colorscheme("gruvbox") local time = os.date("*t") - if time.hour <= sunrise(time.month) or time.hour >= sunset(time.month) then vim.o.background = "dark" else diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index d7a9596..ed97ad2 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -4,39 +4,42 @@ M.setup = function() local telescope_builtin = require("telescope.builtin") local wk = require("which-key") wk.register({ - f = { telescope_builtin.find_files, "Find file" }, - g = { telescope_builtin.git_files, "Find git files" }, + f = {telescope_builtin.find_files, "Find file"}, + g = {telescope_builtin.git_files, "Find git files"}, t = { name = "telescope", - g = { telescope_builtin.live_grep, "Live grep" }, - b = { telescope_builtin.buffers, "Buffers" }, - p = { telescope_builtin.builtin, "Builtin pickers" }, - h = { telescope_builtin.help_tags, "Help tags" }, + g = {telescope_builtin.live_grep, "Live grep"}, + b = {telescope_builtin.buffers, "Buffers"}, + p = {telescope_builtin.builtin, "Builtin pickers"}, + h = {telescope_builtin.help_tags, "Help tags"} }, - e = { "Neotree toggle", "File explorer" }, - s = { "ClangdSwitchSourceHeader", "Switch between source and header" }, - D = { vim.lsp.buf.type_definition, "Lsp type definition" }, - a = { vim.lsp.buf.code_action, "Lsp code action" }, - r = { vim.lsp.buf.rename, "Lsp rename" }, + e = {"Neotree toggle", "File explorer"}, + s = { + "ClangdSwitchSourceHeader", + "Switch between source and header" + }, + D = {vim.lsp.buf.type_definition, "Lsp type definition"}, + a = {vim.lsp.buf.code_action, "Lsp code action"}, + r = {vim.lsp.buf.rename, "Lsp rename"}, z = { name = "zen", - n = { "TZNarrow", "Narrow" }, - f = { "TZFocus", "Focus" }, - m = { "TZMinimalist", "Minimalist" }, - a = { "TZAtaraxis", "Ataraxis" }, - l = { "Limelight", "Limelight" }, - }, - }, { prefix = "" }) + n = {"TZNarrow", "Narrow"}, + f = {"TZFocus", "Focus"}, + m = {"TZMinimalist", "Minimalist"}, + a = {"TZAtaraxis", "Ataraxis"}, + l = {"Limelight", "Limelight"} + } + }, {prefix = ""}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, { silent = true }) - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { silent = true }) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { silent = true }) - vim.keymap.set("n", "go", vim.lsp.buf.type_definition, { silent = true }) - vim.keymap.set("n", "gr", vim.lsp.buf.references, { silent = true }) - vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, { silent = true }) - vim.keymap.set("n", "gl", vim.diagnostic.open_float, { silent = true }) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { silent = true }) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { silent = true }) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {silent = true}) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, {silent = true}) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {silent = true}) + vim.keymap.set("n", "go", vim.lsp.buf.type_definition, {silent = true}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {silent = true}) + vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, {silent = true}) + vim.keymap.set("n", "gl", vim.diagnostic.open_float, {silent = true}) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {silent = true}) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {silent = true}) end return M diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 6c0e84f..37859df 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -1,14 +1,12 @@ local M = {} -M.setup = function() +M.setup = function() local lsp_zero = require("lsp-zero") local lua_opts = lsp_zero.nvim_lua_ls({ single_file_support = false, - on_attach = function(client, bufnr) - print("hello world") - end, + on_attach = function(client, bufnr) print("hello world") end }) require("lspconfig").lua_ls.setup(lua_opts) @@ -16,7 +14,7 @@ M.setup = function() lsp_zero.on_attach(function(client, bufnr) -- see :help lsp-zero-keybindings -- to learn the available actions - lsp_zero.default_keymaps({ buffer = bufnr }) + lsp_zero.default_keymaps({buffer = bufnr}) end) --- if you want to know more about lsp-zero and mason.nvim @@ -26,23 +24,17 @@ M.setup = function() handlers = { function(server_name) require("lspconfig")[server_name].setup({}) - end, - }, + end + } }) require("lspconfig").rust_analyzer.setup({}) require("lspconfig").clangd.setup({}) require("lspconfig").lua_ls.setup({ - settings = { - Lua = { - completion = { - callSnippet = "Replace", - }, - }, - }, + settings = {Lua = {completion = {callSnippet = "Replace"}}} }) - lsp_zero.setup_servers({ "rust_analyzer" }) + lsp_zero.setup_servers({"rust_analyzer"}) local cmp = require("cmp") local cmp_action = require("lsp-zero").cmp_action() @@ -52,7 +44,7 @@ M.setup = function() cmp.setup({ mapping = cmp.mapping.preset.insert({ -- `Enter` key to confirm completion - [""] = cmp.mapping.confirm({ select = false }), + [""] = cmp.mapping.confirm({select = false}), -- Ctrl+Space to trigger completion menu [""] = cmp.mapping.complete(), @@ -63,27 +55,27 @@ M.setup = function() -- Scroll up and down in the completion documentation [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.scroll_docs(4) }), snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) - end, + end }, sources = { - { name = "luasnip" }, - { name = "nvim_lsp" }, - { name = "buffer" }, - { name = "ledger" }, + {name = "luasnip"}, {name = "nvim_lsp"}, {name = "buffer"}, + {name = "ledger"} }, formatting = { format = function(entry, vim_item) - local max_width = 0 --lvim.builtin.cmp.formatting.max_width + local max_width = 0 -- lvim.builtin.cmp.formatting.max_width if max_width ~= 0 and #vim_item.abbr > max_width then - vim_item.abbr = string.sub(vim_item.abbr, 1, max_width - 1) .. lvim.icons.ui.Ellipsis + vim_item.abbr = + string.sub(vim_item.abbr, 1, max_width - 1) .. + lvim.icons.ui.Ellipsis end if lvim.use_icons then - vim_item.kind = lvim.icons.kind[vim_item.kind] --lvim.builtin.cmp.formatting.kind_icons[vim_item.kind] + vim_item.kind = lvim.icons.kind[vim_item.kind] -- lvim.builtin.cmp.formatting.kind_icons[vim_item.kind] if entry.source.name == "copilot" then vim_item.kind = lvim.icons.git.Octoface @@ -111,11 +103,12 @@ M.setup = function() end end vim_item.menu = lvim.formatting.source_names[entry.source.name] - vim_item.dup = lvim.formatting.duplicates[entry.source.name] or lvim.formatting.duplicated_default --builtin.cmp.formatting.duplicates_default + vim_item.dup = lvim.formatting.duplicates[entry.source.name] or + lvim.formatting.duplicated_default -- builtin.cmp.formatting.duplicates_default return vim_item - end, - }, + end + } }) end diff --git a/nvim/.config/nvim/lua/lvim.lua b/nvim/.config/nvim/lua/lvim.lua index 5846299..7061175 100644 --- a/nvim/.config/nvim/lua/lvim.lua +++ b/nvim/.config/nvim/lua/lvim.lua @@ -1,183 +1,178 @@ return { - use_icons = true, - icons = { - kind = { - Array = "", - Boolean = "", - Class = "", - Color = "", - Constant = "", - Constructor = "", - 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 = "", - }, - git = { - LineAdded = "", - LineModified = "", - LineRemoved = "", - FileDeleted = "", - FileIgnored = "◌", - FileRenamed = "", - FileStaged = "S", - FileUnmerged = "", - FileUnstaged = "", - FileUntracked = "U", - Diff = "", - Repo = "", - Octoface = "", - Branch = "", - }, - ui = { - ArrowCircleDown = "", - ArrowCircleLeft = "", - ArrowCircleRight = "", - ArrowCircleUp = "", - BoldArrowDown = "", - BoldArrowLeft = "", - BoldArrowRight = "", - BoldArrowUp = "", - BoldClose = "", - BoldDividerLeft = "", - BoldDividerRight = "", - BoldLineLeft = "▎", - BookMark = "", - BoxChecked = "", - Bug = "", - Stacks = "", - Scopes = "", - Watches = "󰂥", - DebugConsole = "", - Calendar = "", - Check = "", - ChevronRight = "", - ChevronShortDown = "", - ChevronShortLeft = "", - ChevronShortRight = "", - ChevronShortUp = "", - Circle = " ", - Close = "󰅖", - CloudDownload = "", - Code = "", - Comment = "", - Dashboard = "", - DividerLeft = "", - DividerRight = "", - DoubleChevronRight = "»", - Ellipsis = "", - EmptyFolder = "", - EmptyFolderOpen = "", - File = "", - FileSymlink = "", - Files = "", - FindFile = "󰈞", - FindText = "󰊄", - Fire = "", - Folder = "󰉋", - FolderOpen = "", - FolderSymlink = "", - Forward = "", - Gear = "", - History = "", - Lightbulb = "", - LineLeft = "▏", - LineMiddle = "│", - List = "", - Lock = "", - NewFile = "", - Note = "", - Package = "", - Pencil = "󰏫", - Plus = "", - Project = "", - Search = "", - SignIn = "", - SignOut = "", - Tab = "󰌒", - Table = "", - Target = "󰀘", - Telescope = "", - Text = "", - Tree = "", - Triangle = "󰐊", - TriangleShortArrowDown = "", - TriangleShortArrowLeft = "", - TriangleShortArrowRight = "", - TriangleShortArrowUp = "", - }, - diagnostics = { - BoldError = "", - Error = "", - BoldWarning = "", - Warning = "", - BoldInformation = "", - Information = "", - BoldQuestion = "", - Question = "", - BoldHint = "", - Hint = "󰌶", - Debug = "", - Trace = "✎", - }, - misc = { - Robot = "󰚩", - Squirrel = "", - Tag = "", - Watch = "", - Smiley = "", - Package = "", - CircuitBoard = "", - }, - }, + use_icons = true, + icons = { + kind = { + Array = "", + Boolean = "", + Class = "", + Color = "", + Constant = "", + Constructor = "", + 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 = "" + }, + git = { + LineAdded = "", + LineModified = "", + LineRemoved = "", + FileDeleted = "", + FileIgnored = "◌", + FileRenamed = "", + FileStaged = "S", + FileUnmerged = "", + FileUnstaged = "", + FileUntracked = "U", + Diff = "", + Repo = "", + Octoface = "", + Branch = "" + }, + ui = { + ArrowCircleDown = "", + ArrowCircleLeft = "", + ArrowCircleRight = "", + ArrowCircleUp = "", + BoldArrowDown = "", + BoldArrowLeft = "", + BoldArrowRight = "", + BoldArrowUp = "", + BoldClose = "", + BoldDividerLeft = "", + BoldDividerRight = "", + BoldLineLeft = "▎", + BookMark = "", + BoxChecked = "", + Bug = "", + Stacks = "", + Scopes = "", + Watches = "󰂥", + DebugConsole = "", + Calendar = "", + Check = "", + ChevronRight = "", + ChevronShortDown = "", + ChevronShortLeft = "", + ChevronShortRight = "", + ChevronShortUp = "", + Circle = " ", + Close = "󰅖", + CloudDownload = "", + Code = "", + Comment = "", + Dashboard = "", + DividerLeft = "", + DividerRight = "", + DoubleChevronRight = "»", + Ellipsis = "", + EmptyFolder = "", + EmptyFolderOpen = "", + File = "", + FileSymlink = "", + Files = "", + FindFile = "󰈞", + FindText = "󰊄", + Fire = "", + Folder = "󰉋", + FolderOpen = "", + FolderSymlink = "", + Forward = "", + Gear = "", + History = "", + Lightbulb = "", + LineLeft = "▏", + LineMiddle = "│", + List = "", + Lock = "", + NewFile = "", + Note = "", + Package = "", + Pencil = "󰏫", + Plus = "", + Project = "", + Search = "", + SignIn = "", + SignOut = "", + Tab = "󰌒", + Table = "", + Target = "󰀘", + Telescope = "", + Text = "", + Tree = "", + Triangle = "󰐊", + TriangleShortArrowDown = "", + TriangleShortArrowLeft = "", + TriangleShortArrowRight = "", + TriangleShortArrowUp = "" + }, + diagnostics = { + BoldError = "", + Error = "", + BoldWarning = "", + Warning = "", + BoldInformation = "", + Information = "", + BoldQuestion = "", + Question = "", + BoldHint = "", + Hint = "󰌶", + Debug = "", + Trace = "✎" + }, + misc = { + Robot = "󰚩", + Squirrel = "", + Tag = "", + Watch = "", + Smiley = "", + Package = "", + CircuitBoard = "" + } + }, - formatting = { - fields = { "kind", "abbr", "menu" }, - max_width = 0, - --kind_icons = lvim.icons.kind, - source_names = { - nvim_lsp = "(LSP)", - emoji = "(Emoji)", - path = "(Path)", - calc = "(Calc)", - cmp_tabnine = "(Tabnine)", - vsnip = "(Snippet)", - luasnip = "(Snippet)", - buffer = "(Buffer)", - tmux = "(TMUX)", - copilot = "(Copilot)", - treesitter = "(TreeSitter)", - }, - duplicates = { - buffer = 1, - path = 1, - nvim_lsp = 0, - luasnip = 1, - }, - duplicates_default = 0, - }, + formatting = { + fields = {"kind", "abbr", "menu"}, + max_width = 0, + -- kind_icons = lvim.icons.kind, + source_names = { + nvim_lsp = "(LSP)", + emoji = "(Emoji)", + path = "(Path)", + calc = "(Calc)", + cmp_tabnine = "(Tabnine)", + vsnip = "(Snippet)", + luasnip = "(Snippet)", + buffer = "(Buffer)", + tmux = "(TMUX)", + copilot = "(Copilot)", + treesitter = "(TreeSitter)" + }, + duplicates = {buffer = 1, path = 1, nvim_lsp = 0, luasnip = 1}, + duplicates_default = 0 + } } diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index e5bcc0b..6135928 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -8,12 +8,9 @@ M.setup = function() if not uv.fs_stat(lazypath) then print("Installing lazy.nvim....") vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", "--branch=stable", + lazypath }) print("Done.") end @@ -21,80 +18,55 @@ M.setup = function() vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - { - "folke/neodev.nvim", - config = function() - require("neodev").setup() - end, - }, - { "tpope/vim-fugitive" }, - { "lunarvim/lunar.nvim" }, - { "VonHeikemen/lsp-zero.nvim", branch = "v3.x" }, - { "williamboman/mason.nvim" }, - { "williamboman/mason-lspconfig.nvim" }, - { "neovim/nvim-lspconfig" }, - { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/nvim-cmp" }, - { "nvimtools/none-ls.nvim", + {"folke/neodev.nvim", config = function() + require("neodev").setup() + end}, {"tpope/vim-fugitive"}, {"lunarvim/lunar.nvim"}, + {"VonHeikemen/lsp-zero.nvim", branch = "v3.x"}, + {"williamboman/mason.nvim"}, {"williamboman/mason-lspconfig.nvim"}, + {"neovim/nvim-lspconfig"}, {"hrsh7th/cmp-nvim-lsp"}, + {"hrsh7th/nvim-cmp"}, { + "nvimtools/none-ls.nvim", config = function() local null_ls = require("null-ls") - null_ls.setup({ - null_ls.builtins.formatting.black - }) + null_ls.setup({null_ls.builtins.formatting.black}) end - }, - { "morhetz/gruvbox" }, - { + }, {"morhetz/gruvbox"}, { "nvim-neo-tree/neo-tree.nvim", branch = "v3.x", dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "3rd/image.nvim", + "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", "3rd/image.nvim" }, config = function() require("neo-tree").setup({ - source_selector = { - statusline = true, - }, + source_selector = {statusline = true} }) - end, + end }, - { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, { + "nvim-telescope/telescope.nvim", + dependencies = {"nvim-lua/plenary.nvim"} + }, { "nvim-telescope/telescope-fzf-native.nvim", - build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release", - }, - { + build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" + }, { "folke/which-key.nvim", event = "VeryLazy", init = function() vim.o.timeout = true vim.o.timeoutlen = 300 - end, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, + end }, - { "saadparwaiz1/cmp_luasnip" }, - { "pocco81/true-zen.nvim" }, - { "junegunn/limelight.vim" }, + {"L3MON4D3/LuaSnip", dependencies = {"rafamadriz/friendly-snippets"}}, + {"saadparwaiz1/cmp_luasnip"}, {"pocco81/true-zen.nvim"}, + {"junegunn/limelight.vim"}, { "FabijanZulj/blame.nvim", - config = function() - require("blame").setup() - end, - }, - { "ledger/vim-ledger" }, - { "piero-vic/cmp-ledger" }, - { + config = function() require("blame").setup() end + }, {"ledger/vim-ledger"}, {"piero-vic/cmp-ledger"}, { "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - end, - }, + config = function() require("gitsigns").setup() end + } }) end diff --git a/nvim/.config/nvim/luasnippets/all.lua b/nvim/.config/nvim/luasnippets/all.lua index 40ff7ae..8abce05 100644 --- a/nvim/.config/nvim/luasnippets/all.lua +++ b/nvim/.config/nvim/luasnippets/all.lua @@ -1,14 +1,17 @@ return { - s("copyright", {t("// Copyright "), f(function () return os.date("%Y") end), t(" João Freitas")}), - s("gpl3", - t({ "// This program is free software: you can redistribute it and/or modify it under the terms of", - "// the GNU General Public License as published by the Free Software Foundation, either", - "// version 3 of the License, or (at your option) any later version.", - "//", - "// This program is distributed in the hope that it will be useful, but WITHOUT ANY", - "// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR", - "// A PARTICULAR PURPOSE. See the GNU General Public License for more details.", - "//", - "// You should have received a copy of the GNU General Public License along with this", - "// program. If not, see ." })), + s("copyright", { + t("// Copyright "), f(function() return os.date("%Y") end), + t(" João Freitas") + }), s("gpl3", t({ + "// This program is free software: you can redistribute it and/or modify it under the terms of", + "// the GNU General Public License as published by the Free Software Foundation, either", + "// version 3 of the License, or (at your option) any later version.", + "//", + "// This program is distributed in the hope that it will be useful, but WITHOUT ANY", + "// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR", + "// A PARTICULAR PURPOSE. See the GNU General Public License for more details.", + "//", + "// You should have received a copy of the GNU General Public License along with this", + "// program. If not, see ." + })) } diff --git a/nvim/.config/nvim/luasnippets/markdown.lua b/nvim/.config/nvim/luasnippets/markdown.lua index b26cc9c..8993c31 100644 --- a/nvim/.config/nvim/luasnippets/markdown.lua +++ b/nvim/.config/nvim/luasnippets/markdown.lua @@ -1,55 +1,98 @@ -local function snippet_datetime (d) - return os.date("%Y-%m-%dT%H:%M:%SZ", d) -end +local function snippet_datetime(d) return os.date("%Y-%m-%dT%H:%M:%SZ", d) end -local function snippet_date (d) - return os.date("%Y-%m-%d", d) -end +local function snippet_date(d) return os.date("%Y-%m-%d", d) end local function end_of_day(t) - d = os.date("*t", t) - d.hour =23 - d.min = 59 - d.sec = 59 - t = os.time(d) - return snippet_datetime(t) + d = os.date("*t", t) + d.hour = 23 + d.min = 59 + d.sec = 59 + t = os.time(d) + return snippet_datetime(t) end local function run(command) - local handle = io.popen('brian task id /home/joaj/sources/wiki/journal/2024.md') - local output = handle:read('*a') - local result = output:gsub('[\n\r]', '') - handle:close() - return tostring(result) + local handle = io.popen( + 'brian task id /home/joaj/sources/wiki/journal/2024.md') + local output = handle:read('*a') + local result = output:gsub('[\n\r]', '') + handle:close() + return tostring(result) end return { - s("date", {f(function () return snippet_date(os.time()) end)} ), - s("t0", { f(function () return snippet_datetime(os.time()) end) }), - s("t1", { f(function () return snippet_datetime(os.time() + 1*24*60*60) end) }), - s("t2", { f(function () return snippet_datetime(os.time() + 2*24*60*60) end) }), - s("t3", { f(function () return snippet_datetime(os.time() + 3*24*60*60) end) }), - s("t4", { f(function () return snippet_datetime(os.time() + 4*24*60*60) end) }), - s("t5", { f(function () return snippet_datetime(os.time() + 5*24*60*60) end) }), - s("t6", { f(function () return snippet_datetime(os.time() + 6*24*60*60) end) }), - s("t7", { f(function () return snippet_datetime(os.time() + 7*24*60*60) end) }), - s("t15", { f(function () return snippet_datetime(os.time() + 15*24*60*60) end) }), - s("t30", { f(function () return snippet_datetime(os.time() + 30*24*60*60) end) }), - s("t60", { f(function () return snippet_datetime(os.time() + 60*24*60*60) end) }), - s("te0", { f(function () return end_of_day(os.time()) end) }), - s("te1", { f(function () return end_of_day(os.time() + 1*24*60*60) end) }), - s("te2", { f(function () return end_of_day(os.time() + 2*24*60*60) end) }), - s("te3", { f(function () return end_of_day(os.time() + 3*24*60*60) end) }), - s("te4", { f(function () return end_of_day(os.time() + 4*24*60*60) end) }), - s("te5", { f(function () return end_of_day(os.time() + 5*24*60*60) end) }), - s("te6", { f(function () return end_of_day(os.time() + 6*24*60*60) end) }), - s("te7", { f(function () return end_of_day(os.time() + 7*24*60*60) end) }), - s("te15", { f(function () return end_of_day(os.time() + 15*24*60*60) end) }), - s("te30", { f(function () return end_of_day(os.time() + 30*24*60*60) end) }), - s("te60", { f(function () return end_of_day(os.time() + 60*24*60*60) end) }), - s("task-add", {t("(task-add "), f(function () return run("brian task task-id /home/joaj/sources/wiki/journal/2024.md") end), t(" d#"), f(function () return snippet_datetime(os.time()) end), t(" \""), i(1), t("\" :due d#"), i(2), t(")")}), - s("task-done", {t("(task-done "), i(1), t(" d#"), f(function () return snippet_datetime(os.time()) end), t(")")}), - s("task-drop", {t("(task-done "), i(1), t(" d#"), f(function () return snippet_datetime(os.time()) end), t(")")}), - s("time-start", {t("(time-start "), t(" d#"), f(function () return snippet_datetime(os.time()) end), t(" )")}), - s("time-stop", {t("(time-stop "), t(" d#"), f(function () return snippet_datetime(os.time()) end), t(" )")}), + s("date", {f(function() return snippet_date(os.time()) end)}), + s("t0", {f(function() return snippet_datetime(os.time()) end)}), s("t1", { + f(function() + return snippet_datetime(os.time() + 1 * 24 * 60 * 60) + end) + }), s("t2", { + f(function() + return snippet_datetime(os.time() + 2 * 24 * 60 * 60) + end) + }), s("t3", { + f(function() + return snippet_datetime(os.time() + 3 * 24 * 60 * 60) + end) + }), s("t4", { + f(function() + return snippet_datetime(os.time() + 4 * 24 * 60 * 60) + end) + }), s("t5", { + f(function() + return snippet_datetime(os.time() + 5 * 24 * 60 * 60) + end) + }), s("t6", { + f(function() + return snippet_datetime(os.time() + 6 * 24 * 60 * 60) + end) + }), s("t7", { + f(function() + return snippet_datetime(os.time() + 7 * 24 * 60 * 60) + end) + }), s("t15", { + f(function() + return snippet_datetime(os.time() + 15 * 24 * 60 * 60) + end) + }), s("t30", { + f(function() + return snippet_datetime(os.time() + 30 * 24 * 60 * 60) + end) + }), s("t60", { + f(function() + return snippet_datetime(os.time() + 60 * 24 * 60 * 60) + end) + }), s("te0", {f(function() return end_of_day(os.time()) end)}), + s("te1", {f(function() return end_of_day(os.time() + 1 * 24 * 60 * 60) end)}), + s("te2", {f(function() return end_of_day(os.time() + 2 * 24 * 60 * 60) end)}), + s("te3", {f(function() return end_of_day(os.time() + 3 * 24 * 60 * 60) end)}), + s("te4", {f(function() return end_of_day(os.time() + 4 * 24 * 60 * 60) end)}), + s("te5", {f(function() return end_of_day(os.time() + 5 * 24 * 60 * 60) end)}), + s("te6", {f(function() return end_of_day(os.time() + 6 * 24 * 60 * 60) end)}), + s("te7", {f(function() return end_of_day(os.time() + 7 * 24 * 60 * 60) end)}), + s("te15", + {f(function() return end_of_day(os.time() + 15 * 24 * 60 * 60) end)}), + s("te30", + {f(function() return end_of_day(os.time() + 30 * 24 * 60 * 60) end)}), + s("te60", + {f(function() return end_of_day(os.time() + 60 * 24 * 60 * 60) end)}), + s("task-add", { + t("(task-add "), f(function() + return run( + "brian task task-id /home/joaj/sources/wiki/journal/2024.md") + end), t(" d#"), f(function() return snippet_datetime(os.time()) end), + t(" \""), i(1), t("\" :due d#"), i(2), t(")") + }), s("task-done", { + t("(task-done "), i(1), t(" d#"), + f(function() return snippet_datetime(os.time()) end), t(")") + }), s("task-drop", { + t("(task-done "), i(1), t(" d#"), + f(function() return snippet_datetime(os.time()) end), t(")") + }), s("time-start", { + t("(time-start "), t(" d#"), + f(function() return snippet_datetime(os.time()) end), t(" )") + }), s("time-stop", { + t("(time-stop "), t(" d#"), + f(function() return snippet_datetime(os.time()) end), t(" )") + }) } From ac63f506beb924e471d25d1f591eb5a5e51e4c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Fri, 28 Mar 2025 12:00:43 +0000 Subject: [PATCH 07/16] settings.json for orion --- vscode/bmw/orion2/.vscode/settings.json | 91 +++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 vscode/bmw/orion2/.vscode/settings.json diff --git a/vscode/bmw/orion2/.vscode/settings.json b/vscode/bmw/orion2/.vscode/settings.json new file mode 100644 index 0000000..8b2c42b --- /dev/null +++ b/vscode/bmw/orion2/.vscode/settings.json @@ -0,0 +1,91 @@ +{ + "bazelerator.packages": [ + "//common/...", + "//activities/motion_planning/...", + "//domains/planning/...", + "//interfaces/...", + "//test/planning/...", + "verification/support/evaluators/motion_planning_aborted_lane_change_evaluator/..." + ], + "bazelerator.favorites": [ + "//activities/motion_planning/...", + "//domains/planning/...", + "//domains/planning/behavior/...", + "//test/planning/motion_planning/...", + "//test/planning/motion_planning/behavior/...", + ], + "bazelerator.configurations": { + "clang": { + "release": [ + "--config=clang", + ], + "fastdebug": [ + "--config=clang", + "--compilation_mode=dbg", + "--define", + "profile_memory=1", + ], + "debug": [ + "--config=clang", + "--compilation_mode=dbg", + "--copt=-O0", + "--define", + "log_level=debug", + ], + "coverage": [ + "--config=clang_cov", + "--cache_test_results=no", + "--experimental_generate_llvm_lcov", + "--experimental_use_llvm_covmap", + ], + }, + "gcc": { + "release": [ + "--config=orion_gcc_release", + ], + "fastdebug": [ + "--config=orion_gcc_fastdebug", + ], + "debug": [ + "--config=orion_gcc_debug", + ], + "coverage": [ + "--config=orion_cov", + ], + } + }, + "bazelerator.activeConfiguration": { + "configuration": "gcc", + "mode": "debug" + }, + "bazelerator.automaticTestScan": true, + "bazelerator.buildifierFixOnFormat": true, + "bazelerator.dependencyGraphScope": "//...:all", + "bazelerator.enableCodeLens": true, + "bazelerator.followSymlinks": true, + "bazelerator.cpp.auto": true, + "bazelerator.cpp.compileCommandsDir": "${workspaceFolder}", + "bazelerator.cpp.externalSymlink": true, + "bazelerator.cpp.mode": "actions", + "bazelerator.cpp.sandbox": true, + "bazelerator.cpp.target": "clangd", + "bazelerator.cpp.debugger": "gdb", + "bazelerator.gdb.breakOnExceptions": false, + "bazelerator.coverage.exclude": "test|tests|mock|third_party", + "C_Cpp.formatting": "clangFormat", + "C_Cpp.intelliSenseEngine": "disabled", + "clangd.arguments": [ + "--compile-commands-dir=${workspaceFolder}/", + "--query-driver=**/clang++,**/*-g++", + "--background-index", + "--clang-tidy", + "--header-insertion=never" + ], + "editor.formatOnSaveMode": "modifications", + "editor.formatOnType": true, + "editor.formatOnSave": true, + "editor.inlayHints.enabled": "offUnlessPressed", + "git.inputValidationSubjectLength": 72, + "git.inputValidation": true, + "github-enterprise.uri": "https://cc-github.bmwgroup.net", +} From 65df96342ffb92066cc20677a981ad3c84f77324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Fri, 28 Mar 2025 12:02:27 +0000 Subject: [PATCH 08/16] update neovim configuration --- nvim/.config/nvim/init.lua | 1 - nvim/.config/nvim/lua/colorscheme.lua | 2 +- nvim/.config/nvim/lua/keybindings.lua | 49 ++++++-------- nvim/.config/nvim/lua/plugins.lua | 96 +++++++++++++++++++++------ 4 files changed, 100 insertions(+), 48 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index c7b5f8a..3362b78 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,5 +1,4 @@ -- disable netrw at the very start of your init.lua -vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 require('plugins').setup() diff --git a/nvim/.config/nvim/lua/colorscheme.lua b/nvim/.config/nvim/lua/colorscheme.lua index 3008744..c305161 100644 --- a/nvim/.config/nvim/lua/colorscheme.lua +++ b/nvim/.config/nvim/lua/colorscheme.lua @@ -16,7 +16,7 @@ M.setup = function() local time = os.date("*t") if time.hour <= sunrise(time.month) or time.hour >= sunset(time.month) then - vim.o.background = "dark" + vim.o.background = "ligth" else vim.o.background = "light" end diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index ed97ad2..83ddbb2 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -3,33 +3,25 @@ local M = {} M.setup = function() local telescope_builtin = require("telescope.builtin") local wk = require("which-key") - wk.register({ - f = {telescope_builtin.find_files, "Find file"}, - g = {telescope_builtin.git_files, "Find git files"}, - t = { - name = "telescope", - g = {telescope_builtin.live_grep, "Live grep"}, - b = {telescope_builtin.buffers, "Buffers"}, - p = {telescope_builtin.builtin, "Builtin pickers"}, - h = {telescope_builtin.help_tags, "Help tags"} - }, - e = {"Neotree toggle", "File explorer"}, - s = { - "ClangdSwitchSourceHeader", - "Switch between source and header" - }, - D = {vim.lsp.buf.type_definition, "Lsp type definition"}, - a = {vim.lsp.buf.code_action, "Lsp code action"}, - r = {vim.lsp.buf.rename, "Lsp rename"}, - z = { - name = "zen", - n = {"TZNarrow", "Narrow"}, - f = {"TZFocus", "Focus"}, - m = {"TZMinimalist", "Minimalist"}, - a = {"TZAtaraxis", "Ataraxis"}, - l = {"Limelight", "Limelight"} - } - }, {prefix = ""}) + wk.add({ + {"f", telescope_builtin.find_files, desc="Find file"}, + {"g", telescope_builtin.git_files, desc="Find git files"}, + {"t", group = "telescope"}, + {"tg", telescope_builtin.live_grep, desc="Live grep"}, + {"tb", telescope_builtin.buffers, desc="Buffers"}, + {"tp", telescope_builtin.builtin, desc="Builtin pickers"}, + {"th", telescope_builtin.help_tags, desc="Help tags"}, + {"e", "NvimTreeToggle", desc="File explorer"}, + {"s", "ClangdSwitchSourceHeader", desc="Switch between source and header"}, + {"D", vim.lsp.buf.type_definition, desc="Lsp type definition"}, + {"a", vim.lsp.buf.code_action, desc="Lsp code action"}, + {"r", vim.lsp.buf.rename, desc="Lsp rename"}, + {"z", group = "zen"}, + {"zn", "TZNarrow", desc="Narrow"}, + {"zf", "TZFocus", desc="Focus"}, + {"zm", "TZMinimalist", desc="Minimalist"}, + {"za", "TZAtaraxis", desc="Ataraxis"}, + {"zl", "Limelight", desc="Limelight"}}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {silent = true}) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, {silent = true}) @@ -40,6 +32,9 @@ M.setup = function() vim.keymap.set("n", "gl", vim.diagnostic.open_float, {silent = true}) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {silent = true}) vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {silent = true}) + + + end return M diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 6135928..61fe290 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -20,53 +20,111 @@ M.setup = function() require("lazy").setup({ {"folke/neodev.nvim", config = function() require("neodev").setup() - end}, {"tpope/vim-fugitive"}, {"lunarvim/lunar.nvim"}, + end}, + {"tpope/vim-fugitive"}, + + {"tpope/vim-rhubarb", + config = function() + vim.cmd("let g:github_enterprise_urls = ['cc-github.bmwgroup.net']") + end + }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed. + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua", -- optional + "echasnovski/mini.pick", -- optional + }, + config = true + }, {"VonHeikemen/lsp-zero.nvim", branch = "v3.x"}, - {"williamboman/mason.nvim"}, {"williamboman/mason-lspconfig.nvim"}, - {"neovim/nvim-lspconfig"}, {"hrsh7th/cmp-nvim-lsp"}, - {"hrsh7th/nvim-cmp"}, { + {"williamboman/mason.nvim"}, + {"williamboman/mason-lspconfig.nvim"}, + {"neovim/nvim-lspconfig"}, + {"hrsh7th/cmp-nvim-lsp"}, + {"hrsh7th/nvim-cmp"}, + { "nvimtools/none-ls.nvim", config = function() local null_ls = require("null-ls") null_ls.setup({null_ls.builtins.formatting.black}) end - }, {"morhetz/gruvbox"}, { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", "3rd/image.nvim" - }, + }, + {"morhetz/gruvbox"}, + {"ahmedkhalf/project.nvim"}, + { + "nvim-tree/nvim-tree.lua", config = function() - require("neo-tree").setup({ - source_selector = {statusline = true} + require("nvim-tree").setup({ + sync_root_with_cwd = true, + respect_buf_cwd = true, + update_focused_file = { + enable = true, + update_root = true + } }) end }, { "nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"} - }, { + }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" - }, { + }, + { + "nvim-telescope/telescope-symbols.nvim" + }, + { "folke/which-key.nvim", event = "VeryLazy", init = function() vim.o.timeout = true vim.o.timeoutlen = 300 - end + end, + dependencies = {"echasnovski/mini.icons"} }, {"L3MON4D3/LuaSnip", dependencies = {"rafamadriz/friendly-snippets"}}, - {"saadparwaiz1/cmp_luasnip"}, {"pocco81/true-zen.nvim"}, + {"saadparwaiz1/cmp_luasnip"}, + {"pocco81/true-zen.nvim"}, {"junegunn/limelight.vim"}, { "FabijanZulj/blame.nvim", config = function() require("blame").setup() end - }, {"ledger/vim-ledger"}, {"piero-vic/cmp-ledger"}, { + }, + {"ledger/vim-ledger"}, + {"piero-vic/cmp-ledger"}, + { "lewis6991/gitsigns.nvim", config = function() require("gitsigns").setup() end - } + }, + {"github/copilot.vim"}, + { + "nvim-treesitter/nvim-treesitter", + config = function() + local parser_config = require "nvim-treesitter.parsers".get_parser_configs() + parser_config.fcp = { + install_info = { + url = "~/sources/fcp-core/tree-sitter-fcp", -- local path or git repo + files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc + -- optional entries: + generate_requires_npm = false, -- if stand-alone parser without npm dependencies + requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c + }, + filetype = "fcp", -- if filetype does not match the parser name + } + require'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + } + } + end, + }, }) end From 2d23b436f6f63092632cae898ddc7b5608c86a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Wed, 4 Jun 2025 09:05:33 +0100 Subject: [PATCH 09/16] Update neovim config --- nvim/.config/nvim/lua/colorscheme.lua | 2 +- nvim/.config/nvim/lua/plugins.lua | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/colorscheme.lua b/nvim/.config/nvim/lua/colorscheme.lua index c305161..3008744 100644 --- a/nvim/.config/nvim/lua/colorscheme.lua +++ b/nvim/.config/nvim/lua/colorscheme.lua @@ -16,7 +16,7 @@ M.setup = function() local time = os.date("*t") if time.hour <= sunrise(time.month) or time.hour >= sunset(time.month) then - vim.o.background = "ligth" + vim.o.background = "dark" else vim.o.background = "light" end diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 61fe290..76b0251 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -21,6 +21,17 @@ M.setup = function() {"folke/neodev.nvim", config = function() require("neodev").setup() end}, + { + "johnfrankmorgan/whitespace.nvim", + config = function() + require("whitespace-nvim").setup({ + highlight = "DiffDelete", + ignored_filetypes = { "TelescopePrompt", "Trouble", "help", "dashboard" }, + ignore_terminal = true, + return_cursor = true, + }) + end, + }, {"tpope/vim-fugitive"}, {"tpope/vim-rhubarb", @@ -125,6 +136,12 @@ M.setup = function() } end, }, + {"f-person/auto-dark-mode.nvim", + + opts = { + fallback = "light" + } + }, }) end From 09a74a740ea85cad9321602b6343a20c98215ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Wed, 20 Aug 2025 19:34:14 +0100 Subject: [PATCH 10/16] Neovim updates --- nvim/.config/nvim/init.lua | 2 +- nvim/.config/nvim/lazy-lock.json | 78 +++++---- nvim/.config/nvim/lua/keybindings.lua | 22 ++- nvim/.config/nvim/lua/plugins.lua | 169 ++++++++++++++++--- nvim/.config/nvim/queries/fcp/highlights.scm | 23 +++ 5 files changed, 240 insertions(+), 54 deletions(-) create mode 100644 nvim/.config/nvim/queries/fcp/highlights.scm diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 3362b78..fa3435e 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -18,7 +18,7 @@ require("telescope").load_extension("fzf") require('keybindings').setup() require('colorscheme').setup() -vim.o.autochdir = true +vim.o.autochdir = false vim.wo.number = true vim.opt.clipboard = "unnamedplus" vim.g.mapleader = " " diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index dcd9941..f43e4cc 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,33 +1,49 @@ { - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "blame.nvim": { "branch": "main", "commit": "dedbcdce857f708c63f261287ac7491a893912d0" }, - "cmp-ledger": { "branch": "main", "commit": "4b278333d4a4b59fd960383eac687eb47c23abe5" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" }, - "gitsigns.nvim": { "branch": "main", "commit": "375c44bdfdde25585466a966f00c2e291db74f2d" }, - "gruvbox": { "branch": "master", "commit": "f1ecde848f0cdba877acb0c740320568252cc482" }, - "image.nvim": { "branch": "master", "commit": "61c76515cfc3cdac8123ece9e9761b20c3dc1315" }, - "lazy.nvim": { "branch": "main", "commit": "d1de92dffab5a862332fdd1892889d362369c12f" }, - "limelight.vim": { "branch": "master", "commit": "785c1e17fe90c587ebca88920baa3146cd6e30fa" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "87701af045b3032515776abeb47eb8c2ddb5e679" }, - "lunar.nvim": { "branch": "master", "commit": "08bbc93b96ad698d22fc2aa01805786bcedc34b9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, - "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, - "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, + "CopilotChat.nvim": { "branch": "main", "commit": "f7bb32dbbe2ff5e26f5033e2142b5920cf427236" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" }, + "acronymviewer.nvim": { "branch": "master", "commit": "a03c3548e64b902bd0616cec6abb89406218bc2c" }, + "auto-dark-mode.nvim": { "branch": "master", "commit": "e300259ec777a40b4b9e3c8e6ade203e78d15881" }, + "blame.nvim": { "branch": "main", "commit": "b87b8c820e4cec06fbbd2f946b7b35c45906ee0c" }, + "cmp-ledger": { "branch": "main", "commit": "0b5c010dac3e3323d3611462ee9f0c8ee7f51d34" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "copilot.vim": { "branch": "release", "commit": "f3d66c148aa60ad04c0a21d3e0a776459de09eb2" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "everforest": { "branch": "master", "commit": "28d59e29d972e21f2e802ce916f28dcab30697ae" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "gruvbox": { "branch": "master", "commit": "697c00291db857ca0af00ec154e5bd514a79191f" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "limelight.vim": { "branch": "master", "commit": "0c8cc7f503a775c505dc9c67f1f5041ab4d5f1fd" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "neogit": { "branch": "master", "commit": "aec66c46c132a019296e9e73a2ef6d753bf15563" }, + "neotest": { "branch": "master", "commit": "35a59c1f59dbb954d92b74ab64a966a668cea495" }, + "neotest-gtest": { "branch": "main", "commit": "16989561a6356878ec4ecd6afed4f0d7a471d1db" }, + "none-ls.nvim": { "branch": "main", "commit": "5fcb73913a9290f78097e34420fe0e6130c5c33c" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "f777d1d20ed50c2f312e286892c062d9c2f1c6fe" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-lspconfig": { "branch": "master", "commit": "d64ea08d8033543a61af35f2f23cac0f0d05f7b4" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" }, + "nvim-tree.lua": { "branch": "master", "commit": "f4fa6ebd3cbfa299fb554766c56b2f7cc1233f27" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "obsidian.nvim": { "branch": "main", "commit": "705cc9b4f66eca1e54040ac819102e80a32896d3" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "true-zen.nvim": { "branch": "main", "commit": "2b9e210e0d1a735e1fa85ec22190115dffd963aa" }, - "vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" }, - "vim-ledger": { "branch": "master", "commit": "7b97c8765bf920e92fd950a7a5bc37cb2b13a494" }, - "which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" } -} \ No newline at end of file + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "vim-ledger": { "branch": "master", "commit": "aabf1976dfefe5665233c600421aea2798ff7ea0" }, + "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "whitespace.nvim": { "branch": "master", "commit": "8bf60b4a6892aa517a78a6014896078ae0c4c642" } +} diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index 83ddbb2..9b0669f 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -6,13 +6,13 @@ M.setup = function() wk.add({ {"f", telescope_builtin.find_files, desc="Find file"}, {"g", telescope_builtin.git_files, desc="Find git files"}, + {"s", telescope_builtin.live_grep, desc="Live keyword search"}, {"t", group = "telescope"}, - {"tg", telescope_builtin.live_grep, desc="Live grep"}, {"tb", telescope_builtin.buffers, desc="Buffers"}, {"tp", telescope_builtin.builtin, desc="Builtin pickers"}, {"th", telescope_builtin.help_tags, desc="Help tags"}, {"e", "NvimTreeToggle", desc="File explorer"}, - {"s", "ClangdSwitchSourceHeader", desc="Switch between source and header"}, + {"o", "ClangdSwitchSourceHeader", desc="Switch between source and header"}, {"D", vim.lsp.buf.type_definition, desc="Lsp type definition"}, {"a", vim.lsp.buf.code_action, desc="Lsp code action"}, {"r", vim.lsp.buf.rename, desc="Lsp rename"}, @@ -21,13 +21,29 @@ M.setup = function() {"zf", "TZFocus", desc="Focus"}, {"zm", "TZMinimalist", desc="Minimalist"}, {"za", "TZAtaraxis", desc="Ataraxis"}, - {"zl", "Limelight", desc="Limelight"}}) + {"zl", "Limelight", desc="Limelight"}, + { + 'lk', + function() + local acronym = vim.fn.input { + prompt = 'Acronym: ', + } + local result = require('acronym-viewer').lookup(acronym) + if result == nil then + vim.notify('Could not find a definition for ' .. acronym .. '.', vim.log.levels.ERROR) + else + vim.notify(result, vim.log.levels.INFO) + end + end, + }, + }) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {silent = true}) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, {silent = true}) vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {silent = true}) vim.keymap.set("n", "go", vim.lsp.buf.type_definition, {silent = true}) vim.keymap.set("n", "gr", vim.lsp.buf.references, {silent = true}) + vim.keymap.set("n", "gre", require('telescope.builtin').lsp_references, {silent=true}) vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, {silent = true}) vim.keymap.set("n", "gl", vim.diagnostic.open_float, {silent = true}) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {silent = true}) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 76b0251..691ddf5 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -18,8 +18,8 @@ M.setup = function() vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - {"folke/neodev.nvim", config = function() - require("neodev").setup() + {"folke/lazydev.nvim", config = function() + require("lazydev").setup({library = {"nvim-dap-ui"},}) end}, { "johnfrankmorgan/whitespace.nvim", @@ -42,16 +42,28 @@ M.setup = function() { "NeogitOrg/neogit", dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed. - "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional - "echasnovski/mini.pick", -- optional + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", }, config = true }, + { + "lewis6991/gitsigns.nvim" , + config = function() + require('gitsigns').setup({ + current_line_blame = false, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', + delay = 300, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + }) + end + }, {"VonHeikemen/lsp-zero.nvim", branch = "v3.x"}, {"williamboman/mason.nvim"}, {"williamboman/mason-lspconfig.nvim"}, @@ -65,7 +77,8 @@ M.setup = function() null_ls.setup({null_ls.builtins.formatting.black}) end }, - {"morhetz/gruvbox"}, + {"morhetz/gruvbox", lazy=false, priority=1000}, + {"sainnhe/everforest"}, {"ahmedkhalf/project.nvim"}, { "nvim-tree/nvim-tree.lua", @@ -76,6 +89,9 @@ M.setup = function() update_focused_file = { enable = true, update_root = true + }, + view = { + width = 80, } }) end @@ -107,9 +123,9 @@ M.setup = function() { "FabijanZulj/blame.nvim", config = function() require("blame").setup() end - }, - {"ledger/vim-ledger"}, - {"piero-vic/cmp-ledger"}, + }, + {"ledger/vim-ledger"}, + {"piero-vic/cmp-ledger"}, { "lewis6991/gitsigns.nvim", config = function() require("gitsigns").setup() end @@ -121,13 +137,12 @@ M.setup = function() local parser_config = require "nvim-treesitter.parsers".get_parser_configs() parser_config.fcp = { install_info = { - url = "~/sources/fcp-core/tree-sitter-fcp", -- local path or git repo - files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc - -- optional entries: - generate_requires_npm = false, -- if stand-alone parser without npm dependencies - requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c + url = "~/sources/fcp-core/tree-sitter-fcp", + files = {"src/parser.c"}, + generate_requires_npm = false, + requires_generate_from_grammar = false, }, - filetype = "fcp", -- if filetype does not match the parser name + filetype = "fcp", } require'nvim-treesitter.configs'.setup { highlight = { @@ -142,7 +157,123 @@ M.setup = function() fallback = "light" } }, + {"mfussenegger/nvim-dap"}, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio" + } + }, + { + "https://cc-github.bmwgroup.net/shaharklinger/acronymviewer.nvim", + opts = {}, + lazy = false, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "nvim-lua/plenary.nvim", branch = "master" }, + }, + build = "make tiktoken", + }, + { + "obsidian-nvim/obsidian.nvim", + version = "*", + lazy = true, + event = { + "BufReadPre " .. vim.fn.expand("~") .. "/sources/wiki/*.md", + "BufNewFile " .. vim.fn.expand("~") .. "/sources/wiki/*.md", + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "wiki", + path = "~/sources/wiki", + }, + }, + attachments = { + img_folder = "assets/imgs", + } + + }, + }, + {"rcarriga/nvim-notify", opts = {stages = "static"}}, + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "alfaix/neotest-gtest" + }, + config = function() + local utils = require("neotest-gtest.utils") + local lib = require("neotest.lib") + require("neotest").setup({ + adapters = { + require("neotest-gtest").setup({ + -- which debug adater to use? dap.adapters. must be defined. + debug_adapter = "gdb", + }) + }, + discovery = + { + enabled = false, + concurrent = 1 + }, + }) + end, + }, + { + "folke/snacks.nvim", + ---@type snacks.Config + opts = { + input = {} + } + } }) + + local dap = require("dap") + dap.adapters.gdb = { + type = "executable", + command = "gdb", + args = { "--interpreter=dap", "--eval-command", "set print pretty on" } + } + + dap.adapters.codelldb = { + type = "server", + port = "${port}", + executable = { + command = "/home/joaj/.local/share/nvim/mason/bin/codelldb", -- I installed codelldb through mason.nvim + args = {"--port", "${port}"} + }, + } + + + dap.configurations.c = { + { + name = 'Attach to gdbserver :1234', + type = 'gdb', + request = 'attach', + target = 'localhost:1234', + program = function() + return vim.fn.input('Path to executable: ', '/home/joaj/bmw/orion2/bazel-bin/test/planning/motion_planning/behavior/lane_change/lane_segment_sequence_test') + end, + cwd = '${workspaceFolder}' + }, + } + + + dap.configurations.cpp = dap.configurations.c + dap.configurations.rust = dap.configurations.c + + vim.notify = require("notify") + end return M diff --git a/nvim/.config/nvim/queries/fcp/highlights.scm b/nvim/.config/nvim/queries/fcp/highlights.scm new file mode 100644 index 0000000..c39eab5 --- /dev/null +++ b/nvim/.config/nvim/queries/fcp/highlights.scm @@ -0,0 +1,23 @@ +"struct" @keyword +"enum" @keyword +"impl" @keyword +"for" @keyword +"service" @keyword +"rpc" @keyword +"returns" @keyword +"version" @keyword +"mod" @keyword +((identifier) @variable + (#set! priority 5)) +(number) @number +(type) @type +(string) @string +(struct_name) @type +(enum_name) @type +(rpc_name) @function +(rpc_input_type) @type +(rpc_output_type) @type +(struct_field_name) @property +(enum_field_name) @constant +(param_name) @function +(comment) @comment From 6c4732c976a0e92fac963053777d11b4449df356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Wed, 20 Aug 2025 19:41:05 +0100 Subject: [PATCH 11/16] Update gitconfig --- git/.gitconfig | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index b3c7c24..1a15c7c 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,8 +1,35 @@ [user] - email = joao.mc.freitas@ctw.bmwgroup.com + email = joao.mc.freitas@ctw.bmwgroup.com name = João Freitas [core] - editor = nvim + editor = nvim whitespace = trailing-space,space-before-tab +[column] + ui = auto +[branch] + sort = -committerdate [apply] - whitespace = fix + whitespace = fix +[merge] + conflictStyle = zdiff3 +[rerere] + enabled = true + autoupdated = true +[push] + autoSetupRemote = true +[diff] + algorithm = histogram + colorMoved = plain + renames = true + mnemonicPrefix = true +[fetch] + prune = true +[rebase] + autoSquash = true + autoStash = true + updateRefs = true +[pull] + rebase = true +[alias] + lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15 + out = "log @{u}.." From 7576e5e715daca8b8748cbb931cf7ed8d51b5901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Mon, 15 Sep 2025 17:14:56 +0100 Subject: [PATCH 12/16] Update from kickstart --- nvim/.config/nvim/init.lua | 48 +++- nvim/.config/nvim/lazy-lock.json | 43 ++-- nvim/.config/nvim/lua/keybindings.lua | 128 ++++++++-- nvim/.config/nvim/lua/plugins.lua | 350 ++++++++++++++------------ 4 files changed, 357 insertions(+), 212 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index fa3435e..720fa15 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,5 +1,34 @@ -- disable netrw at the very start of your init.lua vim.g.loaded_netrwPlugin = 1 +vim.o.autochdir = false +vim.wo.number = true +vim.g.mapleader = " " + +vim.schedule(function() + vim.o.clipboard = "unnamedplus" +end) + +vim.o.mouse = 'a' +vim.o.breakindent = true +vim.o.undofile = true +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.signcolumn = "yes" +vim.o.updatetime = 300 +vim.o.cursorline = true +vim.o.scrolloff = 10 +vim.o.confirm = true + +vim.keymap.set('n', '', 'nohlsearch', { desc = "Clear search highlighting" }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) require('plugins').setup() require('lsp').setup() @@ -14,16 +43,15 @@ require("telescope").setup({ } } }) -require("telescope").load_extension("fzf") +pcall(require("telescope").load_extension, 'fzf') +pcall(require("telescope").load_extension, 'ui-select') + require('keybindings').setup() require('colorscheme').setup() -vim.o.autochdir = false -vim.wo.number = true -vim.opt.clipboard = "unnamedplus" -vim.g.mapleader = " " - -vim.o.tabstop = 4 -vim.o.expandtab = true -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 +vim.api.nvim_create_autocmd('FileType', { + pattern = { '*.md' }, + callback = function() + vim.o.conceallevel = 2 + end, +}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index f43e4cc..675f88b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,44 +1,45 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "f7bb32dbbe2ff5e26f5033e2142b5920cf427236" }, + "CopilotChat.nvim": { "branch": "main", "commit": "87615648ff4dc852d1cf7ec099f0a7c37b1b2c87" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" }, + "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, "acronymviewer.nvim": { "branch": "master", "commit": "a03c3548e64b902bd0616cec6abb89406218bc2c" }, "auto-dark-mode.nvim": { "branch": "master", "commit": "e300259ec777a40b4b9e3c8e6ade203e78d15881" }, "blame.nvim": { "branch": "main", "commit": "b87b8c820e4cec06fbbd2f946b7b35c45906ee0c" }, + "blink.cmp": { "branch": "main", "commit": "636b79d7dcca6226572b13cacca06c756aeae51b" }, "cmp-ledger": { "branch": "main", "commit": "0b5c010dac3e3323d3611462ee9f0c8ee7f51d34" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "copilot.vim": { "branch": "release", "commit": "f3d66c148aa60ad04c0a21d3e0a776459de09eb2" }, + "copilot.vim": { "branch": "release", "commit": "dfe0a3a1c256167d181488a73ec6ccab8d8931a9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "everforest": { "branch": "master", "commit": "28d59e29d972e21f2e802ce916f28dcab30697ae" }, + "fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, - "gruvbox": { "branch": "master", "commit": "697c00291db857ca0af00ec154e5bd514a79191f" }, + "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" }, + "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lazydev.nvim": { "branch": "main", "commit": "954ecf72dab547f2a14db473cf6253eeb67dfd4a" }, "limelight.vim": { "branch": "master", "commit": "0c8cc7f503a775c505dc9c67f1f5041ab4d5f1fd" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, - "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, - "neogit": { "branch": "master", "commit": "aec66c46c132a019296e9e73a2ef6d753bf15563" }, - "neotest": { "branch": "master", "commit": "35a59c1f59dbb954d92b74ab64a966a668cea495" }, + "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" }, + "neogit": { "branch": "master", "commit": "df08cb97f126c546a5ec265bafab2d78cc7399fa" }, + "neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" }, "neotest-gtest": { "branch": "main", "commit": "16989561a6356878ec4ecd6afed4f0d7a471d1db" }, - "none-ls.nvim": { "branch": "main", "commit": "5fcb73913a9290f78097e34420fe0e6130c5c33c" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-dap": { "branch": "master", "commit": "f777d1d20ed50c2f312e286892c062d9c2f1c6fe" }, + "none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" }, + "nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lspconfig": { "branch": "master", "commit": "d64ea08d8033543a61af35f2f23cac0f0d05f7b4" }, + "nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" }, - "nvim-tree.lua": { "branch": "master", "commit": "f4fa6ebd3cbfa299fb554766c56b2f7cc1233f27" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, "obsidian.nvim": { "branch": "main", "commit": "705cc9b4f66eca1e54040ac819102e80a32896d3" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, + "telescope-project.nvim": { "branch": "master", "commit": "8e11df94419e444601c09828dadf70890484e443" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "true-zen.nvim": { "branch": "main", "commit": "2b9e210e0d1a735e1fa85ec22190115dffd963aa" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index 9b0669f..a8696dd 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -6,22 +6,122 @@ M.setup = function() wk.add({ {"f", telescope_builtin.find_files, desc="Find file"}, {"g", telescope_builtin.git_files, desc="Find git files"}, - {"s", telescope_builtin.live_grep, desc="Live keyword search"}, - {"t", group = "telescope"}, - {"tb", telescope_builtin.buffers, desc="Buffers"}, - {"tp", telescope_builtin.builtin, desc="Builtin pickers"}, - {"th", telescope_builtin.help_tags, desc="Help tags"}, + {"s", group = "[S]earch"}, + {"sh", telescope_builtin.help_tags, desc="[S]earch [H]elp"}, + {"sk", telescope_builtin.keymaps, desc="[S]earch [K]eymaps"}, + {"sf", telescope_builtin.find_files, desc="[S]earch [F]iles"}, + {"ss", telescope_builtin.builtin, desc="[S]earch [S]elect Telescope"}, + {"sw", telescope_builtin.grep_string, desc="[S]earch current [W]ord"}, + {"sg", telescope_builtin.live_grep, desc="[S]earch by [G]rep"}, + {"sd", telescope_builtin.diagnostics, desc="[S]earch [D]iagnostics"}, + {"sr", telescope_builtin.resume, desc="[S]earch [R]esume"}, + {"s.", telescope_builtin.oldfiles, desc="[S]earch Recent Files ('.' for repeat)"}, + {"", telescope_builtin.buffers, desc="[ ] Find existing buffers"}, + { + "/", + function() + telescope_builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) + end, + desc = "[/] Fuzzy search in current buffer" + }, + { + "s/", + function() + telescope_builtin.live_grep { + grep_open_files = true, + prompt_title = "Grep in open files", + } + end, + desc = "[S]earch [/] in open files" + }, + { + "sn", + function() + telescope_builtin.find_files { cwd = vim.fn.stdpath 'config' } + end, + desc = "[S]earch [N]eovim files" + }, {"e", "NvimTreeToggle", desc="File explorer"}, {"o", "ClangdSwitchSourceHeader", desc="Switch between source and header"}, {"D", vim.lsp.buf.type_definition, desc="Lsp type definition"}, - {"a", vim.lsp.buf.code_action, desc="Lsp code action"}, - {"r", vim.lsp.buf.rename, desc="Lsp rename"}, - {"z", group = "zen"}, + {"l", group = "[L]sp"}, + {"la", vim.lsp.buf.code_action, desc = "Lsp code action" }, + {"lr", vim.lsp.buf.rename, desc = "Lsp rename" }, + {"lf", vim.lsp.buf.format, desc = "Lsp format" }, + {"z", group = "[Z]en"}, {"zn", "TZNarrow", desc="Narrow"}, {"zf", "TZFocus", desc="Focus"}, {"zm", "TZMinimalist", desc="Minimalist"}, {"za", "TZAtaraxis", desc="Ataraxis"}, {"zl", "Limelight", desc="Limelight"}, + { "x", group = "Trouble" }, + { + "xx", + "Trouble diagnostics toggle focus=True", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0 focus=True", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "xs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "xl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + { + "gd", + vim.lsp.buf.definition, + desc = "Go to definition (LSP)", + }, + { + "gD", + vim.lsp.buf.declaration, + desc = "Go to declaration (LSP)", + }, + { + "gi", + vim.lsp.buf.implementation, + desc = "Go to implementation (LSP)", + }, + { + "go", + vim.lsp.buf.type_definition, + desc = "Go to type definition (LSP)", + }, + { + "gr", + vim.lsp.buf.references, + desc = "Go to references (LSP)", + }, + { + "gs", + vim.lsp.buf.signature_help, + desc = "Signature help (LSP)", + }, + { "gl", vim.diagnostic.open_float, desc = "Show diagnostics" }, + { "[d", vim.diagnostic.get_prev, desc = "Previous diagnostic" }, + { "]d", vim.diagnostic.get_next, desc = "Next diagnostic" }, + { "q", vim.diagnostic.setloclist, desc = "Quickfix list" }, { 'lk', function() @@ -38,18 +138,10 @@ M.setup = function() }, }) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {silent = true}) - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, {silent = true}) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {silent = true}) - vim.keymap.set("n", "go", vim.lsp.buf.type_definition, {silent = true}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {silent = true}) vim.keymap.set("n", "gre", require('telescope.builtin').lsp_references, {silent=true}) - vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, {silent = true}) vim.keymap.set("n", "gl", vim.diagnostic.open_float, {silent = true}) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {silent = true}) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {silent = true}) - - + vim.keymap.set("n", "[d", function() vim.diagnostic.jump({count=-1, float=true}) end, {silent = true}) + vim.keymap.set("n", "]d", function() vim.diagnostic.jump({count=1, float=true}) end, {silent = true}) end diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 691ddf5..9f48a13 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -2,84 +2,104 @@ local M = {} M.setup = function() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - local uv = vim.uv or vim.loop - - -- Auto-install lazy.nvim if not present - if not uv.fs_stat(lazypath) then - print("Installing lazy.nvim....") - vim.fn.system({ - "git", "clone", "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", "--branch=stable", - lazypath - }) - print("Done.") + if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end - vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - {"folke/lazydev.nvim", config = function() - require("lazydev").setup({library = {"nvim-dap-ui"},}) - end}, { - "johnfrankmorgan/whitespace.nvim", - config = function() - require("whitespace-nvim").setup({ - highlight = "DiffDelete", - ignored_filetypes = { "TelescopePrompt", "Trouble", "help", "dashboard" }, - ignore_terminal = true, - return_cursor = true, - }) - end, - }, - {"tpope/vim-fugitive"}, - - {"tpope/vim-rhubarb", - config = function() - vim.cmd("let g:github_enterprise_urls = ['cc-github.bmwgroup.net']") - end + "folke/lazydev.nvim", + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + }, }, { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - config = true + 'NMAC427/guess-indent.nvim', + opts = { + on_tab_options = { + ["expandtab"] = true, + } + } + }, + { + "johnfrankmorgan/whitespace.nvim", + opts = { + highlight = "DiffDelete", + ignored_filetypes = { "TelescopePrompt", "Trouble", "help", "dashboard" }, + ignore_terminal = true, + return_cursor = true, + }, }, + "tpope/vim-fugitive", { - "lewis6991/gitsigns.nvim" , + "tpope/vim-rhubarb", config = function() - require('gitsigns').setup({ - current_line_blame = false, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', - delay = 300, - ignore_whitespace = false, - virt_text_priority = 100, - use_focus = true, - }, - }) + vim.g.github_enterprise_urls = { 'cc-github.bmwgroup.net' } end }, - {"VonHeikemen/lsp-zero.nvim", branch = "v3.x"}, - {"williamboman/mason.nvim"}, - {"williamboman/mason-lspconfig.nvim"}, - {"neovim/nvim-lspconfig"}, - {"hrsh7th/cmp-nvim-lsp"}, - {"hrsh7th/nvim-cmp"}, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + config = true + }, + { + "lewis6991/gitsigns.nvim", + opts = { + current_line_blame = false, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', + delay = 300, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + }}, + { "VonHeikemen/lsp-zero.nvim", branch = "v3.x" }, + { + "neovim/nvim-lspconfig", + dependencies = { + { "williamboman/mason.nvim", opts={} }, + "williamboman/mason-lspconfig.nvim", + 'WhoIsSethDaniel/mason-tool-installer.nvim', + { "j-hui/fidget.nvim", opts = {} }, + 'saghen/blink.cmp' + }, + }, + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/nvim-cmp" }, { "nvimtools/none-ls.nvim", config = function() local null_ls = require("null-ls") - null_ls.setup({null_ls.builtins.formatting.black}) + null_ls.setup({ null_ls.builtins.formatting.black }) end }, - {"morhetz/gruvbox", lazy=false, priority=1000}, - {"sainnhe/everforest"}, - {"ahmedkhalf/project.nvim"}, + { + "ellisonleao/gruvbox.nvim", + lazy = false, + priority = 1000, + }, + "nvim-telescope/telescope-project.nvim", { "nvim-tree/nvim-tree.lua", config = function() @@ -98,14 +118,21 @@ M.setup = function() }, { "nvim-telescope/telescope.nvim", - dependencies = {"nvim-lua/plenary.nvim"} - }, - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" - }, - { - "nvim-telescope/telescope-symbols.nvim" + dependencies = { + "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" + }, + { + "nvim-telescope/telescope-ui-select.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("telescope").load_extension("ui-select") + end + }, + { 'nvim-tree/nvim-web-devicons', enabled = true }, + }, }, { "folke/which-key.nvim", @@ -114,50 +141,54 @@ M.setup = function() vim.o.timeout = true vim.o.timeoutlen = 300 end, - dependencies = {"echasnovski/mini.icons"} + dependencies = { "echasnovski/mini.icons" } }, - {"L3MON4D3/LuaSnip", dependencies = {"rafamadriz/friendly-snippets"}}, - {"saadparwaiz1/cmp_luasnip"}, - {"pocco81/true-zen.nvim"}, - {"junegunn/limelight.vim"}, + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" } + }, + { "saadparwaiz1/cmp_luasnip" }, + { "pocco81/true-zen.nvim" }, + { "junegunn/limelight.vim" }, { "FabijanZulj/blame.nvim", config = function() require("blame").setup() end }, - {"ledger/vim-ledger"}, - {"piero-vic/cmp-ledger"}, + { "ledger/vim-ledger" }, + { "piero-vic/cmp-ledger" }, { "lewis6991/gitsigns.nvim", config = function() require("gitsigns").setup() end }, - {"github/copilot.vim"}, + { "github/copilot.vim" }, { "nvim-treesitter/nvim-treesitter", config = function() - local parser_config = require "nvim-treesitter.parsers".get_parser_configs() - parser_config.fcp = { - install_info = { - url = "~/sources/fcp-core/tree-sitter-fcp", - files = {"src/parser.c"}, - generate_requires_npm = false, - requires_generate_from_grammar = false, - }, - filetype = "fcp", - } - require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, + local parser_config = require "nvim-treesitter.parsers".get_parser_configs() + parser_config.fcp = { + install_info = { + url = "~/sources/fcp-core/tree-sitter-fcp", + files = { "src/parser.c" }, + generate_requires_npm = false, + requires_generate_from_grammar = false, + }, + filetype = "fcp", + } + require 'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + } } - } end, }, - {"f-person/auto-dark-mode.nvim", + { + "f-person/auto-dark-mode.nvim", - opts = { - fallback = "light" - } + opts = { + fallback = "light" + } }, - {"mfussenegger/nvim-dap"}, + { "mfussenegger/nvim-dap" }, { "rcarriga/nvim-dap-ui", dependencies = { @@ -166,106 +197,100 @@ M.setup = function() } }, { - "https://cc-github.bmwgroup.net/shaharklinger/acronymviewer.nvim", - opts = {}, - lazy = false, + "https://cc-github.bmwgroup.net/shaharklinger/acronymviewer.nvim", + opts = {}, + lazy = false, }, { "CopilotC-Nvim/CopilotChat.nvim", dependencies = { - { "nvim-lua/plenary.nvim", branch = "master" }, + { "nvim-lua/plenary.nvim", branch = "master" }, }, build = "make tiktoken", + opts = { + }, }, { "obsidian-nvim/obsidian.nvim", version = "*", lazy = true, event = { - "BufReadPre " .. vim.fn.expand("~") .. "/sources/wiki/*.md", - "BufNewFile " .. vim.fn.expand("~") .. "/sources/wiki/*.md", + "BufReadPre " .. vim.fn.expand("~") .. "/sources/wiki/*.md", + "BufNewFile " .. vim.fn.expand("~") .. "/sources/wiki/*.md", }, dependencies = { - "nvim-lua/plenary.nvim", + "nvim-lua/plenary.nvim", }, opts = { - workspaces = { - { - name = "wiki", - path = "~/sources/wiki", + workspaces = { + { + name = "wiki", + path = "~/sources/wiki", + }, }, - }, - attachments = { - img_folder = "assets/imgs", - } + attachments = { + img_folder = "assets/imgs", + } }, }, - {"rcarriga/nvim-notify", opts = {stages = "static"}}, + { "rcarriga/nvim-notify", opts = { stages = "static" } }, { - "nvim-neotest/neotest", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "alfaix/neotest-gtest" - }, - config = function() - local utils = require("neotest-gtest.utils") - local lib = require("neotest.lib") - require("neotest").setup({ - adapters = { - require("neotest-gtest").setup({ - -- which debug adater to use? dap.adapters. must be defined. - debug_adapter = "gdb", - }) - }, - discovery = - { - enabled = false, - concurrent = 1 + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "alfaix/neotest-gtest" }, - }) - end, - }, - { - "folke/snacks.nvim", - ---@type snacks.Config - opts = { - input = {} - } - } + config = function() + require("neotest").setup({ + adapters = { + require("neotest-gtest").setup({ + -- which debug adater to use? dap.adapters. must be defined. + debug_adapter = "gdb", + }) + }, + discovery = + { + enabled = false, + concurrent = 1 + }, + }) + end, + }, }) local dap = require("dap") dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "--interpreter=dap", "--eval-command", "set print pretty on" } + type = "executable", + command = "gdb", + args = { "--interpreter=dap", "--eval-command", "set print pretty on" } } dap.adapters.codelldb = { - type = "server", - port = "${port}", - executable = { - command = "/home/joaj/.local/share/nvim/mason/bin/codelldb", -- I installed codelldb through mason.nvim - args = {"--port", "${port}"} - }, + type = "server", + port = "${port}", + executable = { + command = "/home/joaj/.local/share/nvim/mason/bin/codelldb", -- I installed codelldb through mason.nvim + args = { "--port", "${port}" } + }, } dap.configurations.c = { - { - name = 'Attach to gdbserver :1234', - type = 'gdb', - request = 'attach', - target = 'localhost:1234', - program = function() - return vim.fn.input('Path to executable: ', '/home/joaj/bmw/orion2/bazel-bin/test/planning/motion_planning/behavior/lane_change/lane_segment_sequence_test') - end, - cwd = '${workspaceFolder}' - }, + { + name = 'Attach to gdbserver :1234', + type = 'gdb', + request = 'attach', + target = 'localhost:1234', + program = function() + return vim.fn.input('Path to executable: ', + '/home/joaj/bmw/orion2/bazel-bin/test/planning/motion_planning/behavior/lane_change/lane_segment_sequence_test') + end, + cwd = '${workspaceFolder}' + }, } @@ -273,7 +298,6 @@ M.setup = function() dap.configurations.rust = dap.configurations.c vim.notify = require("notify") - end return M From ff4618a83668659d442b762a54c68e642a07bf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Mon, 2 Feb 2026 17:11:08 +0000 Subject: [PATCH 13/16] Update atuin config --- atuin/.config/atuin/config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/atuin/.config/atuin/config.toml b/atuin/.config/atuin/config.toml index 5ca2959..d9ac807 100644 --- a/atuin/.config/atuin/config.toml +++ b/atuin/.config/atuin/config.toml @@ -1,3 +1,4 @@ update_check = false style="compact" inline_height=20 +auto_sync = false From 27fe097d3433fad8234cadde4f6ed4e670ee1754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Mon, 2 Feb 2026 17:11:22 +0000 Subject: [PATCH 14/16] Add bob to nvim path --- bash/.aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/.aliases b/bash/.aliases index ffbcbca..ca24bc0 100644 --- a/bash/.aliases +++ b/bash/.aliases @@ -147,7 +147,7 @@ export PATH=/home/joaj/.local/bin:$PATH export PATH=$PATH:"$XDG_DATA_HOME"/cargo/bin export PATH=$PATH:"$XDG_CONFIG_HOME"/emacs/bin export PATH=$PATH:"$XDG_DATA_HOME"/gem/ruby/2.7.0/bin -export PATH=$PATH:"$XDG_CONFIG_HOME"/emacs/bin +export PATH=$PATH:"$XDG_DATA_HOME"/bob/nvim-bin export MANPAGER='vim -R -M +MANPAGER -' source ~/.secrets From bf6165f5d3b0e0c6aec01f6dce1e2f14b394c38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Wed, 4 Feb 2026 17:06:51 +0000 Subject: [PATCH 15/16] Update bash configuration --- bash/.bashrc | 11 +++++++++-- bash/.profile | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index f1ea4d0..5ce2db7 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -3,7 +3,14 @@ PS1='[\u@\h \W]\$ ' -source .profile -source .aliases +source /home/joaj/.profile +source /home/joaj/.aliases # vim: set ft=sh: + +#. "$HOME/.atuin/bin/env" + +[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh +#eval "$(atuin init bash)" + +. "$HOME/.local/share/../bin/env" diff --git a/bash/.profile b/bash/.profile index 8af024c..3eb64c8 100644 --- a/bash/.profile +++ b/bash/.profile @@ -10,3 +10,7 @@ export HOSTNAME=$(hostname) TZ='Europe/Lisbon'; export TZ # vim: set ft=sh: + +. "$HOME/.atuin/bin/env" + +. "$HOME/.local/share/../bin/env" From 081c73f3d7de6f12de3d1b8e29ada498dc20ea99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Freitas?= Date: Wed, 4 Feb 2026 18:01:11 +0000 Subject: [PATCH 16/16] Add ganymede specific configurations --- nvim/.config/nvim/.stylua.toml | 6 + nvim/.config/nvim/ftdetect/fcp.vim | 1 + nvim/.config/nvim/init.lua | 80 ++-- nvim/.config/nvim/lazy-lock.json | 77 +-- nvim/.config/nvim/lua/colorscheme.lua | 21 +- nvim/.config/nvim/lua/completion.lua | 73 +++ nvim/.config/nvim/lua/dap_config.lua | 52 ++ nvim/.config/nvim/lua/ganymede.lua | 66 +++ nvim/.config/nvim/lua/gitsigns_config.lua | 78 +++ nvim/.config/nvim/lua/keybindings.lua | 424 +++++++++++------ nvim/.config/nvim/lua/lsp.lua | 115 ----- nvim/.config/nvim/lua/lvim.lua | 323 ++++++------- nvim/.config/nvim/lua/neovide.lua | 16 + nvim/.config/nvim/lua/plugins.lua | 471 ++++++++++--------- nvim/.config/nvim/lua/util.lua | 29 ++ nvim/.config/nvim/luasnippets/all.lua | 33 +- nvim/.config/nvim/luasnippets/markdown.lua | 181 ++++--- nvim/.config/nvim/queries/fcp/highlights.scm | 23 - 18 files changed, 1238 insertions(+), 831 deletions(-) create mode 100644 nvim/.config/nvim/.stylua.toml create mode 100644 nvim/.config/nvim/ftdetect/fcp.vim create mode 100644 nvim/.config/nvim/lua/completion.lua create mode 100644 nvim/.config/nvim/lua/dap_config.lua create mode 100644 nvim/.config/nvim/lua/ganymede.lua create mode 100644 nvim/.config/nvim/lua/gitsigns_config.lua delete mode 100644 nvim/.config/nvim/lua/lsp.lua create mode 100644 nvim/.config/nvim/lua/neovide.lua create mode 100644 nvim/.config/nvim/lua/util.lua delete mode 100644 nvim/.config/nvim/queries/fcp/highlights.scm diff --git a/nvim/.config/nvim/.stylua.toml b/nvim/.config/nvim/.stylua.toml new file mode 100644 index 0000000..ba0c6e6 --- /dev/null +++ b/nvim/.config/nvim/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 4 +quote_style = "AutoPreferSingle" +call_parentheses = "None" diff --git a/nvim/.config/nvim/ftdetect/fcp.vim b/nvim/.config/nvim/ftdetect/fcp.vim new file mode 100644 index 0000000..acb2a0f --- /dev/null +++ b/nvim/.config/nvim/ftdetect/fcp.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.fcp set filetype=fcp diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 720fa15..dfb1547 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,57 +1,63 @@ --- disable netrw at the very start of your init.lua -vim.g.loaded_netrwPlugin = 1 -vim.o.autochdir = false +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +vim.g.have_nerd_font = true + vim.wo.number = true -vim.g.mapleader = " " +vim.o.mouse = 'a' vim.schedule(function() - vim.o.clipboard = "unnamedplus" + vim.o.clipboard = 'unnamedplus' end) -vim.o.mouse = 'a' -vim.o.breakindent = true vim.o.undofile = true vim.o.ignorecase = true vim.o.smartcase = true -vim.o.signcolumn = "yes" -vim.o.updatetime = 300 -vim.o.cursorline = true +vim.o.signcolumn = 'yes' +vim.o.updatetime = 250 + +vim.opt.swapfile = false + +vim.o.inccommand = 'split' vim.o.scrolloff = 10 vim.o.confirm = true -vim.keymap.set('n', '', 'nohlsearch', { desc = "Clear search highlighting" }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +vim.o.splitright = true +vim.o.splitbelow = true + +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, }) -require('plugins').setup() -require('lsp').setup() -require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/luasnippets"}) -require("telescope").setup({ - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case" - } - } +-- Set conceallevel to 1 for markdown files, needed for obsidian.nvim +vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { + pattern = { '*.md' }, + command = 'lua vim.opt.conceallevel = 1', }) -pcall(require("telescope").load_extension, 'fzf') -pcall(require("telescope").load_extension, 'ui-select') -require('keybindings').setup() -require('colorscheme').setup() - -vim.api.nvim_create_autocmd('FileType', { - pattern = { '*.md' }, +vim.api.nvim_create_autocmd('BufWritePre', { + desc = 'Format on save', + pattern = { '*.lua', '*.rs', '*.py', '*.ts', '*.js', '*.cpp', '*.h', '*.c' }, + group = vim.api.nvim_create_augroup('format-on-save', { clear = true }), callback = function() - vim.o.conceallevel = 2 + vim.lsp.buf.format() end, }) + +require('plugins').setup() +require('luasnip.loaders.from_lua').load { paths = '~/.config/nvim/luasnippets' } +require('keybindings').setup() +require('colorscheme').setup() +require('neovide').setup() +require('completion').setup() +require('dap_config').setup() +require('gitsigns_config').setup() +require(vim.uv.os_gethostname()).setup() + + diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 675f88b..b1223d1 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,50 +1,61 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "87615648ff4dc852d1cf7ec099f0a7c37b1b2c87" }, + "CopilotChat.nvim": { "branch": "main", "commit": "69199d46b56f67a226789da256264c6291c4e63d" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, - "acronymviewer.nvim": { "branch": "master", "commit": "a03c3548e64b902bd0616cec6abb89406218bc2c" }, - "auto-dark-mode.nvim": { "branch": "master", "commit": "e300259ec777a40b4b9e3c8e6ade203e78d15881" }, - "blame.nvim": { "branch": "main", "commit": "b87b8c820e4cec06fbbd2f946b7b35c45906ee0c" }, - "blink.cmp": { "branch": "main", "commit": "636b79d7dcca6226572b13cacca06c756aeae51b" }, + "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, + "aw-watcher-vim": { "branch": "master", "commit": "4ba86d05a940574000c33f280fd7f6eccc284331" }, + "blame.nvim": { "branch": "main", "commit": "f3f6153ea94e1120f2776f22bbbd63c4aeebaf32" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, "cmp-ledger": { "branch": "main", "commit": "0b5c010dac3e3323d3611462ee9f0c8ee7f51d34" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "copilot.vim": { "branch": "release", "commit": "dfe0a3a1c256167d181488a73ec6ccab8d8931a9" }, + "codecompanion-copilot-enterprise.nvim": { "branch": "main", "commit": "81f70ecfd9fa74fd33f1eddb578414e604986b1e" }, + "codecompanion.nvim": { "branch": "main", "commit": "26fa57cd0ac019c9bae539e7530f7c9401cbee55" }, + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" }, - "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "fugitive-gitlab.vim": { "branch": "master", "commit": "3584cf7e607ba7822f991d407a8d780e05aae287" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" }, + "gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "954ecf72dab547f2a14db473cf6253eeb67dfd4a" }, + "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "limelight.vim": { "branch": "master", "commit": "0c8cc7f503a775c505dc9c67f1f5041ab4d5f1fd" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, - "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" }, - "neogit": { "branch": "master", "commit": "df08cb97f126c546a5ec265bafab2d78cc7399fa" }, - "neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" }, - "neotest-gtest": { "branch": "main", "commit": "16989561a6356878ec4ecd6afed4f0d7a471d1db" }, - "none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" }, - "nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ae609525ddf01c153c39305730b1791800ffe4fe" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.icons": { "branch": "main", "commit": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c" }, + "neogit": { "branch": "master", "commit": "73870229977fdd8747025820e15e98cfde787b9c" }, + "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, + "neotest-gtest": { "branch": "main", "commit": "b66f1d33cbf3b37b9803e6bc7ef47ac60eba86b1" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-dap": { "branch": "master", "commit": "e47878dcf1ccc30136b30d19ab19fe76946d61cd" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" }, + "nvim-lspconfig": { "branch": "master", "commit": "59cd07d8df2fefde32556268b8d52606a32152a1" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, - "nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" }, + "nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, - "obsidian.nvim": { "branch": "main", "commit": "705cc9b4f66eca1e54040ac819102e80a32896d3" }, + "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, + "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "1af6ffb9b5229a856e8090fa2f690e0931a5aace" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-project.nvim": { "branch": "master", "commit": "8e11df94419e444601c09828dadf70890484e443" }, + "project.nvim": { "branch": "main", "commit": "84df1ae586772d40fb5b723a9dfc16bdd376e84a" }, + "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "true-zen.nvim": { "branch": "main", "commit": "2b9e210e0d1a735e1fa85ec22190115dffd963aa" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, - "vim-ledger": { "branch": "master", "commit": "aabf1976dfefe5665233c600421aea2798ff7ea0" }, + "vim-ledger": { "branch": "master", "commit": "6d12e23e7261342f9dd4a23b9dd3a504454df002" }, + "vim-lumen": { "branch": "master", "commit": "97157aac9f0d24c144a3defdfe5057ee61e18dcb" }, "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, "whitespace.nvim": { "branch": "master", "commit": "8bf60b4a6892aa517a78a6014896078ae0c4c642" } } diff --git a/nvim/.config/nvim/lua/colorscheme.lua b/nvim/.config/nvim/lua/colorscheme.lua index 3008744..6372d13 100644 --- a/nvim/.config/nvim/lua/colorscheme.lua +++ b/nvim/.config/nvim/lua/colorscheme.lua @@ -1,25 +1,10 @@ local M = {} -local sunset = function(month) - local sunset = {18, 18, 19, 20, 21, 22, 22, 21, 20, 19, 18, 18} - return sunset[month] -end - -local sunrise = function(month) - local sunrise = {8, 8, 7, 6, 7, 6, 6, 7, 7, 8, 7, 8} - return sunrise[month] -end - M.setup = function() vim.opt.termguicolors = true - vim.cmd.colorscheme("gruvbox") - local time = os.date("*t") - - if time.hour <= sunrise(time.month) or time.hour >= sunset(time.month) then - vim.o.background = "dark" - else - vim.o.background = "light" - end + vim.cmd.colorscheme 'gruvbox' + vim.opt.colorcolumn = '80' + vim.api.nvim_set_hl(0, 'Beacon', { bg = 'white' }) end return M diff --git a/nvim/.config/nvim/lua/completion.lua b/nvim/.config/nvim/lua/completion.lua new file mode 100644 index 0000000..ee55ae3 --- /dev/null +++ b/nvim/.config/nvim/lua/completion.lua @@ -0,0 +1,73 @@ +local M = {} + +M.setup = function() + cmp = require 'cmp' + lvim = require 'lvim' + + cmp.setup { + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm { select = true }, + }, + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + sources = { + { name = 'copilot' }, + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + { name = 'emoji' }, + { name = 'buffer' }, + { name = 'cmp_tabnine' }, + { name = 'ledger' }, + }, + formatting = { + format = function(entry, vim_item) + local max_width = 0 --lvim.builtin.cmp.formatting.max_width + if max_width ~= 0 and #vim_item.abbr > max_width then + vim_item.abbr = string.sub(vim_item.abbr, 1, max_width - 1) .. lvim.icons.ui.Ellipsis + end + if lvim.use_icons then + vim_item.kind = lvim.icons.kind[vim_item.kind] --lvim.builtin.cmp.formatting.kind_icons[vim_item.kind] + + if entry.source.name == 'copilot' then + vim_item.kind = lvim.icons.git.Octoface + vim_item.kind_hl_group = 'CmpItemKindCopilot' + end + + if entry.source.name == 'cmp_tabnine' then + vim_item.kind = lvim.icons.misc.Robot + vim_item.kind_hl_group = 'CmpItemKindTabnine' + end + + if entry.source.name == 'crates' then + vim_item.kind = lvim.icons.misc.Package + vim_item.kind_hl_group = 'CmpItemKindCrate' + end + + if entry.source.name == 'lab.quick_data' then + vim_item.kind = lvim.icons.misc.CircuitBoard + vim_item.kind_hl_group = 'CmpItemKindConstant' + end + + if entry.source.name == 'emoji' then + vim_item.kind = lvim.icons.misc.Smiley + vim_item.kind_hl_group = 'CmpItemKindEmoji' + end + end + vim_item.menu = lvim.formatting.source_names[entry.source.name] + vim_item.dup = lvim.formatting.duplicates[entry.source.name] or lvim.formatting.duplicated_default + + return vim_item + end, + }, + } +end + +return M diff --git a/nvim/.config/nvim/lua/dap_config.lua b/nvim/.config/nvim/lua/dap_config.lua new file mode 100644 index 0000000..9928795 --- /dev/null +++ b/nvim/.config/nvim/lua/dap_config.lua @@ -0,0 +1,52 @@ +local M = {} + +M.setup = function() + local dap = require 'dap' + dap.adapters.gdb = { + type = 'executable', + command = 'gdb', + args = { '--interpreter=dap', '--eval-command', 'set print pretty on' }, + } + + dap.adapters.codelldb = { + type = 'server', + port = '${port}', + executable = { + command = '/home/joaj/.local/share/nvim/mason/bin/codelldb', -- I installed codelldb through mason.nvim + args = { '--port', '${port}' }, + }, + } + + dap.configurations.c = { + { + name = 'Attach to gdbserver :1234', + type = 'gdb', + request = 'attach', + target = 'localhost:1234', + program = function() + return vim.fn.input( + 'Path to executable: ', + '/home/joaj/bmw/orion2/bazel-bin/test/planning/motion_planning/behavior/lane_change/lane_segment_sequence_test' + ) + end, + cwd = '${workspaceFolder}', + }, + } + + dap.configurations.cpp = dap.configurations.c + dap.configurations.rust = dap.configurations.c + + dap.configurations.lua = { + { + type = 'nlua', + request = 'attach', + name = 'Attach to running Neovim instance', + }, + } + + dap.adapters.nlua = function(callback, config) + callback { type = 'server', host = config.host or '127.0.0.1', port = config.port or 8086 } + end +end + +return M diff --git a/nvim/.config/nvim/lua/ganymede.lua b/nvim/.config/nvim/lua/ganymede.lua new file mode 100644 index 0000000..2f990a0 --- /dev/null +++ b/nvim/.config/nvim/lua/ganymede.lua @@ -0,0 +1,66 @@ +local M = {} + +function code_companion_setup() + require('codecompanion').setup({ + adapters = { + http = { + copilot_enterprise = function() + local adapter = require 'codecompanion.adapters.http.copilot_enterprise' + adapter.opts.provider_url = "bmw.ghe.com" -- 'https://' can be removed but doesn't hurt. + return adapter + end, + }, + }, + strategies = { + chat = { + -- Setup the custom adapter for each strategy. You can change default models as usual. + -- See https://codecompanion.olimorris.dev/configuration/adapters.html#changing-the-default-adapter + -- and https://codecompanion.olimorris.dev/configuration/adapters.html#changing-a-model + adapter = { + name = "copilot_enterprise", + model = "claude-sonnet-4", + }, + }, + inline = { + adapter = "copilot_enterprise", + }, + cmd = { + adapter = "copilot_enterprise", + }, + }, + }) +end + +function copilot_setup() + vim.g.copilot_enterprise_uri = 'https://bmw.ghe.com' +end + +M.setup = function() + vim.g.copilot_enterprise_uri = 'https://bmw.ghe.com' + + _G.__cc_copilot_enterprise_url = nil + + do + local http = require("codecompanion.http") + + -- keep original function CC captured + local orig_post = http.static.methods.post.default + + http.static.methods.post.default = function(opts) + if opts + and opts.url == "https://api.githubcopilot.com/chat/completions" + and _G.__cc_copilot_enterprise_url + then + opts = vim.tbl_deep_extend("force", opts, { + url = _G.__cc_copilot_enterprise_url, + }) + end + return orig_post(opts) + end + end + + code_companion_setup() + copilot_setup() +end + +return M diff --git a/nvim/.config/nvim/lua/gitsigns_config.lua b/nvim/.config/nvim/lua/gitsigns_config.lua new file mode 100644 index 0000000..8e53b4a --- /dev/null +++ b/nvim/.config/nvim/lua/gitsigns_config.lua @@ -0,0 +1,78 @@ +local M = {} + +M.setup = function() + require('gitsigns').setup { + word_diff = false, + current_line_blame = true, + current_line_blame_opts = { + delay = 200, + }, + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' + end + end) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end) + + -- Actions + map('n', 'hs', gitsigns.stage_hunk) + map('n', 'hr', gitsigns.reset_hunk) + + map('v', 'hs', function() + gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + end) + + map('v', 'hr', function() + gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + end) + + map('n', 'hS', gitsigns.stage_buffer) + map('n', 'hR', gitsigns.reset_buffer) + map('n', 'hp', gitsigns.preview_hunk) + map('n', 'hi', gitsigns.preview_hunk_inline) + + map('n', 'hb', function() + gitsigns.blame_line { full = true } + end) + + map('n', 'hd', gitsigns.diffthis) + + map('n', 'hD', function() + gitsigns.diffthis '~' + end) + + map('n', 'hQ', function() + gitsigns.setqflist 'all' + end) + map('n', 'hq', gitsigns.setqflist) + + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame) + map('n', 'tw', gitsigns.toggle_word_diff) + + -- Text object + map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) + end, + } +end + +return M diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index a8696dd..2829ce5 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -1,148 +1,292 @@ local M = {} +-- Telescope keymaps for search +M.telescope_keymaps = function(wk) + local builtin = require 'telescope.builtin' + local telescope = require 'telescope' + + wk.add { + { 's', group = '[S]earch' }, + { 'sh', builtin.help_tags, desc = '[S]earch [H]elp' }, + { 'sk', builtin.keymaps, desc = '[S]earch [K]eymaps' }, + { 'g', builtin.git_files, desc = 'Search [G]it Files' }, + { 'st', builtin.git_files, desc = '[S]earch Git [Tracked] Files' }, + { 'sf', builtin.find_files, desc = '[S]earch [F]iles' }, + { 'ss', builtin.builtin, desc = '[S]earch [S]elect Telescope' }, + { 'sw', builtin.grep_string, desc = '[S]earch current [W]ord' }, + { 'sg', builtin.live_grep, desc = '[S]earch by [G]rep' }, + { 'sd', builtin.diagnostics, desc = '[S]earch [D]iagnostics' }, + { 'sr', builtin.resume, desc = '[S]earch [R]esume' }, + { 's.', builtin.oldfiles, desc = "[S]earch Recent Files ('.' for repeat)" }, + { '', builtin.buffers, desc = '[ ] Find existing buffers' }, + { 'sp', telescope.extensions.projects.projects, desc = '[S]earch [P]rojects' }, + { '/', builtin.current_buffer_fuzzy_find, desc = '[/] Fuzzily search in current buffer' }, + { + 's/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + desc = '[S]earch [/] in Open Files', + }, + { + 'sn', + function() + builtin.find_files { cwd = vim.fn.stdpath 'config' } + end, + desc = '[S]earch [N]eovim files', + }, + { + 'so', + function() + if vim.env.WIKI == nil then + vim.notify 'WIKI environment variable is not set' + return + end + builtin.find_files { cwd = vim.env.WIKI } + end, + desc = '[S]earch [O]bsidian files', + }, + + { 'e', 'NvimTreeToggle', desc = 'Find explorer' }, + } +end + +--- LSP keymaps +M.lsp_keymaps = function(wk) + wk.add { + { 'l', group = 'LSP' }, + { 'la', vim.lsp.buf.code_action, desc = '[L]sp Code [A]ction' }, + { 'lr', vim.lsp.buf.rename, desc = '[L]sp [R]ename' }, + { 'lf', vim.lsp.buf.format, desc = '[L]sp [F]ormat' }, + { + 'gd', + vim.lsp.buf.definition, + desc = '[g]o to [d]efinition (LSP)', + }, + { + 'gD', + vim.lsp.buf.declaration, + desc = '[g]o to [D]eclaration (LSP)', + }, + { + 'gi', + vim.lsp.buf.implementation, + desc = '[g]o to [i]mplementation (LSP)', + }, + { + 'go', + vim.lsp.buf.type_definition, + desc = '[g]o to type definiti[o]n (LSP)', + }, + { + 'gr', + vim.lsp.buf.references, + desc = '[g]o to [r]eferences (LSP)', + }, + { + 'gs', + vim.lsp.buf.signature_help, + desc = '[g]o to [s]ignature help (LSP)', + }, + { + 'o', + 'ClangdSwitchSourceHeader', + desc = 'switch between source and header', + }, + } +end + +--- Zen mode keymaps +M.zen_mode_keymaps = function(wk) + wk.add { + { 'z', group = 'Zen Mode' }, + { 'zr', 'TZNarrow', desc = 'Narrow' }, + { 'zf', 'TZFocus', desc = 'Focus' }, + { 'zm', 'TZMinimalist', desc = 'Minimalist' }, + { 'za', 'TZAtaraxis', desc = 'Ataraxis' }, + { 'zl', 'Limelight', desc = 'Limelight' }, + + --- Trouble --- + + { 'x', group = 'Trouble' }, + { + 'xx', + 'Trouble diagnostics toggle focus=True', + desc = 'Diagnostics (Trouble)', + }, + { + 'xX', + 'Trouble diagnostics toggle filter.buf=0 focus=True', + desc = 'Buffer Diagnostics (Trouble)', + }, + { + 'xs', + 'Trouble symbols toggle focus=false', + desc = 'Symbols (Trouble)', + }, + { + 'xl', + 'Trouble lsp toggle focus=false win.position=right', + desc = 'LSP Definitions / references / ... (Trouble)', + }, + { + 'xL', + 'Trouble loclist toggle', + desc = 'Location List (Trouble)', + }, + { + 'xQ', + 'Trouble qflist toggle', + desc = 'Quickfix List (Trouble)', + }, + } +end + +-- DAP keymaps +M.dap_keymaps = function(wk) + local dap = require 'dap' + local widgets = require 'dap.ui.widgets' + wk.add { + { 'd', group = 'Dap' }, + { 'db', dap.toggle_breakpoint, desc = 'Toggle Breakpoint (Dap)' }, + { 'dc', dap.continue, desc = 'Continue (Dap)' }, + { 'di', dap.step_into, desc = 'Step Into (Dap)' }, + { 'do', dap.step_over, desc = 'Step Over (Dap)' }, + { 'dO', dap.step_out, desc = 'Step Out (Dap)' }, + { 'dr', dap.repl.toggle, desc = 'Toggle Repl (Dap)' }, + { 'dL', dap.run_last, desc = 'Run Last (Dap)' }, + { + 'dl', + function() + require('osv').launch { port = 8086 } + end, + desc = 'Launch nvim plugin (Dap)', + }, + { 'dw', widgets.hover, desc = 'Widgets Hover (Dap)' }, + { + 'df', + function() + widgets.centered_float(widgets.frames) + end, + desc = 'Widgets Frames (Dap)', + }, + } +end + +M.gitsigns_keymaps = function(wk) + local gitsigns = require 'gitsigns' + wk.add { + { + ']c', + function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' + end + end, + desc = 'Go to next git [C]hunk (Gitsigns)', + mode = 'n', + }, + { + '[c', + function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, + desc = 'Go to previous git [C]hunk (Gitsigns)', + mode = 'n', + }, + { 'hs', gitsigns.stage_hunk, desc = '[s]tage Hunk (Gitsigns)', mode = 'n' }, + { 'hr', gitsigns.reset_hunk, desc = '[r]eset Hunk (Gitsigns)', mode = 'n' }, + { + 'hs', + function() + gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, + desc = '[s]tage Hunk (Gitsigns)', + mode = 'v', + }, + { + 'hr', + function() + gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, + desc = '[r]eset Hunk (Gitsigns)', + mode = 'v', + }, + { 'hS', gitsigns.stage_buffer, desc = '[S]tage Buffer (Gitsigns)', mode = 'n' }, + { 'hR', gitsigns.reset_buffer, desc = '[R]eset Buffer (Gitsigns)', mode = 'n' }, + { 'hp', gitsigns.preview_hunk, desc = 'Preview [H]unk (Gitsigns)', mode = 'n' }, + { 'hi', gitsigns.preview_hunk_inline, desc = 'Preview Hunk [i]nline (Gitsigns)', mode = 'n' }, + { + 'hb', + function() + gitsigns.blame_line { full = true } + end, + desc = '[B]lame Line (Gitsigns)', + mode = 'n', + }, + { 'hd', gitsigns.diffthis, desc = '[Ddiff This (Gitsigns)', mode = 'n' }, + { + 'hD', + function() + gitsigns.diffthis '~' + end, + desc = 'Diff This [~] (Gitsigns)', + mode = 'n', + }, + { + 'hQ', + function() + gitsigns.setqflist 'all' + end, + desc = 'Set [Q]uickfix List (Gitsigns)', + mode = 'n', + }, + { 'hq', gitsigns.setqflist, desc = 'Set [q]uickfix List (Gitsigns)', mode = 'n' }, + { 'htb', gitsigns.toggle_current_line_blame, desc = '[T]oggle Current Line [b]lame (Gitsigns)', mode = 'n' }, + { 'htw', gitsigns.toggle_word_diff, desc = '[T]oggle [w]ord Diff (Gitsigns)', mode = 'n' }, + { 'ih', gitsigns.select_hunk, desc = 'Select [H]unk (Gitsigns)', mode = { 'o', 'x' } }, + } +end + M.setup = function() - local telescope_builtin = require("telescope.builtin") - local wk = require("which-key") - wk.add({ - {"f", telescope_builtin.find_files, desc="Find file"}, - {"g", telescope_builtin.git_files, desc="Find git files"}, - {"s", group = "[S]earch"}, - {"sh", telescope_builtin.help_tags, desc="[S]earch [H]elp"}, - {"sk", telescope_builtin.keymaps, desc="[S]earch [K]eymaps"}, - {"sf", telescope_builtin.find_files, desc="[S]earch [F]iles"}, - {"ss", telescope_builtin.builtin, desc="[S]earch [S]elect Telescope"}, - {"sw", telescope_builtin.grep_string, desc="[S]earch current [W]ord"}, - {"sg", telescope_builtin.live_grep, desc="[S]earch by [G]rep"}, - {"sd", telescope_builtin.diagnostics, desc="[S]earch [D]iagnostics"}, - {"sr", telescope_builtin.resume, desc="[S]earch [R]esume"}, - {"s.", telescope_builtin.oldfiles, desc="[S]earch Recent Files ('.' for repeat)"}, - {"", telescope_builtin.buffers, desc="[ ] Find existing buffers"}, - { - "/", - function() - telescope_builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, - desc = "[/] Fuzzy search in current buffer" - }, - { - "s/", - function() - telescope_builtin.live_grep { - grep_open_files = true, - prompt_title = "Grep in open files", - } - end, - desc = "[S]earch [/] in open files" - }, - { - "sn", - function() - telescope_builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, - desc = "[S]earch [N]eovim files" - }, - {"e", "NvimTreeToggle", desc="File explorer"}, - {"o", "ClangdSwitchSourceHeader", desc="Switch between source and header"}, - {"D", vim.lsp.buf.type_definition, desc="Lsp type definition"}, - {"l", group = "[L]sp"}, - {"la", vim.lsp.buf.code_action, desc = "Lsp code action" }, - {"lr", vim.lsp.buf.rename, desc = "Lsp rename" }, - {"lf", vim.lsp.buf.format, desc = "Lsp format" }, - {"z", group = "[Z]en"}, - {"zn", "TZNarrow", desc="Narrow"}, - {"zf", "TZFocus", desc="Focus"}, - {"zm", "TZMinimalist", desc="Minimalist"}, - {"za", "TZAtaraxis", desc="Ataraxis"}, - {"zl", "Limelight", desc="Limelight"}, - { "x", group = "Trouble" }, - { - "xx", - "Trouble diagnostics toggle focus=True", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0 focus=True", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "xs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "xl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - { - "gd", - vim.lsp.buf.definition, - desc = "Go to definition (LSP)", - }, - { - "gD", - vim.lsp.buf.declaration, - desc = "Go to declaration (LSP)", - }, - { - "gi", - vim.lsp.buf.implementation, - desc = "Go to implementation (LSP)", - }, - { - "go", - vim.lsp.buf.type_definition, - desc = "Go to type definition (LSP)", - }, - { - "gr", - vim.lsp.buf.references, - desc = "Go to references (LSP)", - }, - { - "gs", - vim.lsp.buf.signature_help, - desc = "Signature help (LSP)", - }, - { "gl", vim.diagnostic.open_float, desc = "Show diagnostics" }, - { "[d", vim.diagnostic.get_prev, desc = "Previous diagnostic" }, - { "]d", vim.diagnostic.get_next, desc = "Next diagnostic" }, - { "q", vim.diagnostic.setloclist, desc = "Quickfix list" }, - { - 'lk', - function() - local acronym = vim.fn.input { - prompt = 'Acronym: ', - } - local result = require('acronym-viewer').lookup(acronym) - if result == nil then - vim.notify('Could not find a definition for ' .. acronym .. '.', vim.log.levels.ERROR) - else - vim.notify(result, vim.log.levels.INFO) - end - end, - }, - }) + local wk = require 'which-key' + wk.add { + { + '?', + function() + wk.show { global = false } + end, + desc = 'Buffer Local Keymaps (which-key)', + }, + { 'q', vim.diagnostic.setloclist, desc = 'Open diagnostic [Q]uickfix list' }, + { + '', + 'nohlsearch', + mode = 'n', + desc = 'Clear search highlight', + }, + } - vim.keymap.set("n", "gre", require('telescope.builtin').lsp_references, {silent=true}) - vim.keymap.set("n", "gl", vim.diagnostic.open_float, {silent = true}) - vim.keymap.set("n", "[d", function() vim.diagnostic.jump({count=-1, float=true}) end, {silent = true}) - vim.keymap.set("n", "]d", function() vim.diagnostic.jump({count=1, float=true}) end, {silent = true}) + M.telescope_keymaps(wk) + M.lsp_keymaps(wk) + M.zen_mode_keymaps(wk) + M.dap_keymaps(wk) + M.gitsigns_keymaps(wk) + wk.add { + { 'gl', vim.diagnostic.open_float, desc = 'Show diagnostics' }, + { '[d', vim.diagnostic.get_prev, desc = 'Previous diagnostic' }, + { ']d', vim.diagnostic.get_next, desc = 'Next diagnostic' }, + } end return M diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua deleted file mode 100644 index 37859df..0000000 --- a/nvim/.config/nvim/lua/lsp.lua +++ /dev/null @@ -1,115 +0,0 @@ -local M = {} - -M.setup = function() - - local lsp_zero = require("lsp-zero") - - local lua_opts = lsp_zero.nvim_lua_ls({ - single_file_support = false, - on_attach = function(client, bufnr) print("hello world") end - }) - - require("lspconfig").lua_ls.setup(lua_opts) - - lsp_zero.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({buffer = bufnr}) - end) - - --- if you want to know more about lsp-zero and mason.nvim - --- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guide/integrate-with-mason-nvim.md - require("mason").setup({}) - require("mason-lspconfig").setup({ - handlers = { - function(server_name) - require("lspconfig")[server_name].setup({}) - end - } - }) - - require("lspconfig").rust_analyzer.setup({}) - require("lspconfig").clangd.setup({}) - require("lspconfig").lua_ls.setup({ - settings = {Lua = {completion = {callSnippet = "Replace"}}} - }) - - lsp_zero.setup_servers({"rust_analyzer"}) - - local cmp = require("cmp") - local cmp_action = require("lsp-zero").cmp_action() - - local lvim = require('lvim') - - cmp.setup({ - mapping = cmp.mapping.preset.insert({ - -- `Enter` key to confirm completion - [""] = cmp.mapping.confirm({select = false}), - - -- Ctrl+Space to trigger completion menu - [""] = cmp.mapping.complete(), - - -- Navigate between snippet placeholder - [""] = cmp_action.luasnip_jump_forward(), - [""] = cmp_action.luasnip_jump_backward(), - - -- Scroll up and down in the completion documentation - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4) - }), - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end - }, - sources = { - {name = "luasnip"}, {name = "nvim_lsp"}, {name = "buffer"}, - {name = "ledger"} - }, - formatting = { - format = function(entry, vim_item) - local max_width = 0 -- lvim.builtin.cmp.formatting.max_width - if max_width ~= 0 and #vim_item.abbr > max_width then - vim_item.abbr = - string.sub(vim_item.abbr, 1, max_width - 1) .. - lvim.icons.ui.Ellipsis - end - if lvim.use_icons then - vim_item.kind = lvim.icons.kind[vim_item.kind] -- lvim.builtin.cmp.formatting.kind_icons[vim_item.kind] - - if entry.source.name == "copilot" then - vim_item.kind = lvim.icons.git.Octoface - vim_item.kind_hl_group = "CmpItemKindCopilot" - end - - if entry.source.name == "cmp_tabnine" then - vim_item.kind = lvim.icons.misc.Robot - vim_item.kind_hl_group = "CmpItemKindTabnine" - end - - if entry.source.name == "crates" then - vim_item.kind = lvim.icons.misc.Package - vim_item.kind_hl_group = "CmpItemKindCrate" - end - - if entry.source.name == "lab.quick_data" then - vim_item.kind = lvim.icons.misc.CircuitBoard - vim_item.kind_hl_group = "CmpItemKindConstant" - end - - if entry.source.name == "emoji" then - vim_item.kind = lvim.icons.misc.Smiley - vim_item.kind_hl_group = "CmpItemKindEmoji" - end - end - vim_item.menu = lvim.formatting.source_names[entry.source.name] - vim_item.dup = lvim.formatting.duplicates[entry.source.name] or - lvim.formatting.duplicated_default -- builtin.cmp.formatting.duplicates_default - - return vim_item - end - } - }) -end - -return M diff --git a/nvim/.config/nvim/lua/lvim.lua b/nvim/.config/nvim/lua/lvim.lua index 7061175..5e7a63f 100644 --- a/nvim/.config/nvim/lua/lvim.lua +++ b/nvim/.config/nvim/lua/lvim.lua @@ -2,177 +2,182 @@ return { use_icons = true, icons = { kind = { - Array = "", - Boolean = "", - Class = "", - Color = "", - Constant = "", - Constructor = "", - 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 = "" + Array = '', + Boolean = '', + Class = '', + Color = '', + Constant = '', + Constructor = '', + 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 = '', }, git = { - LineAdded = "", - LineModified = "", - LineRemoved = "", - FileDeleted = "", - FileIgnored = "◌", - FileRenamed = "", - FileStaged = "S", - FileUnmerged = "", - FileUnstaged = "", - FileUntracked = "U", - Diff = "", - Repo = "", - Octoface = "", - Branch = "" + LineAdded = '', + LineModified = '', + LineRemoved = '', + FileDeleted = '', + FileIgnored = '◌', + FileRenamed = '', + FileStaged = 'S', + FileUnmerged = '', + FileUnstaged = '', + FileUntracked = 'U', + Diff = '', + Repo = '', + Octoface = '', + Branch = '', }, ui = { - ArrowCircleDown = "", - ArrowCircleLeft = "", - ArrowCircleRight = "", - ArrowCircleUp = "", - BoldArrowDown = "", - BoldArrowLeft = "", - BoldArrowRight = "", - BoldArrowUp = "", - BoldClose = "", - BoldDividerLeft = "", - BoldDividerRight = "", - BoldLineLeft = "▎", - BookMark = "", - BoxChecked = "", - Bug = "", - Stacks = "", - Scopes = "", - Watches = "󰂥", - DebugConsole = "", - Calendar = "", - Check = "", - ChevronRight = "", - ChevronShortDown = "", - ChevronShortLeft = "", - ChevronShortRight = "", - ChevronShortUp = "", - Circle = " ", - Close = "󰅖", - CloudDownload = "", - Code = "", - Comment = "", - Dashboard = "", - DividerLeft = "", - DividerRight = "", - DoubleChevronRight = "»", - Ellipsis = "", - EmptyFolder = "", - EmptyFolderOpen = "", - File = "", - FileSymlink = "", - Files = "", - FindFile = "󰈞", - FindText = "󰊄", - Fire = "", - Folder = "󰉋", - FolderOpen = "", - FolderSymlink = "", - Forward = "", - Gear = "", - History = "", - Lightbulb = "", - LineLeft = "▏", - LineMiddle = "│", - List = "", - Lock = "", - NewFile = "", - Note = "", - Package = "", - Pencil = "󰏫", - Plus = "", - Project = "", - Search = "", - SignIn = "", - SignOut = "", - Tab = "󰌒", - Table = "", - Target = "󰀘", - Telescope = "", - Text = "", - Tree = "", - Triangle = "󰐊", - TriangleShortArrowDown = "", - TriangleShortArrowLeft = "", - TriangleShortArrowRight = "", - TriangleShortArrowUp = "" + ArrowCircleDown = '', + ArrowCircleLeft = '', + ArrowCircleRight = '', + ArrowCircleUp = '', + BoldArrowDown = '', + BoldArrowLeft = '', + BoldArrowRight = '', + BoldArrowUp = '', + BoldClose = '', + BoldDividerLeft = '', + BoldDividerRight = '', + BoldLineLeft = '▎', + BookMark = '', + BoxChecked = '', + Bug = '', + Stacks = '', + Scopes = '', + Watches = '󰂥', + DebugConsole = '', + Calendar = '', + Check = '', + ChevronRight = '', + ChevronShortDown = '', + ChevronShortLeft = '', + ChevronShortRight = '', + ChevronShortUp = '', + Circle = ' ', + Close = '󰅖', + CloudDownload = '', + Code = '', + Comment = '', + Dashboard = '', + DividerLeft = '', + DividerRight = '', + DoubleChevronRight = '»', + Ellipsis = '', + EmptyFolder = '', + EmptyFolderOpen = '', + File = '', + FileSymlink = '', + Files = '', + FindFile = '󰈞', + FindText = '󰊄', + Fire = '', + Folder = '󰉋', + FolderOpen = '', + FolderSymlink = '', + Forward = '', + Gear = '', + History = '', + Lightbulb = '', + LineLeft = '▏', + LineMiddle = '│', + List = '', + Lock = '', + NewFile = '', + Note = '', + Package = '', + Pencil = '󰏫', + Plus = '', + Project = '', + Search = '', + SignIn = '', + SignOut = '', + Tab = '󰌒', + Table = '', + Target = '󰀘', + Telescope = '', + Text = '', + Tree = '', + Triangle = '󰐊', + TriangleShortArrowDown = '', + TriangleShortArrowLeft = '', + TriangleShortArrowRight = '', + TriangleShortArrowUp = '', }, diagnostics = { - BoldError = "", - Error = "", - BoldWarning = "", - Warning = "", - BoldInformation = "", - Information = "", - BoldQuestion = "", - Question = "", - BoldHint = "", - Hint = "󰌶", - Debug = "", - Trace = "✎" + BoldError = '', + Error = '', + BoldWarning = '', + Warning = '', + BoldInformation = '', + Information = '', + BoldQuestion = '', + Question = '', + BoldHint = '', + Hint = '󰌶', + Debug = '', + Trace = '✎', }, misc = { - Robot = "󰚩", - Squirrel = "", - Tag = "", - Watch = "", - Smiley = "", - Package = "", - CircuitBoard = "" - } + Robot = '󰚩', + Squirrel = '', + Tag = '', + Watch = '', + Smiley = '', + Package = '', + CircuitBoard = '', + }, }, formatting = { - fields = {"kind", "abbr", "menu"}, + fields = { 'kind', 'abbr', 'menu' }, max_width = 0, - -- kind_icons = lvim.icons.kind, + --kind_icons = lvim.icons.kind, source_names = { - nvim_lsp = "(LSP)", - emoji = "(Emoji)", - path = "(Path)", - calc = "(Calc)", - cmp_tabnine = "(Tabnine)", - vsnip = "(Snippet)", - luasnip = "(Snippet)", - buffer = "(Buffer)", - tmux = "(TMUX)", - copilot = "(Copilot)", - treesitter = "(TreeSitter)" + nvim_lsp = '(LSP)', + emoji = '(Emoji)', + path = '(Path)', + calc = '(Calc)', + cmp_tabnine = '(Tabnine)', + vsnip = '(Snippet)', + luasnip = '(Snippet)', + buffer = '(Buffer)', + tmux = '(TMUX)', + copilot = '(Copilot)', + treesitter = '(TreeSitter)', + }, + duplicates = { + buffer = 1, + path = 1, + nvim_lsp = 0, + luasnip = 1, }, - duplicates = {buffer = 1, path = 1, nvim_lsp = 0, luasnip = 1}, - duplicates_default = 0 - } + duplicates_default = 0, + }, } diff --git a/nvim/.config/nvim/lua/neovide.lua b/nvim/.config/nvim/lua/neovide.lua new file mode 100644 index 0000000..59834cc --- /dev/null +++ b/nvim/.config/nvim/lua/neovide.lua @@ -0,0 +1,16 @@ +local M = {} + +M.setup = function() + if vim.g.neovide then + vim.g.neovide_opacity = 0.92 + vim.g.neovide_normal_opacity = 0.92 + vim.o.guifont = 'Fira Code:h10' + vim.g.neovide_cursor_animation_length = 0.01 + vim.g.neovide_scroll_animation_length = 0.01 + vim.g.neovide_position_animation_length = 0.01 + vim.g.neovide_theme = 'auto' + vim.g.neovide_hide_mouse_when_typing = false + end +end + +return M diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 9f48a13..64de8dc 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -1,303 +1,348 @@ local M = {} M.setup = function() - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end + local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' + local uv = vim.uv or vim.loop + + -- Auto-install lazy.nvim if not present + if not uv.fs_stat(lazypath) then + print 'Installing lazy.nvim....' + vim.fn.system { + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', + lazypath, + } + print 'Done.' end + vim.opt.rtp:prepend(lazypath) - require("lazy").setup({ + require('lazy').setup({ { - "folke/lazydev.nvim", - ft = 'lua', + 'NMAC427/guess-indent.nvim', opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + on_tab_options = { + ['expandtab'] = true, }, }, }, { - 'NMAC427/guess-indent.nvim', - opts = { - on_tab_options = { - ["expandtab"] = true, - } - } - }, - { - "johnfrankmorgan/whitespace.nvim", + 'folke/lazydev.nvim', + ft = 'lua', opts = { - highlight = "DiffDelete", - ignored_filetypes = { "TelescopePrompt", "Trouble", "help", "dashboard" }, - ignore_terminal = true, - return_cursor = true, + library = { + { path = '${3rd}/luv/library', word = { 'vim%.uv' } }, + }, }, }, - "tpope/vim-fugitive", { - "tpope/vim-rhubarb", + 'johnfrankmorgan/whitespace.nvim', config = function() - vim.g.github_enterprise_urls = { 'cc-github.bmwgroup.net' } - end + require('whitespace-nvim').setup { + highlight = 'DiffDelete', + ignored_filetypes = { 'TelescopePrompt', 'Trouble', 'help', 'dashboard' }, + ignore_terminal = true, + return_cursor = true, + } + end, }, + { 'tpope/vim-fugitive' }, + { 'tpope/vim-rhubarb' }, + { 'shumphrey/fugitive-gitlab.vim' }, { - "NeogitOrg/neogit", + 'NeogitOrg/neogit', + opts = { + graph_style = 'unicode', + }, dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", + 'nvim-lua/plenary.nvim', + 'sindrets/diffview.nvim', + 'nvim-telescope/telescope.nvim', }, - config = true + config = true, }, + { 'lewis6991/gitsigns.nvim' }, + + --- LSP --- + { 'neovim/nvim-lspconfig' }, + { 'mason-org/mason.nvim', opts = {} }, + { 'williamboman/mason-lspconfig.nvim', opts = {} }, + { 'hrsh7th/nvim-cmp' }, + { 'hrsh7th/cmp-nvim-lsp' }, + { 'hrsh7th/cmp-buffer' }, + { 'hrsh7th/cmp-path' }, + { 'hrsh7th/cmp-cmdline' }, + { 'hrsh7th/cmp-emoji' }, { - "lewis6991/gitsigns.nvim", - opts = { - current_line_blame = false, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', - delay = 300, - ignore_whitespace = false, - virt_text_priority = 100, - use_focus = true, - }, - }}, - { "VonHeikemen/lsp-zero.nvim", branch = "v3.x" }, + 'folke/trouble.nvim', + opts = {}, + cmd = 'Trouble', + }, { - "neovim/nvim-lspconfig", - dependencies = { - { "williamboman/mason.nvim", opts={} }, - "williamboman/mason-lspconfig.nvim", - 'WhoIsSethDaniel/mason-tool-installer.nvim', - { "j-hui/fidget.nvim", opts = {} }, - 'saghen/blink.cmp' - }, + 'zbirenbaum/copilot-cmp', + opts = {}, }, - { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/nvim-cmp" }, { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ null_ls.builtins.formatting.black }) - end + 'L3MON4D3/LuaSnip', + run = 'make install_jsregexp', + dependencies = { 'rafamadriz/friendly-snippets' }, }, + --- Follow system wide theme (dark/light) + { 'vimpostor/vim-lumen' }, + --- Gruvbox! --- { - "ellisonleao/gruvbox.nvim", - lazy = false, - priority = 1000, + 'ellisonleao/gruvbox.nvim', + opts = { transparent_mode = not vim.g.neovide }, }, - "nvim-telescope/telescope-project.nvim", { - "nvim-tree/nvim-tree.lua", + 'nvim-tree/nvim-tree.lua', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, config = function() - require("nvim-tree").setup({ + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + vim.opt.termguicolors = true + + require('nvim-tree').setup { sync_root_with_cwd = true, respect_buf_cwd = true, update_focused_file = { enable = true, - update_root = true + update_root = true, + }, + sort = { + sorter = 'case_sensitive', }, view = { - width = 80, - } - }) - end + width = 50, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + } + end, + }, + { + 'stevearc/oil.nvim', + dependencies = { { 'echasnovski/mini.icons', opts = {} } }, + opts = {}, + lazy = false, }, { - "nvim-telescope/telescope.nvim", + 'nvim-telescope/telescope.nvim', + event = 'VimEnter', dependencies = { - "nvim-lua/plenary.nvim", - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" - }, + 'nvim-lua/plenary.nvim', { - "nvim-telescope/telescope-ui-select.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("telescope").load_extension("ui-select") - end + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release', }, - { 'nvim-tree/nvim-web-devicons', enabled = true }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + 'nvim-telescope/telescope-ui-select.nvim', }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - dependencies = { "echasnovski/mini.icons" } - }, - { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" } - }, - { "saadparwaiz1/cmp_luasnip" }, - { "pocco81/true-zen.nvim" }, - { "junegunn/limelight.vim" }, - { - "FabijanZulj/blame.nvim", - config = function() require("blame").setup() end - }, - { "ledger/vim-ledger" }, - { "piero-vic/cmp-ledger" }, - { - "lewis6991/gitsigns.nvim", - config = function() require("gitsigns").setup() end - }, - { "github/copilot.vim" }, - { - "nvim-treesitter/nvim-treesitter", config = function() - local parser_config = require "nvim-treesitter.parsers".get_parser_configs() - parser_config.fcp = { - install_info = { - url = "~/sources/fcp-core/tree-sitter-fcp", - files = { "src/parser.c" }, - generate_requires_npm = false, - requires_generate_from_grammar = false, + require('telescope').setup { + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown {}, + }, + ['fzf'] = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = 'smart_case', + }, }, - filetype = "fcp", - } - require 'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - } } + + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') end, }, { - "f-person/auto-dark-mode.nvim", - + 'folke/which-key.nvim', + event = 'VimEnter', opts = { - fallback = "light" - } + delay = 0, + icon = { + mappings = vim.g.have_nerd_font, + }, + }, }, - { "mfussenegger/nvim-dap" }, + { 'saadparwaiz1/cmp_luasnip' }, + { 'pocco81/true-zen.nvim' }, + { 'junegunn/limelight.vim' }, { - "rcarriga/nvim-dap-ui", - dependencies = { - "mfussenegger/nvim-dap", - "nvim-neotest/nvim-nio" - } + 'FabijanZulj/blame.nvim', + config = function() + require('blame').setup() + end, }, + { 'ledger/vim-ledger' }, + { 'piero-vic/cmp-ledger' }, { - "https://cc-github.bmwgroup.net/shaharklinger/acronymviewer.nvim", + 'DrKJeff16/project.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + }, opts = {}, - lazy = false, }, { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "nvim-lua/plenary.nvim", branch = "master" }, - }, - build = "make tiktoken", + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + branch = "master", opts = { + ensure_installed = { + 'bash', + 'c', + 'diff', + 'html', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'query', + 'vimdoc', + 'rust', + 'toml', + 'yaml', + 'cpp', + }, + auto_install = true, + highlight = { enable = true }, + incremental_selection = { enable = true }, + indent = { enable = true }, }, }, + { 'github/copilot.vim' }, + --{ 'ActivityWatch/aw-watcher-vim' }, { - "obsidian-nvim/obsidian.nvim", - version = "*", + 'epwalsh/obsidian.nvim', + version = '*', lazy = true, event = { - "BufReadPre " .. vim.fn.expand("~") .. "/sources/wiki/*.md", - "BufNewFile " .. vim.fn.expand("~") .. "/sources/wiki/*.md", + 'BufReadPre ' .. vim.fn.expand '~' .. '/Sync/wiki/*.md', + 'BufNewFile ' .. vim.fn.expand '~' .. '/Sync/wiki/*.md', }, dependencies = { - "nvim-lua/plenary.nvim", + 'nvim-lua/plenary.nvim', }, opts = { workspaces = { { - name = "wiki", - path = "~/sources/wiki", + name = 'wiki', + path = '~/Sync/wiki', }, }, attachments = { - img_folder = "assets/imgs", - } - + img_folder = 'assets', + }, + }, + }, + { 'mfussenegger/nvim-dap' }, + { + 'rcarriga/nvim-dap-ui', + dependencies = { + 'mfussenegger/nvim-dap', + 'nvim-neotest/nvim-nio', + 'jbyuki/one-small-step-for-vimkind', }, + lazy = true, + }, + { + 'mrcjkb/rustaceanvim', + version = '^6', -- Recommended + lazy = false, -- This plugin is already lazy + config = function() + vim.g.rustaceanvim = function() + -- Update this path + local extension_path = vim.env.HOME .. '/home/joaj/.vscode/extensions/vadimcn.vscode-lldb-1.10.0/' + local codelldb_path = extension_path .. 'adapter/codelldb' + local liblldb_path = extension_path .. 'lldb/lib/liblldb.so' + local cfg = require 'rustaceanvim.config' + return { + dap = { + adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path), + }, + } + end + end, }, - { "rcarriga/nvim-notify", opts = { stages = "static" } }, { - "nvim-neotest/neotest", + 'nvim-neotest/neotest', dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "alfaix/neotest-gtest" + 'nvim-neotest/nvim-nio', + 'nvim-lua/plenary.nvim', + 'antoinemadec/FixCursorHold.nvim', + 'nvim-treesitter/nvim-treesitter', + 'alfaix/neotest-gtest', }, config = function() - require("neotest").setup({ + local utils = require 'neotest-gtest.utils' + local lib = require 'neotest.lib' + require('neotest').setup { adapters = { - require("neotest-gtest").setup({ + require('neotest-gtest').setup { -- which debug adater to use? dap.adapters. must be defined. - debug_adapter = "gdb", - }) + debug_adapter = 'gdb', + }, + require 'rustaceanvim.neotest', }, - discovery = - { + discovery = { enabled = false, - concurrent = 1 + concurrent = 1, }, - }) + } end, }, - }) - - local dap = require("dap") - dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "--interpreter=dap", "--eval-command", "set print pretty on" } - } - - dap.adapters.codelldb = { - type = "server", - port = "${port}", - executable = { - command = "/home/joaj/.local/share/nvim/mason/bin/codelldb", -- I installed codelldb through mason.nvim - args = { "--port", "${port}" } - }, - } - - - dap.configurations.c = { { - name = 'Attach to gdbserver :1234', - type = 'gdb', - request = 'attach', - target = 'localhost:1234', - program = function() - return vim.fn.input('Path to executable: ', - '/home/joaj/bmw/orion2/bazel-bin/test/planning/motion_planning/behavior/lane_change/lane_segment_sequence_test') - end, - cwd = '${workspaceFolder}' + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + signs = false, + }, }, - } - - - dap.configurations.cpp = dap.configurations.c - dap.configurations.rust = dap.configurations.c - - vim.notify = require("notify") + { + "olimorris/codecompanion.nvim", + version = "^18.0.0", + dependencies = { + "PrimaMateria/codecompanion-copilot-enterprise.nvim", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + }, + }, { + ui = { + -- If you are using a Nerd Font: set icons to an empty table which will use the + -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table + icons = vim.g.have_nerd_font and {} or { + cmd = '⌘', + config = '🛠', + event = '📅', + ft = '📂', + init = '⚙', + keys = '🗝', + plugin = '🔌', + runtime = '💻', + require = '🌙', + source = '📄', + start = '🚀', + task = '📌', + lazy = '💤 ', + }, + }, + }) end return M diff --git a/nvim/.config/nvim/lua/util.lua b/nvim/.config/nvim/lua/util.lua new file mode 100644 index 0000000..d8f6f30 --- /dev/null +++ b/nvim/.config/nvim/lua/util.lua @@ -0,0 +1,29 @@ +local M = {} + +local function string_contains_prefix(str, prefix) + return string.sub(str, 0, #prefix) == prefix +end + +M.string_remove_prefix = function(str, prefix) + return string_contains_prefix(str, prefix) and string.sub(str, #prefix + 1) or str +end + +M.copy_active_buffer_path = function(register) + local current_file = M.string_remove_prefix(vim.fn.getreg '%', vim.fn.getcwd() .. '/') + + vim.fn.setreg(register ~= nil and register or '', current_file) + vim.notify('Copied ' .. current_file, vim.log.levels.INFO) +end + +M.copy_active_buffer_abs_path = function(register) + local abs_path = vim.fn.getreg '%' + + if string_contains_prefix(abs_path, '/') == false then + abs_path = vim.fn.getcwd() .. '/' .. vim.fn.getreg '%' + end + + vim.fn.setreg(register ~= nil and register or '', abs_path) + vim.notify('Copied ' .. abs_path, vim.log.levels.INFO) +end + +return M diff --git a/nvim/.config/nvim/luasnippets/all.lua b/nvim/.config/nvim/luasnippets/all.lua index 8abce05..4ba8b24 100644 --- a/nvim/.config/nvim/luasnippets/all.lua +++ b/nvim/.config/nvim/luasnippets/all.lua @@ -1,17 +1,20 @@ return { - s("copyright", { - t("// Copyright "), f(function() return os.date("%Y") end), - t(" João Freitas") - }), s("gpl3", t({ - "// This program is free software: you can redistribute it and/or modify it under the terms of", - "// the GNU General Public License as published by the Free Software Foundation, either", - "// version 3 of the License, or (at your option) any later version.", - "//", - "// This program is distributed in the hope that it will be useful, but WITHOUT ANY", - "// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR", - "// A PARTICULAR PURPOSE. See the GNU General Public License for more details.", - "//", - "// You should have received a copy of the GNU General Public License along with this", - "// program. If not, see ." - })) + s('copyright', { t '// Copyright ', f(function() + return os.date '%Y' + end), t ' João Freitas' }), + s( + 'gpl3', + t { + '// This program is free software: you can redistribute it and/or modify it under the terms of', + '// the GNU General Public License as published by the Free Software Foundation, either', + '// version 3 of the License, or (at your option) any later version.', + '//', + '// This program is distributed in the hope that it will be useful, but WITHOUT ANY', + '// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR', + '// A PARTICULAR PURPOSE. See the GNU General Public License for more details.', + '//', + '// You should have received a copy of the GNU General Public License along with this', + '// program. If not, see .', + } + ), } diff --git a/nvim/.config/nvim/luasnippets/markdown.lua b/nvim/.config/nvim/luasnippets/markdown.lua index 8993c31..7ca86da 100644 --- a/nvim/.config/nvim/luasnippets/markdown.lua +++ b/nvim/.config/nvim/luasnippets/markdown.lua @@ -1,9 +1,13 @@ -local function snippet_datetime(d) return os.date("%Y-%m-%dT%H:%M:%SZ", d) end +local function snippet_datetime(d) + return os.date('%Y-%m-%dT%H:%M:%SZ', d) +end -local function snippet_date(d) return os.date("%Y-%m-%d", d) end +local function snippet_date(d) + return os.date('%Y-%m-%d', d) +end local function end_of_day(t) - d = os.date("*t", t) + d = os.date('*t', t) d.hour = 23 d.min = 59 d.sec = 59 @@ -12,87 +16,108 @@ local function end_of_day(t) end local function run(command) - local handle = io.popen( - 'brian task id /home/joaj/sources/wiki/journal/2024.md') - local output = handle:read('*a') + local handle = io.popen 'brian task id $JOURNAL' + local output = handle:read '*a' local result = output:gsub('[\n\r]', '') handle:close() return tostring(result) end return { - s("date", {f(function() return snippet_date(os.time()) end)}), - s("t0", {f(function() return snippet_datetime(os.time()) end)}), s("t1", { - f(function() - return snippet_datetime(os.time() + 1 * 24 * 60 * 60) - end) - }), s("t2", { - f(function() - return snippet_datetime(os.time() + 2 * 24 * 60 * 60) - end) - }), s("t3", { - f(function() - return snippet_datetime(os.time() + 3 * 24 * 60 * 60) - end) - }), s("t4", { - f(function() - return snippet_datetime(os.time() + 4 * 24 * 60 * 60) - end) - }), s("t5", { - f(function() - return snippet_datetime(os.time() + 5 * 24 * 60 * 60) - end) - }), s("t6", { - f(function() - return snippet_datetime(os.time() + 6 * 24 * 60 * 60) - end) - }), s("t7", { - f(function() - return snippet_datetime(os.time() + 7 * 24 * 60 * 60) - end) - }), s("t15", { - f(function() - return snippet_datetime(os.time() + 15 * 24 * 60 * 60) - end) - }), s("t30", { + s('date', { f(function() + return snippet_date(os.time()) + end) }), + s('t0', { f(function() + return snippet_datetime(os.time()) + end) }), + s('t1', { f(function() + return snippet_datetime(os.time() + 1 * 24 * 60 * 60) + end) }), + s('t2', { f(function() + return snippet_datetime(os.time() + 2 * 24 * 60 * 60) + end) }), + s('t3', { f(function() + return snippet_datetime(os.time() + 3 * 24 * 60 * 60) + end) }), + s('t4', { f(function() + return snippet_datetime(os.time() + 4 * 24 * 60 * 60) + end) }), + s('t5', { f(function() + return snippet_datetime(os.time() + 5 * 24 * 60 * 60) + end) }), + s('t6', { f(function() + return snippet_datetime(os.time() + 6 * 24 * 60 * 60) + end) }), + s('t7', { f(function() + return snippet_datetime(os.time() + 7 * 24 * 60 * 60) + end) }), + s('t15', { f(function() + return snippet_datetime(os.time() + 15 * 24 * 60 * 60) + end) }), + s('t30', { f(function() + return snippet_datetime(os.time() + 30 * 24 * 60 * 60) + end) }), + s('t60', { f(function() + return snippet_datetime(os.time() + 60 * 24 * 60 * 60) + end) }), + s('te0', { f(function() + return end_of_day(os.time()) + end) }), + s('te1', { f(function() + return end_of_day(os.time() + 1 * 24 * 60 * 60) + end) }), + s('te2', { f(function() + return end_of_day(os.time() + 2 * 24 * 60 * 60) + end) }), + s('te3', { f(function() + return end_of_day(os.time() + 3 * 24 * 60 * 60) + end) }), + s('te4', { f(function() + return end_of_day(os.time() + 4 * 24 * 60 * 60) + end) }), + s('te5', { f(function() + return end_of_day(os.time() + 5 * 24 * 60 * 60) + end) }), + s('te6', { f(function() + return end_of_day(os.time() + 6 * 24 * 60 * 60) + end) }), + s('te7', { f(function() + return end_of_day(os.time() + 7 * 24 * 60 * 60) + end) }), + s('te15', { f(function() + return end_of_day(os.time() + 15 * 24 * 60 * 60) + end) }), + s('te30', { f(function() + return end_of_day(os.time() + 30 * 24 * 60 * 60) + end) }), + s('te60', { f(function() + return end_of_day(os.time() + 60 * 24 * 60 * 60) + end) }), + s('task-add', { + t '(task-add ', f(function() - return snippet_datetime(os.time() + 30 * 24 * 60 * 60) - end) - }), s("t60", { + return run 'brian task task-id /home/joaj/sources/wiki/journal/2024.md' + end), + t ' d#', f(function() - return snippet_datetime(os.time() + 60 * 24 * 60 * 60) - end) - }), s("te0", {f(function() return end_of_day(os.time()) end)}), - s("te1", {f(function() return end_of_day(os.time() + 1 * 24 * 60 * 60) end)}), - s("te2", {f(function() return end_of_day(os.time() + 2 * 24 * 60 * 60) end)}), - s("te3", {f(function() return end_of_day(os.time() + 3 * 24 * 60 * 60) end)}), - s("te4", {f(function() return end_of_day(os.time() + 4 * 24 * 60 * 60) end)}), - s("te5", {f(function() return end_of_day(os.time() + 5 * 24 * 60 * 60) end)}), - s("te6", {f(function() return end_of_day(os.time() + 6 * 24 * 60 * 60) end)}), - s("te7", {f(function() return end_of_day(os.time() + 7 * 24 * 60 * 60) end)}), - s("te15", - {f(function() return end_of_day(os.time() + 15 * 24 * 60 * 60) end)}), - s("te30", - {f(function() return end_of_day(os.time() + 30 * 24 * 60 * 60) end)}), - s("te60", - {f(function() return end_of_day(os.time() + 60 * 24 * 60 * 60) end)}), - s("task-add", { - t("(task-add "), f(function() - return run( - "brian task task-id /home/joaj/sources/wiki/journal/2024.md") - end), t(" d#"), f(function() return snippet_datetime(os.time()) end), - t(" \""), i(1), t("\" :due d#"), i(2), t(")") - }), s("task-done", { - t("(task-done "), i(1), t(" d#"), - f(function() return snippet_datetime(os.time()) end), t(")") - }), s("task-drop", { - t("(task-done "), i(1), t(" d#"), - f(function() return snippet_datetime(os.time()) end), t(")") - }), s("time-start", { - t("(time-start "), t(" d#"), - f(function() return snippet_datetime(os.time()) end), t(" )") - }), s("time-stop", { - t("(time-stop "), t(" d#"), - f(function() return snippet_datetime(os.time()) end), t(" )") - }) + return snippet_datetime(os.time()) + end), + t ' "', + i(1), + t '" :due d#', + i(2), + t ')', + }), + s('task-done', { t '(task-done ', i(1), t ' d#', f(function() + return snippet_datetime(os.time()) + end), t ')' }), + s('task-drop', { t '(task-done ', i(1), t ' d#', f(function() + return snippet_datetime(os.time()) + end), t ')' }), + s('time-start', { t '(time-start ', t ' d#', f(function() + return snippet_datetime(os.time()) + end), t ' )' }), + s('time-stop', { t '(time-stop ', t ' d#', f(function() + return snippet_datetime(os.time()) + end), t ' )' }), } diff --git a/nvim/.config/nvim/queries/fcp/highlights.scm b/nvim/.config/nvim/queries/fcp/highlights.scm deleted file mode 100644 index c39eab5..0000000 --- a/nvim/.config/nvim/queries/fcp/highlights.scm +++ /dev/null @@ -1,23 +0,0 @@ -"struct" @keyword -"enum" @keyword -"impl" @keyword -"for" @keyword -"service" @keyword -"rpc" @keyword -"returns" @keyword -"version" @keyword -"mod" @keyword -((identifier) @variable - (#set! priority 5)) -(number) @number -(type) @type -(string) @string -(struct_name) @type -(enum_name) @type -(rpc_name) @function -(rpc_input_type) @type -(rpc_output_type) @type -(struct_field_name) @property -(enum_field_name) @constant -(param_name) @function -(comment) @comment