From 6c762c436a7335c943ce50fe231862c90a60ac48 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Sun, 8 Feb 2026 15:08:04 -0500 Subject: [PATCH] fix: endx typo in lsp-servers.lua --- .github/workflows/luacheck.yaml | 24 ++++++------------------ .github/workflows/stylua.yaml | 20 +++++++++----------- ftplugin/c.lua | 20 +++++++++++++++----- ftplugin/cpp.lua | 22 +++++++++++++++++----- ftplugin/python.lua | 6 +++++- ftplugin/rust.lua | 15 +++++++++++++-- lua/config/lazy.lua | 2 +- lua/custom/plugins/copilot-chat.lua | 18 +++++++++--------- lua/custom/plugins/diffview.lua | 1 - lua/custom/plugins/images.lua | 1 - lua/custom/plugins/jupytext.lua | 5 ++++- lua/custom/plugins/lsp-servers.lua | 2 +- lua/custom/plugins/marks.lua | 5 ++--- lua/custom/plugins/monokai.lua | 5 +---- lua/custom/plugins/neogen.lua | 1 - lua/custom/plugins/wezterm.lua | 4 ++-- lua/custom/plugins/which-key.lua | 2 +- lua/custom/snippets/lua.lua | 12 ++++++------ lua/custom/user/ipython_utils.lua | 4 +++- 19 files changed, 95 insertions(+), 74 deletions(-) diff --git a/.github/workflows/luacheck.yaml b/.github/workflows/luacheck.yaml index 3e88073..eebf0d5 100644 --- a/.github/workflows/luacheck.yaml +++ b/.github/workflows/luacheck.yaml @@ -11,22 +11,10 @@ on: jobs: luacheck: runs-on: self-hosted + container: + image: alpine:latest steps: - - name: Checkout - run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git . - - name: Install Luacheck - run: | - if ! command -v luacheck &> /dev/null; then - if command -v luarocks &> /dev/null; then - luarocks install luacheck - else - curl -L -o luacheck.tar.gz "https://github.com/lunarmodules/luacheck/archive/refs/tags/v1.1.2.tar.gz" - tar -xzf luacheck.tar.gz - cd luacheck-* - make install - cd .. - rm -rf luacheck-* - fi - fi - - name: Run Luacheck - run: luacheck . + - uses: actions/checkout@v4 + - run: apk add --no-cache lua5.1 luarocks5.1 git + - run: luarocks-5.1 install luacheck + - run: luacheck . diff --git a/.github/workflows/stylua.yaml b/.github/workflows/stylua.yaml index 9f6a3fe..1cfce1b 100644 --- a/.github/workflows/stylua.yaml +++ b/.github/workflows/stylua.yaml @@ -11,15 +11,13 @@ on: jobs: stylua: runs-on: self-hosted + container: + image: alpine:latest steps: - - name: Checkout - run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git . - - name: Install StyLua - run: | - if ! command -v stylua &> /dev/null; then - curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-$(uname -s)-$(uname -m).zip" - unzip stylua.zip -d /usr/local/bin - rm stylua.zip - fi - - name: Check Formatting - run: stylua --check . + - uses: actions/checkout@v4 + - run: apk add --no-cache curl unzip git + - run: | + curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux.zip" + unzip stylua.zip + chmod +x stylua + - run: ./stylua --check . diff --git a/ftplugin/c.lua b/ftplugin/c.lua index 995f5b7..7f4eeb9 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -29,8 +29,9 @@ local function cmake_configure(build_dir, extra_args) local args = extra_args or '' local bin_dir = vim.fn.getcwd() .. '/bin' vim.fn.mkdir(bin_dir, 'p') - local out_args = - ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + local out_args = ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + .. vim.fn.shellescape(bin_dir) + .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) @@ -165,9 +166,19 @@ vim.keymap.set('n', 'ct', function() cmake_ctest(build_dir) end, vim.tbl_extend('force', opts, { desc = 'CMake: Test' })) -vim.keymap.set('n', 'ch', switch_source_header, vim.tbl_extend('force', opts, { desc = 'C: Switch header/source' })) +vim.keymap.set( + 'n', + 'ch', + switch_source_header, + vim.tbl_extend('force', opts, { desc = 'C: Switch header/source' }) +) -vim.keymap.set('n', 'cg', toggle_debugger_repl, vim.tbl_extend('force', opts, { desc = 'C: Toggle debugger REPL' })) +vim.keymap.set( + 'n', + 'cg', + toggle_debugger_repl, + vim.tbl_extend('force', opts, { desc = 'C: Toggle debugger REPL' }) +) vim.keymap.set('n', 'cm', function() local cmd = vim.fn.input('Memory profile run: ', './bin/') @@ -193,4 +204,3 @@ vim.keymap.set('n', 'Ri', function() dbg:send('\x03') end end, vim.tbl_extend('force', opts, { desc = 'Run/REPL: Interrupt' })) - diff --git a/ftplugin/cpp.lua b/ftplugin/cpp.lua index 4e97f87..9981018 100644 --- a/ftplugin/cpp.lua +++ b/ftplugin/cpp.lua @@ -31,8 +31,9 @@ local function cmake_configure(build_dir, extra_args) local args = extra_args or '' local bin_dir = vim.fn.getcwd() .. '/bin' vim.fn.mkdir(bin_dir, 'p') - local out_args = - ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + local out_args = ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + .. vim.fn.shellescape(bin_dir) + .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) @@ -219,9 +220,19 @@ vim.keymap.set('n', 'cr', function() vim.cmd('!' .. cmd) end, vim.tbl_extend('force', opts, { desc = 'CMake: Run (prompt)' })) -vim.keymap.set('n', 'ch', switch_source_header, vim.tbl_extend('force', opts, { desc = 'C++: Switch header/source' })) +vim.keymap.set( + 'n', + 'ch', + switch_source_header, + vim.tbl_extend('force', opts, { desc = 'C++: Switch header/source' }) +) -vim.keymap.set('n', 'cg', toggle_debugger_repl, vim.tbl_extend('force', opts, { desc = 'C++: Toggle debugger REPL' })) +vim.keymap.set( + 'n', + 'cg', + toggle_debugger_repl, + vim.tbl_extend('force', opts, { desc = 'C++: Toggle debugger REPL' }) +) vim.keymap.set('n', 'cm', function() local cmd = vim.fn.input('Memory profile run: ', './bin/') @@ -250,7 +261,8 @@ end, vim.tbl_extend('force', opts, { desc = 'Run/REPL: Interrupt' })) vim.keymap.set('n', 'ca', function() local build_dir = cmake_build_dir('build-asan') - local flags = "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-fsanitize=address -fno-omit-frame-pointer' -DCMAKE_CXX_FLAGS='-fsanitize=address -fno-omit-frame-pointer'" + local flags = + "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-fsanitize=address -fno-omit-frame-pointer' -DCMAKE_CXX_FLAGS='-fsanitize=address -fno-omit-frame-pointer'" cmake_configure(build_dir, flags) cmake_build(build_dir) end, vim.tbl_extend('force', opts, { desc = 'CMake: Build (ASan)' })) diff --git a/ftplugin/python.lua b/ftplugin/python.lua index ca6b810..6d69dba 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -97,7 +97,11 @@ vim.keymap.set('n', 'Rr', function() local screen_width_percentage = 25 local function find_terminal_buffer() for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - if vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buftype == 'terminal' and vim.b[bufnr].python_repl == true then + if + vim.api.nvim_buf_is_loaded(bufnr) + and vim.bo[bufnr].buftype == 'terminal' + and vim.b[bufnr].python_repl == true + then return bufnr end end diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua index 1ef2425..1884464 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -9,7 +9,12 @@ vim.opt_local.textwidth = 80 -- Maximum text width vim.opt_local.colorcolumn = '80' -- Highlight column 80 vim.keymap.set('n', 'Rf', 'Cargo run', { desc = 'Run/REPL: Run (Cargo)', noremap = true, buffer = 0 }) -vim.keymap.set('n', 'Rb', 'Cargo check', { desc = 'Run/REPL: Build/Check (Cargo)', noremap = true, buffer = 0 }) +vim.keymap.set( + 'n', + 'Rb', + 'Cargo check', + { desc = 'Run/REPL: Build/Check (Cargo)', noremap = true, buffer = 0 } +) local dap = require('dap') local rust_tools = require('rust-tools') @@ -40,7 +45,13 @@ if codelldb_adapter and codelldb_lib then }, server = { on_attach = function(_, bufnr) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dR', 'RustDebuggables', { noremap = true, silent = true }) + vim.api.nvim_buf_set_keymap( + bufnr, + 'n', + 'dR', + 'RustDebuggables', + { noremap = true, silent = true } + ) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'RustHoverActions', { noremap = true, silent = true }) end, }, diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 2f59f1d..3f6806d 100755 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -20,7 +20,7 @@ local opts = { change_detection = { notify = false, }, - rocks = { enabled=false }, + rocks = { enabled = false }, } require('lazy').setup({ diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua index 3e8ba25..3a7459e 100644 --- a/lua/custom/plugins/copilot-chat.lua +++ b/lua/custom/plugins/copilot-chat.lua @@ -13,15 +13,15 @@ return { 'CopilotChatToggle', }, keys = { - { 'C', 'CopilotChat', desc = 'Open CopilotChat' }, - { 'Cq', 'CopilotChatClose', desc = 'Close CopilotChat' }, - { 'Ce', 'CopilotChatExplain', desc = 'Explain code', mode = { 'n', 'v' } }, - { 'Cr', 'CopilotChatReview', desc = 'Review code', mode = { 'n', 'v' } }, - { 'Ct', 'CopilotChatTests', desc = 'Generate tests', mode = { 'n', 'v' } }, - { 'Cf', 'CopilotChatRefactor', desc = 'Refactor code', mode = { 'n', 'v' } }, - { 'Co', 'CopilotChatOptimize', desc = 'Optimize code', mode = { 'n', 'v' } }, - { 'Cd', 'CopilotChatDocs', desc = 'Generate docs', mode = { 'n', 'v' } }, - { 'Cp', 'CopilotChatToggle', desc = 'Toggle CopilotChat' }, + { 'C', 'CopilotChat', desc = 'Open CopilotChat' }, + { 'Cq', 'CopilotChatClose', desc = 'Close CopilotChat' }, + { 'Ce', 'CopilotChatExplain', desc = 'Explain code', mode = { 'n', 'v' } }, + { 'Cr', 'CopilotChatReview', desc = 'Review code', mode = { 'n', 'v' } }, + { 'Ct', 'CopilotChatTests', desc = 'Generate tests', mode = { 'n', 'v' } }, + { 'Cf', 'CopilotChatRefactor', desc = 'Refactor code', mode = { 'n', 'v' } }, + { 'Co', 'CopilotChatOptimize', desc = 'Optimize code', mode = { 'n', 'v' } }, + { 'Cd', 'CopilotChatDocs', desc = 'Generate docs', mode = { 'n', 'v' } }, + { 'Cp', 'CopilotChatToggle', desc = 'Toggle CopilotChat' }, }, build = 'make tiktoken', opts = { diff --git a/lua/custom/plugins/diffview.lua b/lua/custom/plugins/diffview.lua index ecc2b1b..3d69f39 100755 --- a/lua/custom/plugins/diffview.lua +++ b/lua/custom/plugins/diffview.lua @@ -3,4 +3,3 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, opts = {}, } - diff --git a/lua/custom/plugins/images.lua b/lua/custom/plugins/images.lua index e995654..5bbc166 100644 --- a/lua/custom/plugins/images.lua +++ b/lua/custom/plugins/images.lua @@ -101,4 +101,3 @@ return { -- }, -- } - diff --git a/lua/custom/plugins/jupytext.lua b/lua/custom/plugins/jupytext.lua index 1ef74ba..71de7ac 100644 --- a/lua/custom/plugins/jupytext.lua +++ b/lua/custom/plugins/jupytext.lua @@ -20,7 +20,10 @@ return { vim.g.jupytext_command = python3_bin .. ' -m jupytext' else vim.schedule(function() - vim.notify('Jupytext: no `jupytext` or `python3` found in PATH. Install jupytext (e.g. `/opt/homebrew/bin/python3 -m pip install --user jupytext`) or set `vim.g.jupytext_command`.', vim.log.levels.WARN) + vim.notify( + 'Jupytext: no `jupytext` or `python3` found in PATH. Install jupytext (e.g. `/opt/homebrew/bin/python3 -m pip install --user jupytext`) or set `vim.g.jupytext_command`.', + vim.log.levels.WARN + ) end) end end diff --git a/lua/custom/plugins/lsp-servers.lua b/lua/custom/plugins/lsp-servers.lua index 083779b..ca63231 100644 --- a/lua/custom/plugins/lsp-servers.lua +++ b/lua/custom/plugins/lsp-servers.lua @@ -16,7 +16,7 @@ local function mason_bin(name) return p end return name -endx +end ---Find Julia binary ---@return string diff --git a/lua/custom/plugins/marks.lua b/lua/custom/plugins/marks.lua index aa2f20f..8376078 100755 --- a/lua/custom/plugins/marks.lua +++ b/lua/custom/plugins/marks.lua @@ -1,8 +1,7 @@ return { 'chentoast/marks.nvim', opts = { - default_mappings = true, - default_view = 'vertical', + default_mappings = true, + default_view = 'vertical', }, } - diff --git a/lua/custom/plugins/monokai.lua b/lua/custom/plugins/monokai.lua index b34be69..e8c7ae4 100755 --- a/lua/custom/plugins/monokai.lua +++ b/lua/custom/plugins/monokai.lua @@ -1,8 +1,5 @@ return { 'tanvirtin/monokai.nvim', priority = 1000, - config = function() - - end, + config = function() end, } - diff --git a/lua/custom/plugins/neogen.lua b/lua/custom/plugins/neogen.lua index c72bdb4..da9e4f5 100755 --- a/lua/custom/plugins/neogen.lua +++ b/lua/custom/plugins/neogen.lua @@ -33,4 +33,3 @@ return { -- Uncomment next line if you want to follow only stable versions -- version = "*" } - diff --git a/lua/custom/plugins/wezterm.lua b/lua/custom/plugins/wezterm.lua index fffab95..66671b4 100644 --- a/lua/custom/plugins/wezterm.lua +++ b/lua/custom/plugins/wezterm.lua @@ -1,6 +1,6 @@ return { 'willothy/wezterm.nvim', opts = { - create_commands = false - } + create_commands = false, + }, } diff --git a/lua/custom/plugins/which-key.lua b/lua/custom/plugins/which-key.lua index 2f1b000..53ff70d 100755 --- a/lua/custom/plugins/which-key.lua +++ b/lua/custom/plugins/which-key.lua @@ -40,7 +40,7 @@ return { { 'a', group = 'Harpoon', mode = { 'n', 'x' } }, { 'b', group = '[B]uffer' }, { 'c', group = '[C]ode/C++', mode = { 'n', 'x' } }, - { 'C', group = '[C]opilot', mode = {'n', 'x'} }, + { 'C', group = '[C]opilot', mode = { 'n', 'x' } }, { 'd', group = '[D]ebug' }, { 'e', group = '[E]xplorer' }, { 'f', group = '[F]iles' }, diff --git a/lua/custom/snippets/lua.lua b/lua/custom/snippets/lua.lua index 81d5d1f..c66b041 100644 --- a/lua/custom/snippets/lua.lua +++ b/lua/custom/snippets/lua.lua @@ -1,4 +1,4 @@ -local ls = require 'luasnip' +local ls = require('luasnip') local s = ls.snippet local i = ls.insert_node @@ -6,15 +6,15 @@ local t = ls.text_node ls.add_snippets('lua', { s('lr', { - t 'local ', + t('local '), i(1, 'module'), - t ' = require("', + t(' = require("'), i(2, 'module'), - t '")', + t('")'), }), s('pr', { - t 'print(', + t('print('), i(1, 'text'), - t ')', + t(')'), }), }) diff --git a/lua/custom/user/ipython_utils.lua b/lua/custom/user/ipython_utils.lua index 97b8347..18a44e0 100644 --- a/lua/custom/user/ipython_utils.lua +++ b/lua/custom/user/ipython_utils.lua @@ -3,7 +3,9 @@ local M = {} -- Function to check if an IPython REPL is open in Neovim panes function M.is_ipython_open() for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - if vim.api.nvim_buf_is_loaded(bufnr) and vim.api.nvim_get_option_value('buftype', { buf = bufnr }) == 'terminal' then + if + vim.api.nvim_buf_is_loaded(bufnr) and vim.api.nvim_get_option_value('buftype', { buf = bufnr }) == 'terminal' + then if vim.b[bufnr].python_repl == true then return true end