From f8836d1f495658d0594fd2de1ca9aae6a6af631c Mon Sep 17 00:00:00 2001 From: FaultyBranches Date: Mon, 18 May 2026 05:26:29 -0500 Subject: [PATCH] feat: changing some naming conventions, adding in the arduino_language_server setup and adding the fugitive plugin for git actions. --- nvim/after/lsp/arduino_language_server.lua | 9 +++++++++ nvim/lua/custom_functions.lua | 4 ++++ nvim/lua/keymappings.lua | 11 ++++++----- nvim/lua/plugins.lua | 1 + nvim/lua/plugins/fugitive.lua | 3 +++ nvim/lua/plugins/mason.lua | 1 - 6 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 nvim/after/lsp/arduino_language_server.lua create mode 100644 nvim/lua/plugins/fugitive.lua diff --git a/nvim/after/lsp/arduino_language_server.lua b/nvim/after/lsp/arduino_language_server.lua new file mode 100644 index 0000000..321d14d --- /dev/null +++ b/nvim/after/lsp/arduino_language_server.lua @@ -0,0 +1,9 @@ +return { + cmd = { + "arduino-language-server", + "-clangd", "/usr/lib/llvm/21/bin/clangd", + "-cli", "/usr/bin/arduino-cli", + "-cli-config", "~/.arduino15/arduino-cli.yaml", + "-fqbn", "esp32:esp32:adafruit_qtpy_esp32s3_nopsram" + } +} diff --git a/nvim/lua/custom_functions.lua b/nvim/lua/custom_functions.lua index 09a27bd..f300973 100644 --- a/nvim/lua/custom_functions.lua +++ b/nvim/lua/custom_functions.lua @@ -20,10 +20,14 @@ return { test = { python = 'pytest', rust = 'cargo test', + cpp = 'make test', }, benchmark = { rust = 'cargo bench', }, + upload = { + cpp = 'make upload', + } } vim.api.nvim_command('write') local command = command_table[type][vim.bo.filetype] diff --git a/nvim/lua/keymappings.lua b/nvim/lua/keymappings.lua index fffa382..9159088 100644 --- a/nvim/lua/keymappings.lua +++ b/nvim/lua/keymappings.lua @@ -1,7 +1,7 @@ vim.g.mapleader = ',' -- Expose custom functions for binding -local cf = require('custom_functions') +local custom_functions = require('custom_functions') -- Standard keybinding options local options = { noremap = true } @@ -51,10 +51,11 @@ vim.keymap.set('n', 'w', ':set list!', options) vim.keymap.set('n', '', 'za') -- Keymaps for custom functions -vim.keymap.set('n', 'et', function() cf.execute('test') end) -vim.keymap.set('n', 'er', function() cf.execute('run') end) -vim.keymap.set('n', 'eb', function() cf.execute('build') end) -vim.keymap.set('n', 'em', function() cf.execute('benchmark') end) +vim.keymap.set('n', 'et', function() custom_functions.execute('test') end) +vim.keymap.set('n', 'er', function() custom_functions.execute('run') end) +vim.keymap.set('n', 'eb', function() custom_functions.execute('build') end) +vim.keymap.set('n', 'em', function() custom_functions.execute('benchmark') end) +vim.keymap.set('n', 'eu', function() custom_functions.execute('upload') end) vim.keymap.set('n', 'eo', ':Lexplore', options) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index b43dac1..000ec96 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -36,5 +36,6 @@ require('lazy').setup({ require('plugins.autopairs'), -- Autocomplete symbol pairs when typing (experimental) require('plugins.twilight'), -- Focus mode, dim lines around the current segment of code require('plugins.yaml-companion'), -- Additional YAML and JSON schema helper + require('plugins.fugitive'), -- _The_ Git integration plugin people have been using forever -- require('plugins.schemastore'), -- Loads YAML and JSON schemas for autocompletion }) diff --git a/nvim/lua/plugins/fugitive.lua b/nvim/lua/plugins/fugitive.lua new file mode 100644 index 0000000..72c3c2f --- /dev/null +++ b/nvim/lua/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + 'tpope/vim-fugitive', +} diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 7a28723..5305398 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -6,7 +6,6 @@ return { require('mason-lspconfig').setup { automatic_enable = true, ensure_installed = { - -- Currently having issues with including some of the LSPs, even though they match the names in Mason 'ansiblels', -- Ansible 'arduino_language_server', -- Arduino specific C 'bashls', -- Bash