mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
shrug, i forgor
This commit is contained in:
parent
428c884e0d
commit
a01bb5c0ed
19 changed files with 538 additions and 68 deletions
|
|
@ -56,9 +56,48 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.textwidth = 80
|
||||
vim.opt_local.formatoptions = "atcqjnl"
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
|
||||
-- Show column guide
|
||||
vim.opt_local.colorcolumn = "80"
|
||||
end,
|
||||
})
|
||||
|
||||
-- Typst configuration
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "typst",
|
||||
callback = function()
|
||||
-- Line wrapping settings
|
||||
vim.opt_local.textwidth = 80
|
||||
vim.opt_local.formatoptions = "atcqjnl"
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
|
||||
-- Show column guide
|
||||
vim.opt_local.colorcolumn = "80"
|
||||
end,
|
||||
})
|
||||
-- Setup formatting on LSP attach
|
||||
-- vim.api.nvim_create_autocmd("LspAttach", {
|
||||
-- callback = function(args)
|
||||
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
--
|
||||
-- if client and client.supports_method("textDocument/formatting") then
|
||||
-- vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, {
|
||||
-- buffer = args.buf,
|
||||
-- callback = function()
|
||||
-- vim.lsp.buf.format({
|
||||
-- async = true,
|
||||
-- bufnr = args.buf,
|
||||
-- })
|
||||
-- end,
|
||||
-- })
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
vim.api.nvim_create_autocmd("TermOpen", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
|
|
@ -69,22 +108,22 @@ vim.api.nvim_create_autocmd("TermOpen", {
|
|||
vim.o.clipboard = "unnamedplus"
|
||||
|
||||
vim.g.clipboard = {
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
},
|
||||
paste = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
|
||||
},
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
},
|
||||
paste = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
|
||||
},
|
||||
}
|
||||
-- stupid hacky workaround to make it so i can paste from tmux with OSC52
|
||||
-- https://github.com/neovim/neovim/discussions/29350#discussioncomment-10299517
|
||||
-- tracking issue about tmux behavior: https://github.com/tmux/tmux/issues/4275
|
||||
if vim.env.TMUX ~= nil then
|
||||
local copy = {'tmux', 'load-buffer', '-w', '-'}
|
||||
local paste = {'bash', '-c', 'tmux refresh-client -l && sleep 0.05 && tmux save-buffer -'}
|
||||
local copy = { 'tmux', 'load-buffer', '-w', '-' }
|
||||
local paste = { 'bash', '-c', 'tmux refresh-client -l && sleep 0.05 && tmux save-buffer -' }
|
||||
vim.g.clipboard = {
|
||||
name = 'tmux',
|
||||
copy = {
|
||||
|
|
@ -99,5 +138,14 @@ if vim.env.TMUX ~= nil then
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- https://simondalvai.org/blog/godot-neovim/
|
||||
require("godot")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Enable experimental UI in neovim-nightly
|
||||
require('vim._extui').enable({})
|
||||
|
|
|
|||
66
vim/.config/nvim/lsp/basedpyright.lua
Normal file
66
vim/.config/nvim/lsp/basedpyright.lua
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://detachhead.github.io/basedpyright
|
||||
---
|
||||
--- `basedpyright`, a static type checker and language server for python
|
||||
|
||||
local function set_python_path(command)
|
||||
local path = command.args
|
||||
local clients = vim.lsp.get_clients {
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
name = 'basedpyright',
|
||||
}
|
||||
for _, client in ipairs(clients) do
|
||||
if client.settings then
|
||||
client.settings.python = vim.tbl_deep_extend('force', client.settings.python or {}, { pythonPath = path })
|
||||
else
|
||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
||||
end
|
||||
client:notify('workspace/didChangeConfiguration', { settings = nil })
|
||||
end
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'basedpyright-langserver', '--stdio' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'requirements.txt',
|
||||
'Pipfile',
|
||||
'pyrightconfig.json',
|
||||
'.git',
|
||||
},
|
||||
settings = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
local params = {
|
||||
command = 'basedpyright.organizeimports',
|
||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||
}
|
||||
|
||||
-- Using client.request() directly because "basedpyright.organizeimports" is private
|
||||
-- (not advertised via capabilities), which client:exec_cmd() refuses to call.
|
||||
-- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030
|
||||
client.request('workspace/executeCommand', params, nil, bufnr)
|
||||
end, {
|
||||
desc = 'Organize Imports',
|
||||
})
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||
desc = 'Reconfigure basedpyright with the provided python path',
|
||||
nargs = 1,
|
||||
complete = 'file',
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -4,7 +4,11 @@ return {
|
|||
-- '--clang-tidy',
|
||||
'--background-index',
|
||||
'--offset-encoding=utf-8',
|
||||
'--query-driver=/Users/scie/.platformio/packages/toolchain-xtensa-esp32/**'
|
||||
'--query-driver=/Users/scie/.platformio/packages/toolchain-xtensa-esp32/**',
|
||||
'--query-driver=/Users/scie/.platformio/packages/framework-arduinoststm32/**',
|
||||
-- '--query-driver=/Users/scie/.platformio/packages/**',
|
||||
-- '--query-driver=/opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/bin/avr-gcc',
|
||||
-- '--query-driver=/opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/bin/avr-g++'
|
||||
},
|
||||
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto', 'arduino' },
|
||||
root_markers = {
|
||||
|
|
@ -25,4 +29,3 @@ return {
|
|||
offsetEncoding = { 'utf-8', 'utf-16' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
9
vim/.config/nvim/lsp/csharp-ls.lua
Normal file
9
vim/.config/nvim/lsp/csharp-ls.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'csharp-ls' },
|
||||
root_markers = { ".git" },
|
||||
filetypes = { 'cs' },
|
||||
init_options = {
|
||||
AutomaticWorkspaceInit = true,
|
||||
},
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
---
|
||||
return {
|
||||
cmd = { 'cspell-lsp', '--stdio' },
|
||||
filetypes = {"go", "rust", "js", "ts", "html", "css", "json", "yaml", "markdown", "gitcommit", "typst", "lua", "htmlua"},
|
||||
filetypes = { "go", "rust", "js", "ts", "html", "css", "json", "yaml", "markdown", "gitcommit", "typst", "lua", "htmlua", "c", "cpp", "arduino" },
|
||||
root_markers = {
|
||||
'.git',
|
||||
'cspell.json',
|
||||
|
|
@ -20,4 +20,10 @@ return {
|
|||
'cspell.yaml',
|
||||
'cspell.yml',
|
||||
},
|
||||
init_options = {
|
||||
userWordsFile = vim.fn.expand('~/.config/cspell/user-dictionary.txt'),
|
||||
configPaths = {
|
||||
vim.fn.expand('~/.cspell.json'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
9
vim/.config/nvim/lsp/gdscript.lua
Normal file
9
vim/.config/nvim/lsp/gdscript.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local port = os.getenv 'GDScript_Port' or '6005'
|
||||
local cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(port))
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = cmd,
|
||||
filetypes = { 'gd', 'gdscript', 'gdscript3' },
|
||||
root_markers = { 'project.godot', '.git' },
|
||||
}
|
||||
65
vim/.config/nvim/lsp/pyright.lua
Normal file
65
vim/.config/nvim/lsp/pyright.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/microsoft/pyright
|
||||
---
|
||||
--- `pyright`, a static type checker and language server for python
|
||||
|
||||
local function set_python_path(command)
|
||||
local path = command.args
|
||||
local clients = vim.lsp.get_clients {
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
name = 'pyright',
|
||||
}
|
||||
for _, client in ipairs(clients) do
|
||||
if client.settings then
|
||||
client.settings.python = vim.tbl_deep_extend('force', client.settings.python, { pythonPath = path })
|
||||
else
|
||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
||||
end
|
||||
client:notify('workspace/didChangeConfiguration', { settings = nil })
|
||||
end
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'pyright-langserver', '--stdio' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'requirements.txt',
|
||||
'Pipfile',
|
||||
'pyrightconfig.json',
|
||||
'.git',
|
||||
},
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
local params = {
|
||||
command = 'pyright.organizeimports',
|
||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||
}
|
||||
|
||||
-- Using client.request() directly because "pyright.organizeimports" is private
|
||||
-- (not advertised via capabilities), which client:exec_cmd() refuses to call.
|
||||
-- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030
|
||||
client.request('workspace/executeCommand', params, nil, bufnr)
|
||||
end, {
|
||||
desc = 'Organize Imports',
|
||||
})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||
desc = 'Reconfigure pyright with the provided python path',
|
||||
nargs = 1,
|
||||
complete = 'file',
|
||||
})
|
||||
end,
|
||||
}
|
||||
15
vim/.config/nvim/lsp/rust-analyzer.lua
Normal file
15
vim/.config/nvim/lsp/rust-analyzer.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
filetypes = { "rust", "rs" },
|
||||
root_markers = { "Cargo.lock" },
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
cmd = { 'rust-analyzer' },
|
||||
filetypes = { 'rust', 'rs' },
|
||||
root_markers = {
|
||||
'cargo.toml',
|
||||
'.git'
|
||||
},
|
||||
}
|
||||
|
||||
77
vim/.config/nvim/lsp/tinymist.lua
Normal file
77
vim/.config/nvim/lsp/tinymist.lua
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/Myriad-Dreamin/tinymist
|
||||
--- An integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese.
|
||||
---
|
||||
--- Currently some of Tinymist's workspace commands are supported, namely:
|
||||
--- `LspTinymistExportSvg`, `LspTinymistExportPng`, `LspTinymistExportPdf
|
||||
--- `LspTinymistExportMarkdown`, `LspTinymistExportText`, `LspTinymistExportQuery`,
|
||||
--- `LspTinymistExportAnsiHighlight`, `LspTinymistGetServerInfo`,
|
||||
--- `LspTinymistGetDocumentTrace`, `LspTinymistGetWorkspaceLabels`, and
|
||||
--- `LspTinymistGetDocumentMetrics`.
|
||||
|
||||
---@param command_name string
|
||||
---@param client vim.lsp.Client
|
||||
---@param bufnr integer
|
||||
---@return fun():nil run_tinymist_command, string cmd_name, string cmd_desc
|
||||
local function create_tinymist_command(command_name, client, bufnr)
|
||||
local export_type = command_name:match 'tinymist%.export(%w+)'
|
||||
local info_type = command_name:match 'tinymist%.(%w+)'
|
||||
if info_type and info_type:match '^get' then
|
||||
info_type = info_type:gsub('^get', 'Get')
|
||||
end
|
||||
local cmd_display = export_type or info_type
|
||||
---@return nil
|
||||
local function run_tinymist_command()
|
||||
local arguments = { vim.api.nvim_buf_get_name(bufnr) }
|
||||
local title_str = export_type and ('Export ' .. cmd_display) or cmd_display
|
||||
---@type lsp.Handler
|
||||
local function handler(err, res)
|
||||
if err then
|
||||
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
||||
end
|
||||
-- If exporting, show the string result; else, show the table for inspection
|
||||
vim.notify(export_type and res or vim.inspect(res), vim.log.levels.INFO)
|
||||
end
|
||||
return client:exec_cmd({
|
||||
title = title_str,
|
||||
command = command_name,
|
||||
arguments = arguments,
|
||||
}, { bufnr = bufnr }, handler)
|
||||
end
|
||||
-- Construct a readable command name/desc
|
||||
local cmd_name = export_type and ('TinymistExport' .. cmd_display) or ('Tinymist' .. cmd_display) ---@type string
|
||||
local cmd_desc = export_type and ('Export to ' .. cmd_display) or ('Get ' .. cmd_display) ---@type string
|
||||
return run_tinymist_command, cmd_name, cmd_desc
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'tinymist' },
|
||||
filetypes = { 'typst' },
|
||||
root_markers = { '.git' },
|
||||
on_attach = function(client, bufnr)
|
||||
for _, command in ipairs {
|
||||
'tinymist.exportSvg',
|
||||
'tinymist.exportPng',
|
||||
'tinymist.exportPdf',
|
||||
-- 'tinymist.exportHtml', -- Use typst 0.13
|
||||
'tinymist.exportMarkdown',
|
||||
'tinymist.exportText',
|
||||
'tinymist.exportQuery',
|
||||
'tinymist.exportAnsiHighlight',
|
||||
'tinymist.getServerInfo',
|
||||
'tinymist.getDocumentTrace',
|
||||
'tinymist.getWorkspaceLabels',
|
||||
'tinymist.getDocumentMetrics',
|
||||
} do
|
||||
local cmd_func, cmd_name, cmd_desc = create_tinymist_command(command, client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Lsp' .. cmd_name, cmd_func, { nargs = 0, desc = cmd_desc })
|
||||
end
|
||||
end,
|
||||
settings = {
|
||||
["tinymist"] = {
|
||||
formatterMode = "typstyle"
|
||||
}
|
||||
}
|
||||
}
|
||||
12
vim/.config/nvim/lsp/zigscient.lua
Normal file
12
vim/.config/nvim/lsp/zigscient.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---@brief
|
||||
--- https://github.com/zigtools/zls
|
||||
---
|
||||
--- Zig LSP implementation + Zig Language Server
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'zigscient' },
|
||||
filetypes = { 'zig', 'zir' },
|
||||
root_markers = { 'zls.json', 'build.zig', '.git' },
|
||||
workspace_required = false,
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
---@brief
|
||||
--- https://github.com/zigtools/zls
|
||||
---
|
||||
--- Zig LSP implementation + Zig Language Server
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'zls' },
|
||||
filetypes = { 'zig' },
|
||||
root_markers = {
|
||||
'zls.json',
|
||||
'build.zig',
|
||||
'.git'
|
||||
},
|
||||
filetypes = { 'zig', 'zir' },
|
||||
root_markers = { 'zls.json', 'build.zig', '.git' },
|
||||
workspace_required = false,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
vim.diagnostic.config({ virtual_text = true })
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
})
|
||||
|
||||
|
|
|
|||
60
vim/.config/nvim/lua/godot.lua
Normal file
60
vim/.config/nvim/lua/godot.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
local function connect_to_godot_server()
|
||||
-- Check if project.godot exists in current directory
|
||||
local project_file = vim.fn.getcwd() .. "/project.godot"
|
||||
if vim.fn.filereadable(project_file) == 1 then
|
||||
local pipe_path = vim.fn.getcwd() .. "/nvim_server.pipe"
|
||||
|
||||
-- Create the pipe if it doesn't exist, then connect
|
||||
local success = vim.fn.serverstart(pipe_path)
|
||||
if success then
|
||||
print("Connected to Godot server via " .. pipe_path)
|
||||
else
|
||||
print("Failed to create/connect to Godot server pipe: " .. pipe_path)
|
||||
end
|
||||
|
||||
local dap = require("dap")
|
||||
|
||||
dap.adapters.godot = {
|
||||
type = 'server',
|
||||
host = '127.0.0.1',
|
||||
port = 6006,
|
||||
}
|
||||
|
||||
dap.configurations.gdscript = {
|
||||
{
|
||||
type = 'godot',
|
||||
request = 'launch',
|
||||
name = 'Launch scene',
|
||||
project = '${workspaceFolder}',
|
||||
launch_scene = true,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.cs = {
|
||||
{
|
||||
type = 'godot',
|
||||
request = 'launch',
|
||||
name = 'Launch scene',
|
||||
project = '${workspaceFolder}',
|
||||
launch_scene = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- Auto-connect when Neovim starts
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = connect_to_godot_server,
|
||||
desc = "Auto-connect to Godot server if project.godot exists"
|
||||
})
|
||||
|
||||
-- Optional: Also check when changing directories
|
||||
vim.api.nvim_create_autocmd("DirChanged", {
|
||||
callback = connect_to_godot_server,
|
||||
desc = "Auto-connect to Godot server when changing to Godot project directory"
|
||||
})
|
||||
|
||||
-- Optional: Command to manually connect
|
||||
vim.api.nvim_create_user_command("GodotConnect", connect_to_godot_server, {
|
||||
desc = "Manually connect to Godot server"
|
||||
})
|
||||
|
|
@ -15,6 +15,7 @@ vim.lsp.config('pyright', {
|
|||
})
|
||||
|
||||
vim.lsp.enable("pyright")
|
||||
-- vim.lsp.enable("basedpyright")
|
||||
|
||||
vim.lsp.config('ty', {
|
||||
on_attach = function()
|
||||
|
|
@ -49,6 +50,7 @@ vim.lsp.config('zls', {
|
|||
})
|
||||
|
||||
vim.lsp.enable("zls")
|
||||
-- vim.lsp.enable("zigscient")
|
||||
|
||||
vim.lsp.enable("gopls")
|
||||
|
||||
|
|
@ -58,8 +60,40 @@ vim.lsp.enable("cspell-ls")
|
|||
|
||||
vim.lsp.enable("astro")
|
||||
|
||||
vim.lsp.config('rust_analyzer', {
|
||||
on_attach = function()
|
||||
print('rust-analyzer is now active in this file')
|
||||
end,
|
||||
})
|
||||
|
||||
vim.lsp.enable("rust-analyzer")
|
||||
vim.lsp.enable("gdscript")
|
||||
vim.lsp.config('csharp-ls', {
|
||||
on_attach = function()
|
||||
print('csharp-ls is now active in this file')
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
vim.lsp.enable("csharp-ls")
|
||||
|
||||
-- https://lsp-zero.netlify.app/blog/lsp-client-features.html
|
||||
|
||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect', 'noinsert'}
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' }
|
||||
vim.opt.shortmess:append('c')
|
||||
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
|
||||
callback = function(args)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
if vim.bo[args.buf].filetype == "typst" or vim.bo[args.buf].filetype == "c" then
|
||||
return
|
||||
end
|
||||
vim.lsp.buf.format({ async = false, id = args.data.client_id })
|
||||
end,
|
||||
})
|
||||
end
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ vim.cmd [[packadd packer.nvim]]
|
|||
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
|
|
@ -32,7 +32,7 @@ return require('packer').startup(function(use)
|
|||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
|
||||
use {
|
||||
|
|
@ -60,7 +60,7 @@ return require('packer').startup(function(use)
|
|||
end
|
||||
}
|
||||
|
||||
use {
|
||||
use {
|
||||
'CRAG666/betterTerm.nvim',
|
||||
config = function() require('betterTerm').setup() end
|
||||
}
|
||||
|
|
@ -68,9 +68,9 @@ return require('packer').startup(function(use)
|
|||
use {
|
||||
'anurag3301/nvim-platformio.lua',
|
||||
requires = {
|
||||
{'akinsho/nvim-toggleterm.lua'},
|
||||
{'nvim-telescope/telescope.nvim'},
|
||||
{'nvim-lua/plenary.nvim'},
|
||||
{ 'akinsho/nvim-toggleterm.lua' },
|
||||
{ 'nvim-telescope/telescope.nvim' },
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
config = function()
|
||||
if not vim.g.is_purdue then
|
||||
|
|
@ -113,28 +113,95 @@ return require('packer').startup(function(use)
|
|||
|
||||
use {
|
||||
'f-person/git-blame.nvim',
|
||||
config = function ()
|
||||
config = function()
|
||||
require("gitblame").setup {
|
||||
gitblame_delay = 1
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'mrcjkb/rustaceanvim',
|
||||
config = function() require('plugins/rust-config') end
|
||||
}
|
||||
-- use {
|
||||
-- 'mrcjkb/rustaceanvim',
|
||||
-- config = function() require('plugins/rust-config') end
|
||||
-- }
|
||||
|
||||
use {
|
||||
"NeogitOrg/neogit",
|
||||
config = function ()
|
||||
config = function()
|
||||
require("neogit").setup {}
|
||||
end
|
||||
}
|
||||
|
||||
use "mfussenegger/nvim-dap"
|
||||
use {
|
||||
"mfussenegger/nvim-dap",
|
||||
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
|
||||
require('dap.ext.vscode').load_launchjs(nil, {
|
||||
node = { 'javascript', 'typescript' },
|
||||
python = { 'python' },
|
||||
go = { 'go' },
|
||||
codelldb = { 'c', 'cpp', 'rust' }
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<M-u>', function() dap.continue() end, { desc = 'DAP: Continue' })
|
||||
vim.keymap.set('n', '<M-i>', function() dap.step_into() end, { desc = 'DAP: Step Into' })
|
||||
vim.keymap.set('n', '<M-o>', function() dap.step_out() end, { desc = 'DAP: Step Out' })
|
||||
vim.keymap.set('n', '<M-p>', function() dap.step_over() end, { desc = 'DAP: Step Over' })
|
||||
vim.keymap.set('n', '<M-b>', function() dap.toggle_breakpoint() end, { desc = 'DAP: Toggle Breakpoint' })
|
||||
vim.keymap.set('n', '<F5>', function() dap.continue() end)
|
||||
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
|
||||
vim.keymap.set('n', '<F11>', function() dap.step_into() end)
|
||||
vim.keymap.set('n', '<F12>', function() dap.step_out() end)
|
||||
vim.keymap.set('n', '<Leader>b', function() dap.toggle_breakpoint() end)
|
||||
vim.keymap.set('n', '<Leader>dr', function() dap.repl.open() end)
|
||||
|
||||
dap.adapters.codelldb = {
|
||||
type = "executable",
|
||||
command = "codelldb"
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
use {
|
||||
'stevearc/overseer.nvim',
|
||||
config = function() require('overseer').setup() end
|
||||
}
|
||||
use 'theHamsta/nvim-dap-virtual-text'
|
||||
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"} }
|
||||
use {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function()
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
use { "geigerzaehler/tree-sitter-jinja2" }
|
||||
|
||||
|
|
@ -176,29 +243,30 @@ return require('packer').startup(function(use)
|
|||
})
|
||||
|
||||
|
||||
-- use {
|
||||
-- 'preservim/vim-pencil',
|
||||
-- config = function()
|
||||
-- vim.cmd([[
|
||||
-- augroup PencilSetup
|
||||
-- autocmd!
|
||||
-- autocmd FileType markdown,text,tex,gitcommit setlocal formatoptions+=t
|
||||
-- autocmd FileType markdown,text,tex,gitcommit PencilHard
|
||||
-- augroup END augroup END
|
||||
-- ]])
|
||||
-- end
|
||||
-- }
|
||||
|
||||
use {
|
||||
'preservim/vim-pencil',
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
vim.cmd([[
|
||||
augroup PencilSetup
|
||||
autocmd!
|
||||
autocmd FileType markdown,text,tex,gitcommit setlocal formatoptions+=t
|
||||
autocmd FileType markdown,text,tex,gitcommit PencilHard
|
||||
augroup END augroup END
|
||||
]])
|
||||
require 'telescope-tabs'.setup {
|
||||
-- Your custom config :^)
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
require'telescope-tabs'.setup{
|
||||
-- Your custom config :^)
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use "HiPhish/rainbow-delimiters.nvim"
|
||||
|
||||
|
||||
------------------------
|
||||
|
|
@ -207,4 +275,3 @@ return require('packer').startup(function(use)
|
|||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave", "TextChanged" }, {
|
||||
callback = function()
|
||||
|
||||
-- try_lint without arguments runs the linters defined in `linters_by_ft`
|
||||
-- for the current filetype
|
||||
require("lint").try_lint()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue