Compare commits
25 Commits
2b45d04598
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
288621e1a4 | ||
|
|
5123a6cc03 | ||
|
|
ae30620d2a | ||
|
|
1d941bca87 | ||
|
|
f999ff81f9 | ||
|
|
06ba2f478d | ||
|
|
e5ebca8094 | ||
|
|
0e3a2dd8cc | ||
|
|
92961e4b42 | ||
|
|
97864420c3 | ||
|
|
b31dab0c4f | ||
|
|
608d71b7b1 | ||
|
|
ecd31ab3fe | ||
|
|
269c827a7b | ||
|
|
4a1006a062 | ||
|
|
f08a9f933f | ||
|
|
3dafac9fa7 | ||
|
|
398cbda7ae | ||
|
|
af5d8b57f2 | ||
|
|
99b4397294 | ||
|
|
e6658f026a | ||
|
|
2b577db2e5 | ||
|
|
f3362a2187 | ||
|
|
5ebc063aa8 | ||
|
|
a98f5808a4 |
@@ -1,21 +1,19 @@
|
|||||||
{
|
{
|
||||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "6bb2a266facf0d16e30371b6b433037d1828a674" },
|
"fzf-lua": { "branch": "main", "commit": "b1d2b0dc146cb9260209da4d7ab754adb0a2653d" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
|
||||||
"image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
|
"image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "ed4dc336a73c18da6fea6e1cf7ad6e1b76d281eb" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1d77bd86e1c3eaa777010c95dad455b83823f247" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "0b9bb925c000ae649ff7e7149c8cd00031f4b539" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
||||||
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
|
|
||||||
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
|
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
|
||||||
"noice.nvim": { "branch": "main", "commit": "d14d02cb709e3bb2da88363c32f8b4250bced52d" },
|
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "2b52bc2190c8efde2e4de02d829a138666774c7c" },
|
"nvim-lspconfig": { "branch": "master", "commit": "effe4bf2e1afb881ea67291c648b68dd3dfc927a" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "645f42e85d8665c91a9911c3896afb57d6b8a923" },
|
"nvim-treesitter": { "branch": "main", "commit": "6e42d823ce0a5a76180c473c119c7677738a09d1" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
"oil.nvim": { "branch": "master", "commit": "756dec855b4811f2d27f067a3aca477f368d99f5" },
|
||||||
"render-markdown.nvim": { "branch": "main", "commit": "bfd67f1402b97ac619cb538f4bbaed12a7fa89aa" },
|
"render-markdown.nvim": { "branch": "main", "commit": "b2b135347e299ffbf7f4123fb7811899b0c9f4b8" },
|
||||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }
|
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,129 @@
|
|||||||
|
local function options2list(options)
|
||||||
|
local options_list = {}
|
||||||
|
for opt in options:gmatch("%S+") do
|
||||||
|
table.insert(options_list, opt)
|
||||||
|
end
|
||||||
|
return options_list
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
local function markdown(options)
|
||||||
pattern = { "markdown" },
|
local options_list = options2list(options or "")
|
||||||
callback = function()
|
local cmd = vim.list_extend(
|
||||||
vim.schedule(function()
|
{ "pandoc" },
|
||||||
vim.keymap.set("n", "<F5>", "<CMD>!pandoc %:p -o %:p:r.pdf --verbose &> .pandoc-log <CR>", {silent = true})
|
options_list
|
||||||
end)
|
)
|
||||||
|
table.insert(cmd, "-s")
|
||||||
|
table.insert(cmd, vim.fn.expand("%:p"))
|
||||||
|
table.insert(cmd, "-o")
|
||||||
|
table.insert(cmd, vim.fn.expand("%:p:r") .. ".tex")
|
||||||
|
local pandoc_process = vim.system(cmd)
|
||||||
|
local pandoc_result = pandoc_process:wait()
|
||||||
|
|
||||||
|
local pdflatex_process = vim.system({
|
||||||
|
"pdflatex",
|
||||||
|
vim.fn.expand("%:p:r") .. ".tex",
|
||||||
|
})
|
||||||
|
local pdflatex_result = pdflatex_process:wait()
|
||||||
|
|
||||||
|
--vim.notify((pandoc_result.stdout .. "\n\n" .. pdflatex_result.stdout):gsub("^%s*", ""):gsub("%s*$", ""), vim.log.levels.INFO);
|
||||||
|
vim.notify((pandoc_result.stderr .. "\n\n" .. pdflatex_result.stderr):gsub("^%s*", ""):gsub("%s*$", ""), vim.log.levels.ERROR);
|
||||||
|
end
|
||||||
|
|
||||||
|
local function arduino(options)
|
||||||
|
local options_list = options2list(options or "")
|
||||||
|
local options_string = ""
|
||||||
|
for _, opt in pairs(options_list) do
|
||||||
|
options_string = options_string .. " -D" .. opt
|
||||||
|
end
|
||||||
|
|
||||||
|
local process = vim.system({
|
||||||
|
"arduino-cli",
|
||||||
|
"compile",
|
||||||
|
"-e",
|
||||||
|
"--build-property",
|
||||||
|
"compiler.cpp.extra_flags=" .. options_string,
|
||||||
|
vim.fn.expand("%:p:h")
|
||||||
|
})
|
||||||
|
local result = process:wait()
|
||||||
|
|
||||||
|
vim.notify(result.stdout, vim.log.levels.INFO)
|
||||||
|
vim.notify(result.stderr, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
|
||||||
|
--local function arduino2()
|
||||||
|
-- local arduino_process = vim.system({
|
||||||
|
-- "arduino-cli",
|
||||||
|
-- "board",
|
||||||
|
-- "listall",
|
||||||
|
-- "--json"
|
||||||
|
-- })
|
||||||
|
-- local boards_json = arduino_process:wait()
|
||||||
|
--
|
||||||
|
-- local jq_process = vim.system({
|
||||||
|
-- "jq",
|
||||||
|
-- "[.boards.[] | {(.name): .fqbn}] | add",
|
||||||
|
-- }, { stdin = boards_json.stdout })
|
||||||
|
-- local boards_jq = jq_process:wait().stdout or {}
|
||||||
|
-- local boards_table = vim.json.decode(boards_jq)
|
||||||
|
--
|
||||||
|
-- local function table_keys(t)
|
||||||
|
-- local keys = {}
|
||||||
|
-- for k in pairs(t) do keys[#keys + 1] = k end
|
||||||
|
-- return keys
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- local keys = table_keys(boards_table)
|
||||||
|
-- table.sort(keys)
|
||||||
|
-- require("fzf-lua").fzf_exec(keys, {
|
||||||
|
-- actions = {
|
||||||
|
-- ['default'] = function(selected, opts)
|
||||||
|
-- local process = vim.system({
|
||||||
|
-- "arduino-cli",
|
||||||
|
-- "compile",
|
||||||
|
-- "-e",
|
||||||
|
-- "--fqbn",
|
||||||
|
-- boards_table[selected[1]],
|
||||||
|
-- vim.fn.expand("%:p:h")
|
||||||
|
-- })
|
||||||
|
-- local result = process:wait()
|
||||||
|
--
|
||||||
|
-- vim.notify(result.stdout, vim.log.levels.INFO)
|
||||||
|
-- vim.notify(result.stderr, vim.log.levels.ERROR)
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
--end
|
||||||
|
|
||||||
|
local function tex()
|
||||||
|
local pdflatex_process = vim.system({
|
||||||
|
"pdflatex",
|
||||||
|
vim.fn.expand("%:p"),
|
||||||
|
})
|
||||||
|
local pdflatex_result = pdflatex_process:wait()
|
||||||
|
|
||||||
|
vim.notify(pdflatex_result.stdout, vim.log.levels.INFO);
|
||||||
|
vim.notify(pdflatex_result.stderr, vim.log.levels.ERROR);
|
||||||
|
end
|
||||||
|
|
||||||
|
local default = {
|
||||||
|
__index = function()
|
||||||
|
return function() end
|
||||||
end,
|
end,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
local fttable = {
|
||||||
|
["markdown"] = markdown,
|
||||||
|
["arduino"] = arduino,
|
||||||
|
["tex"] = tex,
|
||||||
|
}
|
||||||
|
setmetatable(fttable, default)
|
||||||
|
|
||||||
|
local fttable2 = {
|
||||||
|
["markdown"] = function() markdown(vim.fn.input("enter additional options")) end,
|
||||||
|
["arduino"] = function() arduino(vim.fn.input("enter preprocessor defines")) end,
|
||||||
|
}
|
||||||
|
setmetatable(fttable2, fttable)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<F5>", function() fttable[vim.bo.filetype]() end)
|
||||||
|
vim.keymap.set("n", "<F6>", function() fttable2[vim.bo.filetype]() end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require("config.startup")
|
||||||
|
|
||||||
require("config.vars")
|
require("config.vars")
|
||||||
require("config.keybinds")
|
require("config.keybinds")
|
||||||
require("config.ftkeybinds")
|
require("config.ftkeybinds")
|
||||||
@@ -5,4 +7,5 @@ require("config.ftkeybinds")
|
|||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
require("config.treesitter")
|
require("config.treesitter")
|
||||||
|
require("lsp")
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
|
-- move to line start/end
|
||||||
|
vim.keymap.set('i', "<C-e>", "<C-o>$")
|
||||||
|
vim.keymap.set('i', "<C-a>", "<C-o>^")
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'v' }, "<C-e>", '$')
|
||||||
|
vim.keymap.set({ 'n', 'v' }, "<C-a>", '^')
|
||||||
|
|
||||||
-- yank to clipboard
|
-- yank to clipboard
|
||||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||||
@@ -24,12 +31,12 @@ vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", {silent = true})
|
|||||||
vim.keymap.set("n", "<leader>sb", function ()
|
vim.keymap.set("n", "<leader>sb", function ()
|
||||||
local filetype = vim.bo.filetype
|
local filetype = vim.bo.filetype
|
||||||
local mapping = {
|
local mapping = {
|
||||||
jl = "julia",
|
jl = "/usr/bin/env julia",
|
||||||
julia = "julia",
|
julia = "/usr/bin/env julia",
|
||||||
sh = "bash",
|
sh = "bash",
|
||||||
zsh = "zsh",
|
zsh = "zsh",
|
||||||
py = "/usr/bin/env python3",
|
py = "/usr/bin/env python",
|
||||||
python = "/usr/bin/env python3",
|
python = "/usr/bin/env python",
|
||||||
}
|
}
|
||||||
local command = mapping[filetype]
|
local command = mapping[filetype]
|
||||||
if (command == nil) then return end
|
if (command == nil) then return end
|
||||||
|
|||||||
12
lua/config/startup.lua
Normal file
12
lua/config/startup.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
local logfile = vim.lsp.log.get_filename()
|
||||||
|
|
||||||
|
local tail_process = vim.system({
|
||||||
|
"tail",
|
||||||
|
"-n 10000",
|
||||||
|
logfile,
|
||||||
|
}, {}, function(res)
|
||||||
|
vim.schedule(function ()
|
||||||
|
vim.fn.writefile(vim.split(res.stdout, "\n", { plain = true }), logfile)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
30
lua/lsp/arduino.lua
Normal file
30
lua/lsp/arduino.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
local config = {
|
||||||
|
cmd = {
|
||||||
|
"arduino-language-server",
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
"arduino",
|
||||||
|
"cpp",
|
||||||
|
},
|
||||||
|
root_dir = function (bufnr, on_dir)
|
||||||
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
--vim.notify(vim.fs.find({ vim.fn.fnamemodify(fname, ':t:r') }, { type = "directory", upward = true })[1])
|
||||||
|
on_dir(vim.fs.find({ vim.fn.fnamemodify(fname, ':t:r') }, { type = "directory", upward = true })[1])
|
||||||
|
end,
|
||||||
|
capabilities = {
|
||||||
|
textDocument = {
|
||||||
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
|
semanticTokens = vim.NIL,
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
|
semanticTokens = vim.NIL,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.config['arduino_language_server'] = config
|
||||||
|
vim.lsp.enable('arduino_language_server')
|
||||||
|
|
||||||
6
lua/lsp/init.lua
Normal file
6
lua/lsp/init.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# https://github.com/neovim/nvim-lspconfig/blob/master/lsp
|
||||||
|
require("lsp.arduino")
|
||||||
|
require("lsp.latex")
|
||||||
|
require("lsp.lua")
|
||||||
|
require("lsp.python")
|
||||||
|
|
||||||
171
lua/lsp/latex.lua
Normal file
171
lua/lsp/latex.lua
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
local function buf_build(client, bufnr)
|
||||||
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
local params = vim.lsp.util.make_position_params(win, client.offset_encoding)
|
||||||
|
client:request('textDocument/build', params, function(err, result)
|
||||||
|
if err then
|
||||||
|
error(tostring(err))
|
||||||
|
end
|
||||||
|
local texlab_build_status = {
|
||||||
|
[0] = 'Success',
|
||||||
|
[1] = 'Error',
|
||||||
|
[2] = 'Failure',
|
||||||
|
[3] = 'Cancelled',
|
||||||
|
}
|
||||||
|
vim.notify('Build ' .. texlab_build_status[result.status], vim.log.levels.INFO)
|
||||||
|
end, bufnr)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function buf_search(client, bufnr)
|
||||||
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
local params = vim.lsp.util.make_position_params(win, client.offset_encoding)
|
||||||
|
client:request('textDocument/forwardSearch', params, function(err, result)
|
||||||
|
if err then
|
||||||
|
error(tostring(err))
|
||||||
|
end
|
||||||
|
local texlab_forward_status = {
|
||||||
|
[0] = 'Success',
|
||||||
|
[1] = 'Error',
|
||||||
|
[2] = 'Failure',
|
||||||
|
[3] = 'Unconfigured',
|
||||||
|
}
|
||||||
|
vim.notify('Search ' .. texlab_forward_status[result.status], vim.log.levels.INFO)
|
||||||
|
end, bufnr)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function buf_cancel_build(client, bufnr)
|
||||||
|
return client:exec_cmd({
|
||||||
|
title = 'cancel',
|
||||||
|
command = 'texlab.cancelBuild',
|
||||||
|
}, { bufnr = bufnr })
|
||||||
|
end
|
||||||
|
|
||||||
|
local function dependency_graph(client)
|
||||||
|
client:exec_cmd({ command = 'texlab.showDependencyGraph' }, { bufnr = 0 }, function(err, result)
|
||||||
|
if err then
|
||||||
|
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
vim.notify('The dependency graph has been generated:\n' .. result, vim.log.levels.INFO)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function command_factory(cmd)
|
||||||
|
local cmd_tbl = {
|
||||||
|
Auxiliary = 'texlab.cleanAuxiliary',
|
||||||
|
Artifacts = 'texlab.cleanArtifacts',
|
||||||
|
}
|
||||||
|
return function(client, bufnr)
|
||||||
|
return client:exec_cmd({
|
||||||
|
title = ('clean_%s'):format(cmd),
|
||||||
|
command = cmd_tbl[cmd],
|
||||||
|
arguments = { { uri = vim.uri_from_bufnr(bufnr) } },
|
||||||
|
}, { bufnr = bufnr }, function(err, _)
|
||||||
|
if err then
|
||||||
|
vim.notify(('Failed to clean %s files: %s'):format(cmd, err.message), vim.log.levels.ERROR)
|
||||||
|
else
|
||||||
|
vim.notify(('Command %s executed successfully'):format(cmd), vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function buf_find_envs(client, bufnr)
|
||||||
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
client:exec_cmd({
|
||||||
|
command = 'texlab.findEnvironments',
|
||||||
|
arguments = { vim.lsp.util.make_position_params(win, client.offset_encoding) },
|
||||||
|
}, { bufnr = bufnr }, function(err, result)
|
||||||
|
if err then
|
||||||
|
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
local env_names = {}
|
||||||
|
local max_length = 1
|
||||||
|
for _, env in ipairs(result) do
|
||||||
|
table.insert(env_names, env.name.text)
|
||||||
|
max_length = math.max(max_length, string.len(env.name.text))
|
||||||
|
end
|
||||||
|
for i, name in ipairs(env_names) do
|
||||||
|
env_names[i] = string.rep(' ', i - 1) .. name
|
||||||
|
end
|
||||||
|
vim.lsp.util.open_floating_preview(env_names, '', {
|
||||||
|
height = #env_names,
|
||||||
|
width = math.max((max_length + #env_names - 1), (string.len 'Environments')),
|
||||||
|
focusable = false,
|
||||||
|
focus = false,
|
||||||
|
title = 'Environments',
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function buf_change_env(client, bufnr)
|
||||||
|
vim.ui.input({ prompt = 'New environment name: ' }, function(input)
|
||||||
|
if not input or input == '' then
|
||||||
|
return vim.notify('No environment name provided', vim.log.levels.WARN)
|
||||||
|
end
|
||||||
|
local pos = vim.api.nvim_win_get_cursor(0)
|
||||||
|
return client:exec_cmd({
|
||||||
|
title = 'change_environment',
|
||||||
|
command = 'texlab.changeEnvironment',
|
||||||
|
arguments = {
|
||||||
|
{
|
||||||
|
textDocument = { uri = vim.uri_from_bufnr(bufnr) },
|
||||||
|
position = { line = pos[1] - 1, character = pos[2] },
|
||||||
|
newName = tostring(input),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, { bufnr = bufnr })
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
local config = {
|
||||||
|
cmd = { 'texlab' },
|
||||||
|
filetypes = { 'tex', 'plaintex', 'bib' },
|
||||||
|
root_markers = { '.git', '.latexmkrc', 'latexmkrc', '.texlabroot', 'texlabroot', 'Tectonic.toml' },
|
||||||
|
settings = {
|
||||||
|
texlab = {
|
||||||
|
rootDirectory = nil,
|
||||||
|
build = {
|
||||||
|
executable = 'latexmk',
|
||||||
|
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' },
|
||||||
|
onSave = false,
|
||||||
|
forwardSearchAfter = false,
|
||||||
|
},
|
||||||
|
forwardSearch = {
|
||||||
|
executable = nil,
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
chktex = {
|
||||||
|
onOpenAndSave = false,
|
||||||
|
onEdit = false,
|
||||||
|
},
|
||||||
|
diagnosticsDelay = 300,
|
||||||
|
latexFormatter = 'latexindent',
|
||||||
|
latexindent = {
|
||||||
|
['local'] = nil, -- local is a reserved keyword
|
||||||
|
modifyLineBreaks = false,
|
||||||
|
},
|
||||||
|
bibtexFormatter = 'texlab',
|
||||||
|
formatterLineLength = 80,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
for _, cmd in ipairs({
|
||||||
|
{ name = 'TexlabBuild', fn = buf_build, desc = 'Build the current buffer' },
|
||||||
|
{ name = 'TexlabForward', fn = buf_search, desc = 'Forward search from current position' },
|
||||||
|
{ name = 'TexlabCancelBuild', fn = buf_cancel_build, desc = 'Cancel the current build' },
|
||||||
|
{ name = 'TexlabDependencyGraph', fn = dependency_graph, desc = 'Show the dependency graph' },
|
||||||
|
{ name = 'TexlabCleanArtifacts', fn = command_factory('Artifacts'), desc = 'Clean the artifacts' },
|
||||||
|
{ name = 'TexlabCleanAuxiliary', fn = command_factory('Auxiliary'), desc = 'Clean the auxiliary files' },
|
||||||
|
{ name = 'TexlabFindEnvironments', fn = buf_find_envs, desc = 'Find the environments at current position' },
|
||||||
|
{ name = 'TexlabChangeEnvironment', fn = buf_change_env, desc = 'Change the environment at current position' },
|
||||||
|
}) do
|
||||||
|
vim.api.nvim_buf_create_user_command(bufnr, 'Lsp' .. cmd.name, function()
|
||||||
|
cmd.fn(client, bufnr)
|
||||||
|
end, { desc = cmd.desc })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.config['texlab'] = config
|
||||||
|
vim.lsp.enable('texlab')
|
||||||
|
|
||||||
17
lua/lsp/lua.lua
Normal file
17
lua/lsp/lua.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---@type vim.lsp.Config
|
||||||
|
local config = {
|
||||||
|
cmd = { 'lua-language-server' },
|
||||||
|
filetypes = { 'lua' },
|
||||||
|
root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' },
|
||||||
|
settings = {
|
||||||
|
codeLens = { enable = true },
|
||||||
|
hine = {
|
||||||
|
enable = true,
|
||||||
|
semicolon = 'Disable',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.config['lua_ls'] = config
|
||||||
|
vim.lsp.enable('lua_ls')
|
||||||
|
|
||||||
18
lua/lsp/python.lua
Normal file
18
lua/lsp/python.lua
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
local config = {
|
||||||
|
cmd = { 'pylsp' },
|
||||||
|
filetypes = { 'python' },
|
||||||
|
root_markers = {
|
||||||
|
'pyproject.toml',
|
||||||
|
'setup.py',
|
||||||
|
'setup.cfg',
|
||||||
|
'requirements.txt',
|
||||||
|
'Pipfile',
|
||||||
|
'.git',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.config['python-language-server'] = config
|
||||||
|
vim.lsp.enable('python-language-server')
|
||||||
|
|
||||||
@@ -26,6 +26,15 @@ return {
|
|||||||
documentation = {
|
documentation = {
|
||||||
auto_show = true,
|
auto_show = true,
|
||||||
},
|
},
|
||||||
|
menu = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
signature = {
|
||||||
|
window = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
return {
|
|
||||||
'ThePrimeagen/harpoon',
|
|
||||||
branch = 'harpoon2',
|
|
||||||
requires = {
|
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
|
||||||
{ 'nvim-telescope/telescope.nvim' },
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>a", function() require("harpoon"):list():add() end },
|
|
||||||
{ "<C-w>", function()
|
|
||||||
local harpoon = require("harpoon")
|
|
||||||
local conf = require("telescope.config").values
|
|
||||||
local function toggle_telescope(harpoon_files)
|
|
||||||
local file_paths = {}
|
|
||||||
for _, item in ipairs(harpoon_files.items) do
|
|
||||||
table.insert(file_paths, item.value)
|
|
||||||
end
|
|
||||||
|
|
||||||
require("telescope.pickers").new({}, {
|
|
||||||
prompt_title = "Harpoon",
|
|
||||||
finder = require("telescope.finders").new_table({ results = file_paths }),
|
|
||||||
previewer = conf.file_previewer({}),
|
|
||||||
sorter = conf.generic_sorter({}),
|
|
||||||
}):find()
|
|
||||||
end
|
|
||||||
toggle_telescope(harpoon:list())
|
|
||||||
end, desc = "Open harpoon window" },
|
|
||||||
|
|
||||||
{ "<C-1>", function() require("harpoon"):list():select(1) end },
|
|
||||||
{ "<C-2>", function() require("harpoon"):list():select(2) end },
|
|
||||||
{ "<C-3>", function() require("harpoon"):list():select(3) end },
|
|
||||||
{ "<C-4>", function() require("harpoon"):list():select(4) end },
|
|
||||||
|
|
||||||
{ "<C-q>", function() require("harpoon"):list():prev() end },
|
|
||||||
{ "<C-e>", function() require("harpoon"):list():next() end },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -12,5 +12,6 @@ return {
|
|||||||
window_overlap_clear_enabled = true,
|
window_overlap_clear_enabled = true,
|
||||||
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '', },
|
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '', },
|
||||||
},
|
},
|
||||||
|
lazy = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,5 +25,6 @@ return {
|
|||||||
'latex2text',
|
'latex2text',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
enabled = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,5 +19,6 @@ return {
|
|||||||
},
|
},
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
},
|
},
|
||||||
|
enabled = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-mini/mini.icons',
|
'nvim-mini/mini.icons',
|
||||||
|
lazy = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ return {
|
|||||||
vim.g.molten_image_provider = 'image.nvim'
|
vim.g.molten_image_provider = 'image.nvim'
|
||||||
vim.g.molten_output_win_max_height = 20
|
vim.g.molten_output_win_max_height = 20
|
||||||
end,
|
end,
|
||||||
|
enabled = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ return {
|
|||||||
cmd = { 'LspInfo', 'LspInstall', 'LspStart' },
|
cmd = { 'LspInfo', 'LspInstall', 'LspStart' },
|
||||||
event = { 'BufReadPre', 'BufNewFile' },
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
dependencies = { 'saghen/blink.cmp' },
|
dependencies = { 'saghen/blink.cmp' },
|
||||||
|
enabled = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
|
--dependencies = { "nvim-mini/mini.icons" },
|
||||||
|
|
||||||
---@module 'oil'
|
---@module 'oil'
|
||||||
---@type oil.SetupOpts
|
---@type oil.SetupOpts
|
||||||
opts = {
|
opts = {
|
||||||
|
|||||||
Reference in New Issue
Block a user