fix: endx typo in lsp-servers.lua
This commit is contained in:
parent
0af2677f25
commit
6c762c436a
19 changed files with 95 additions and 74 deletions
24
.github/workflows/luacheck.yaml
vendored
24
.github/workflows/luacheck.yaml
vendored
|
|
@ -11,22 +11,10 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
luacheck:
|
luacheck:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
container:
|
||||||
|
image: alpine:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git .
|
- run: apk add --no-cache lua5.1 luarocks5.1 git
|
||||||
- name: Install Luacheck
|
- run: luarocks-5.1 install luacheck
|
||||||
run: |
|
- run: luacheck .
|
||||||
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 .
|
|
||||||
|
|
|
||||||
20
.github/workflows/stylua.yaml
vendored
20
.github/workflows/stylua.yaml
vendored
|
|
@ -11,15 +11,13 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
stylua:
|
stylua:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
container:
|
||||||
|
image: alpine:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git .
|
- run: apk add --no-cache curl unzip git
|
||||||
- name: Install StyLua
|
- run: |
|
||||||
run: |
|
curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux.zip"
|
||||||
if ! command -v stylua &> /dev/null; then
|
unzip stylua.zip
|
||||||
curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-$(uname -s)-$(uname -m).zip"
|
chmod +x stylua
|
||||||
unzip stylua.zip -d /usr/local/bin
|
- run: ./stylua --check .
|
||||||
rm stylua.zip
|
|
||||||
fi
|
|
||||||
- name: Check Formatting
|
|
||||||
run: stylua --check .
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,9 @@ local function cmake_configure(build_dir, extra_args)
|
||||||
local args = extra_args or ''
|
local args = extra_args or ''
|
||||||
local bin_dir = vim.fn.getcwd() .. '/bin'
|
local bin_dir = vim.fn.getcwd() .. '/bin'
|
||||||
vim.fn.mkdir(bin_dir, 'p')
|
vim.fn.mkdir(bin_dir, 'p')
|
||||||
local out_args =
|
local out_args = ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY='
|
||||||
' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY='
|
.. vim.fn.shellescape(bin_dir)
|
||||||
|
.. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY='
|
||||||
.. vim.fn.shellescape(bin_dir)
|
.. vim.fn.shellescape(bin_dir)
|
||||||
.. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY='
|
.. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY='
|
||||||
.. vim.fn.shellescape(bin_dir)
|
.. vim.fn.shellescape(bin_dir)
|
||||||
|
|
@ -165,9 +166,19 @@ vim.keymap.set('n', '<leader>ct', function()
|
||||||
cmake_ctest(build_dir)
|
cmake_ctest(build_dir)
|
||||||
end, vim.tbl_extend('force', opts, { desc = 'CMake: Test' }))
|
end, vim.tbl_extend('force', opts, { desc = 'CMake: Test' }))
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ch', switch_source_header, vim.tbl_extend('force', opts, { desc = 'C: Switch header/source' }))
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>ch',
|
||||||
|
switch_source_header,
|
||||||
|
vim.tbl_extend('force', opts, { desc = 'C: Switch header/source' })
|
||||||
|
)
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cg', toggle_debugger_repl, vim.tbl_extend('force', opts, { desc = 'C: Toggle debugger REPL' }))
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>cg',
|
||||||
|
toggle_debugger_repl,
|
||||||
|
vim.tbl_extend('force', opts, { desc = 'C: Toggle debugger REPL' })
|
||||||
|
)
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cm', function()
|
vim.keymap.set('n', '<leader>cm', function()
|
||||||
local cmd = vim.fn.input('Memory profile run: ', './bin/')
|
local cmd = vim.fn.input('Memory profile run: ', './bin/')
|
||||||
|
|
@ -193,4 +204,3 @@ vim.keymap.set('n', '<leader>Ri', function()
|
||||||
dbg:send('\x03')
|
dbg:send('\x03')
|
||||||
end
|
end
|
||||||
end, vim.tbl_extend('force', opts, { desc = 'Run/REPL: Interrupt' }))
|
end, vim.tbl_extend('force', opts, { desc = 'Run/REPL: Interrupt' }))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,9 @@ local function cmake_configure(build_dir, extra_args)
|
||||||
local args = extra_args or ''
|
local args = extra_args or ''
|
||||||
local bin_dir = vim.fn.getcwd() .. '/bin'
|
local bin_dir = vim.fn.getcwd() .. '/bin'
|
||||||
vim.fn.mkdir(bin_dir, 'p')
|
vim.fn.mkdir(bin_dir, 'p')
|
||||||
local out_args =
|
local out_args = ' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY='
|
||||||
' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' .. vim.fn.shellescape(bin_dir) .. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY='
|
.. vim.fn.shellescape(bin_dir)
|
||||||
|
.. ' -DCMAKE_LIBRARY_OUTPUT_DIRECTORY='
|
||||||
.. vim.fn.shellescape(bin_dir)
|
.. vim.fn.shellescape(bin_dir)
|
||||||
.. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY='
|
.. ' -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY='
|
||||||
.. vim.fn.shellescape(bin_dir)
|
.. vim.fn.shellescape(bin_dir)
|
||||||
|
|
@ -219,9 +220,19 @@ vim.keymap.set('n', '<leader>cr', function()
|
||||||
vim.cmd('!' .. cmd)
|
vim.cmd('!' .. cmd)
|
||||||
end, vim.tbl_extend('force', opts, { desc = 'CMake: Run (prompt)' }))
|
end, vim.tbl_extend('force', opts, { desc = 'CMake: Run (prompt)' }))
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ch', switch_source_header, vim.tbl_extend('force', opts, { desc = 'C++: Switch header/source' }))
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>ch',
|
||||||
|
switch_source_header,
|
||||||
|
vim.tbl_extend('force', opts, { desc = 'C++: Switch header/source' })
|
||||||
|
)
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cg', toggle_debugger_repl, vim.tbl_extend('force', opts, { desc = 'C++: Toggle debugger REPL' }))
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>cg',
|
||||||
|
toggle_debugger_repl,
|
||||||
|
vim.tbl_extend('force', opts, { desc = 'C++: Toggle debugger REPL' })
|
||||||
|
)
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cm', function()
|
vim.keymap.set('n', '<leader>cm', function()
|
||||||
local cmd = vim.fn.input('Memory profile run: ', './bin/')
|
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', '<leader>ca', function()
|
vim.keymap.set('n', '<leader>ca', function()
|
||||||
local build_dir = cmake_build_dir('build-asan')
|
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_configure(build_dir, flags)
|
||||||
cmake_build(build_dir)
|
cmake_build(build_dir)
|
||||||
end, vim.tbl_extend('force', opts, { desc = 'CMake: Build (ASan)' }))
|
end, vim.tbl_extend('force', opts, { desc = 'CMake: Build (ASan)' }))
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,11 @@ vim.keymap.set('n', '<leader>Rr', function()
|
||||||
local screen_width_percentage = 25
|
local screen_width_percentage = 25
|
||||||
local function find_terminal_buffer()
|
local function find_terminal_buffer()
|
||||||
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
|
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
|
return bufnr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,12 @@ vim.opt_local.textwidth = 80 -- Maximum text width
|
||||||
vim.opt_local.colorcolumn = '80' -- Highlight column 80
|
vim.opt_local.colorcolumn = '80' -- Highlight column 80
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>Rf', '<CMD>Cargo run<CR>', { desc = 'Run/REPL: Run (Cargo)', noremap = true, buffer = 0 })
|
vim.keymap.set('n', '<leader>Rf', '<CMD>Cargo run<CR>', { desc = 'Run/REPL: Run (Cargo)', noremap = true, buffer = 0 })
|
||||||
vim.keymap.set('n', '<leader>Rb', '<CMD>Cargo check<CR>', { desc = 'Run/REPL: Build/Check (Cargo)', noremap = true, buffer = 0 })
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>Rb',
|
||||||
|
'<CMD>Cargo check<CR>',
|
||||||
|
{ desc = 'Run/REPL: Build/Check (Cargo)', noremap = true, buffer = 0 }
|
||||||
|
)
|
||||||
|
|
||||||
local dap = require('dap')
|
local dap = require('dap')
|
||||||
local rust_tools = require('rust-tools')
|
local rust_tools = require('rust-tools')
|
||||||
|
|
@ -40,7 +45,13 @@ if codelldb_adapter and codelldb_lib then
|
||||||
},
|
},
|
||||||
server = {
|
server = {
|
||||||
on_attach = function(_, bufnr)
|
on_attach = function(_, bufnr)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>dR', '<cmd>RustDebuggables<CR>', { noremap = true, silent = true })
|
vim.api.nvim_buf_set_keymap(
|
||||||
|
bufnr,
|
||||||
|
'n',
|
||||||
|
'<leader>dR',
|
||||||
|
'<cmd>RustDebuggables<CR>',
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>RustHoverActions<CR>', { noremap = true, silent = true })
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>RustHoverActions<CR>', { noremap = true, silent = true })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ local opts = {
|
||||||
change_detection = {
|
change_detection = {
|
||||||
notify = false,
|
notify = false,
|
||||||
},
|
},
|
||||||
rocks = { enabled=false },
|
rocks = { enabled = false },
|
||||||
}
|
}
|
||||||
|
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,15 @@ return {
|
||||||
'CopilotChatToggle',
|
'CopilotChatToggle',
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>C', '<cmd>CopilotChat<cr>', desc = 'Open CopilotChat' },
|
{ '<leader>C', '<cmd>CopilotChat<cr>', desc = 'Open CopilotChat' },
|
||||||
{ '<leader>Cq', '<cmd>CopilotChatClose<cr>', desc = 'Close CopilotChat' },
|
{ '<leader>Cq', '<cmd>CopilotChatClose<cr>', desc = 'Close CopilotChat' },
|
||||||
{ '<leader>Ce', '<cmd>CopilotChatExplain<cr>', desc = 'Explain code', mode = { 'n', 'v' } },
|
{ '<leader>Ce', '<cmd>CopilotChatExplain<cr>', desc = 'Explain code', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Cr', '<cmd>CopilotChatReview<cr>', desc = 'Review code', mode = { 'n', 'v' } },
|
{ '<leader>Cr', '<cmd>CopilotChatReview<cr>', desc = 'Review code', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Ct', '<cmd>CopilotChatTests<cr>', desc = 'Generate tests', mode = { 'n', 'v' } },
|
{ '<leader>Ct', '<cmd>CopilotChatTests<cr>', desc = 'Generate tests', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Cf', '<cmd>CopilotChatRefactor<cr>', desc = 'Refactor code', mode = { 'n', 'v' } },
|
{ '<leader>Cf', '<cmd>CopilotChatRefactor<cr>', desc = 'Refactor code', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Co', '<cmd>CopilotChatOptimize<cr>', desc = 'Optimize code', mode = { 'n', 'v' } },
|
{ '<leader>Co', '<cmd>CopilotChatOptimize<cr>', desc = 'Optimize code', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Cd', '<cmd>CopilotChatDocs<cr>', desc = 'Generate docs', mode = { 'n', 'v' } },
|
{ '<leader>Cd', '<cmd>CopilotChatDocs<cr>', desc = 'Generate docs', mode = { 'n', 'v' } },
|
||||||
{ '<leader>Cp', '<cmd>CopilotChatToggle<cr>', desc = 'Toggle CopilotChat' },
|
{ '<leader>Cp', '<cmd>CopilotChatToggle<cr>', desc = 'Toggle CopilotChat' },
|
||||||
},
|
},
|
||||||
build = 'make tiktoken',
|
build = 'make tiktoken',
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,3 @@ return {
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,4 +101,3 @@ return {
|
||||||
-- },
|
-- },
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ return {
|
||||||
vim.g.jupytext_command = python3_bin .. ' -m jupytext'
|
vim.g.jupytext_command = python3_bin .. ' -m jupytext'
|
||||||
else
|
else
|
||||||
vim.schedule(function()
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ local function mason_bin(name)
|
||||||
return p
|
return p
|
||||||
end
|
end
|
||||||
return name
|
return name
|
||||||
endx
|
end
|
||||||
|
|
||||||
---Find Julia binary
|
---Find Julia binary
|
||||||
---@return string
|
---@return string
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
return {
|
return {
|
||||||
'chentoast/marks.nvim',
|
'chentoast/marks.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
default_mappings = true,
|
default_mappings = true,
|
||||||
default_view = 'vertical',
|
default_view = 'vertical',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
return {
|
return {
|
||||||
'tanvirtin/monokai.nvim',
|
'tanvirtin/monokai.nvim',
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function() end,
|
||||||
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,3 @@ return {
|
||||||
-- Uncomment next line if you want to follow only stable versions
|
-- Uncomment next line if you want to follow only stable versions
|
||||||
-- version = "*"
|
-- version = "*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
'willothy/wezterm.nvim',
|
'willothy/wezterm.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
create_commands = false
|
create_commands = false,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ return {
|
||||||
{ '<leader>a', group = 'Harpoon', mode = { 'n', 'x' } },
|
{ '<leader>a', group = 'Harpoon', mode = { 'n', 'x' } },
|
||||||
{ '<leader>b', group = '[B]uffer' },
|
{ '<leader>b', group = '[B]uffer' },
|
||||||
{ '<leader>c', group = '[C]ode/C++', mode = { 'n', 'x' } },
|
{ '<leader>c', group = '[C]ode/C++', mode = { 'n', 'x' } },
|
||||||
{ '<leader>C', group = '[C]opilot', mode = {'n', 'x'} },
|
{ '<leader>C', group = '[C]opilot', mode = { 'n', 'x' } },
|
||||||
{ '<leader>d', group = '[D]ebug' },
|
{ '<leader>d', group = '[D]ebug' },
|
||||||
{ '<leader>e', group = '[E]xplorer' },
|
{ '<leader>e', group = '[E]xplorer' },
|
||||||
{ '<leader>f', group = '[F]iles' },
|
{ '<leader>f', group = '[F]iles' },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local ls = require 'luasnip'
|
local ls = require('luasnip')
|
||||||
|
|
||||||
local s = ls.snippet
|
local s = ls.snippet
|
||||||
local i = ls.insert_node
|
local i = ls.insert_node
|
||||||
|
|
@ -6,15 +6,15 @@ local t = ls.text_node
|
||||||
|
|
||||||
ls.add_snippets('lua', {
|
ls.add_snippets('lua', {
|
||||||
s('lr', {
|
s('lr', {
|
||||||
t 'local ',
|
t('local '),
|
||||||
i(1, 'module'),
|
i(1, 'module'),
|
||||||
t ' = require("',
|
t(' = require("'),
|
||||||
i(2, 'module'),
|
i(2, 'module'),
|
||||||
t '")',
|
t('")'),
|
||||||
}),
|
}),
|
||||||
s('pr', {
|
s('pr', {
|
||||||
t 'print(',
|
t('print('),
|
||||||
i(1, 'text'),
|
i(1, 'text'),
|
||||||
t ')',
|
t(')'),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ local M = {}
|
||||||
-- Function to check if an IPython REPL is open in Neovim panes
|
-- Function to check if an IPython REPL is open in Neovim panes
|
||||||
function M.is_ipython_open()
|
function M.is_ipython_open()
|
||||||
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
|
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
|
if vim.b[bufnr].python_repl == true then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue