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 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 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" 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' diff --git a/git/.gitconfig b/git/.gitconfig index b12b647..1a15c7c 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,25 +1,35 @@ [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 + 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 + enabled = true + autoupdated = true [push] - recurseSubmodules = check + 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}.." 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 bc380bd..dfb1547 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,30 +1,63 @@ --- disable netrw at the very start of your init.lua -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' -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", - }, - }, +vim.g.have_nerd_font = true + +vim.wo.number = true +vim.o.mouse = 'a' + +vim.schedule(function() + vim.o.clipboard = 'unnamedplus' +end) + +vim.o.undofile = true +vim.o.ignorecase = true +vim.o.smartcase = 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.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('highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) + +-- 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', +}) + +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.lsp.buf.format() + end, }) -require("telescope").load_extension("fzf") + +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() -vim.o.autochdir = true -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 diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index dcd9941..b1223d1 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,33 +1,61 @@ { - "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": "69199d46b56f67a226789da256264c6291c4e63d" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "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" }, + "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" }, + "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" }, + "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "limelight.vim": { "branch": "master", "commit": "0c8cc7f503a775c505dc9c67f1f5041ab4d5f1fd" }, + "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": "59cd07d8df2fefde32556268b8d52606a32152a1" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "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" }, + "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": "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": "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": "6d12e23e7261342f9dd4a23b9dd3a504454df002" }, + "vim-lumen": { "branch": "master", "commit": "97157aac9f0d24c144a3defdfe5057ee61e18dcb" }, + "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, + "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 c12380d..6372d13 100644 --- a/nvim/.config/nvim/lua/colorscheme.lua +++ b/nvim/.config/nvim/lua/colorscheme.lua @@ -1,27 +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 d7a9596..2829ce5 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -1,42 +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.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 = "" }) - - 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 }) + 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', + }, + } + + 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 6c0e84f..0000000 --- a/nvim/.config/nvim/lua/lsp.lua +++ /dev/null @@ -1,122 +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 5846299..5e7a63f 100644 --- a/nvim/.config/nvim/lua/lvim.lua +++ b/nvim/.config/nvim/lua/lvim.lua @@ -1,183 +1,183 @@ 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/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 e7bb471..64de8dc 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -1,93 +1,347 @@ local M = {} M.setup = function() - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + 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", + print 'Installing lazy.nvim....' + vim.fn.system { + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', lazypath, - }) - print("Done.") + } + print 'Done.' end vim.opt.rtp:prepend(lazypath) - require("lazy").setup({ + require('lazy').setup({ { - "folke/neodev.nvim", + 'NMAC427/guess-indent.nvim', + opts = { + on_tab_options = { + ['expandtab'] = true, + }, + }, + }, + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + { path = '${3rd}/luv/library', word = { 'vim%.uv' } }, + }, + }, + }, + { + 'johnfrankmorgan/whitespace.nvim', config = function() - require("neodev").setup() + require('whitespace-nvim').setup { + highlight = 'DiffDelete', + ignored_filetypes = { 'TelescopePrompt', 'Trouble', 'help', 'dashboard' }, + ignore_terminal = true, + return_cursor = true, + } 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" }, - { "L3MON4D3/LuaSnip" }, - { "morhetz/gruvbox" }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", + { 'tpope/vim-fugitive' }, + { 'tpope/vim-rhubarb' }, + { 'shumphrey/fugitive-gitlab.vim' }, + { + 'NeogitOrg/neogit', + opts = { + graph_style = 'unicode', + }, + dependencies = { + 'nvim-lua/plenary.nvim', + 'sindrets/diffview.nvim', + 'nvim-telescope/telescope.nvim', + }, + 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' }, + { + 'folke/trouble.nvim', + opts = {}, + cmd = 'Trouble', + }, + { + 'zbirenbaum/copilot-cmp', + opts = {}, + }, + { + 'L3MON4D3/LuaSnip', + run = 'make install_jsregexp', + dependencies = { 'rafamadriz/friendly-snippets' }, + }, + --- Follow system wide theme (dark/light) + { 'vimpostor/vim-lumen' }, + --- Gruvbox! --- + { + 'ellisonleao/gruvbox.nvim', + opts = { transparent_mode = not vim.g.neovide }, + }, + { + 'nvim-tree/nvim-tree.lua', 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', }, config = function() - require("neo-tree").setup({ - source_selector = { - statusline = true, + 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, + }, + sort = { + sorter = 'case_sensitive', + }, + view = { + width = 50, }, - }) + renderer = { + group_empty = true, + }, + filters = { + dotfiles = 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", + 'stevearc/oil.nvim', + dependencies = { { 'echasnovski/mini.icons', opts = {} } }, + opts = {}, + lazy = false, }, { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 + '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-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + 'nvim-telescope/telescope-ui-select.nvim', + }, + config = function() + 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', + }, + }, + } + + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') end, }, { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, + 'folke/which-key.nvim', + event = 'VimEnter', + opts = { + delay = 0, + icon = { + mappings = vim.g.have_nerd_font, + }, + }, }, - { "saadparwaiz1/cmp_luasnip" }, - { "pocco81/true-zen.nvim" }, - { "junegunn/limelight.vim" }, + { 'saadparwaiz1/cmp_luasnip' }, + { 'pocco81/true-zen.nvim' }, + { 'junegunn/limelight.vim' }, { - "FabijanZulj/blame.nvim", + 'FabijanZulj/blame.nvim', config = function() - require("blame").setup() + require('blame').setup() end, }, - { "ledger/vim-ledger" }, - { "piero-vic/cmp-ledger" }, + { 'ledger/vim-ledger' }, + { 'piero-vic/cmp-ledger' }, { - "lewis6991/gitsigns.nvim", + 'DrKJeff16/project.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + }, + opts = {}, + }, + { + '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' }, + { + 'epwalsh/obsidian.nvim', + version = '*', + lazy = true, + event = { + 'BufReadPre ' .. vim.fn.expand '~' .. '/Sync/wiki/*.md', + 'BufNewFile ' .. vim.fn.expand '~' .. '/Sync/wiki/*.md', + }, + dependencies = { + 'nvim-lua/plenary.nvim', + }, + opts = { + workspaces = { + { + name = 'wiki', + path = '~/Sync/wiki', + }, + }, + attachments = { + 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() - require("gitsigns").setup() + 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, }, + { + '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', + }, + require 'rustaceanvim.neotest', + }, + discovery = { + enabled = false, + concurrent = 1, + }, + } + end, + }, + { + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + signs = false, + }, + }, + { + "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 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 40ff7ae..4ba8b24 100644 --- a/nvim/.config/nvim/luasnippets/all.lua +++ b/nvim/.config/nvim/luasnippets/all.lua @@ -1,14 +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 b26cc9c..7ca86da 100644 --- a/nvim/.config/nvim/luasnippets/markdown.lua +++ b/nvim/.config/nvim/luasnippets/markdown.lua @@ -1,55 +1,123 @@ -local function snippet_datetime (d) - return os.date("%Y-%m-%dT%H:%M:%SZ", d) +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) +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 $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", { 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 ' )' }), } 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", +} diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index da5ce99..9c9201c 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -1,9 +1,72 @@ local wezterm = require 'wezterm' return { - font = wezterm.font 'FiraCode', - font_size=10, - color_scheme = "GruvboxDark", - use_fancy_tab_bar = false, + 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)} + } }