LSP: install and configure texlab
- Installs and configure texlab which provides LSP and linter for LaTeX. Should also allow to build a project, but It is failling right now, I don't get why. - Adds a markdown snippet to get the number of the curret day. - Adds a markdown snippet to get the current date. - Improves the syntax of the markdown snippets descriptions. - Documents the feature of the plugin that provides the snippets search through telescope. Co-Authored-by: iGor milhit <igor@milhit.ch>
parent
980b84a0e0
commit
b30b439e71
23
init.lua
23
init.lua
|
@ -195,7 +195,10 @@ require('lazy').setup({
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'benfowler/telescope-luasnip.nvim' },
|
{
|
||||||
|
-- Allow to search for snippets
|
||||||
|
'benfowler/telescope-luasnip.nvim'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Highlight, edit, and navigate code
|
-- Highlight, edit, and navigate code
|
||||||
|
@ -472,7 +475,7 @@ local servers = {
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- tsserver = {},
|
-- tsserver = {},
|
||||||
|
|
||||||
marksman = {
|
marksman = {
|
||||||
ft = {
|
ft = {
|
||||||
'markdown',
|
'markdown',
|
||||||
|
@ -486,6 +489,22 @@ local servers = {
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
texlab = {
|
||||||
|
settings = {
|
||||||
|
build = {
|
||||||
|
executable = "tectonic",
|
||||||
|
args = {
|
||||||
|
"-X",
|
||||||
|
"compile",
|
||||||
|
"%f",
|
||||||
|
"--syntex",
|
||||||
|
"--keep-logs",
|
||||||
|
"--keep-intermediates"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Setup neovim lua configuration
|
-- Setup neovim lua configuration
|
||||||
|
|
|
@ -8,14 +8,21 @@ local fmt = require("luasnip.extras.fmt").fmt
|
||||||
-- Function to get the datetime
|
-- Function to get the datetime
|
||||||
-- with daylight saving time
|
-- with daylight saving time
|
||||||
-- according to the locale
|
-- according to the locale
|
||||||
local get_date = function()
|
local get_datetime = function()
|
||||||
return os.date("%Y-%m-%dT%H:%M:%S%z")
|
return os.date("%Y-%m-%dT%H:%M:%S%z")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Function to get the current date
|
||||||
|
local get_date = function()
|
||||||
|
return os.date("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Function to get the current month
|
||||||
local get_month = function()
|
local get_month = function()
|
||||||
return os.date("%B")
|
return os.date("%B")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Function to get the current year
|
||||||
local get_month_year = function()
|
local get_month_year = function()
|
||||||
return os.date("%B-%Y")
|
return os.date("%B-%Y")
|
||||||
end
|
end
|
||||||
|
@ -25,27 +32,52 @@ local get_id = function()
|
||||||
return os.date("%Y%m%d%H%M%S")
|
return os.date("%Y%m%d%H%M%S")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Function to get the number of the current day
|
||||||
|
local get_day = function()
|
||||||
|
return os.date("%d")
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
s(
|
s(
|
||||||
{
|
{
|
||||||
trig = "datetime",
|
trig = "datetime",
|
||||||
name = "Datetime",
|
name = "Datetime",
|
||||||
dscr = "Insert datetime with locale daylight saving"
|
dscr = "Insert the current datetime with locale daylight saving."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
f(get_date, {})
|
f(get_datetime, {})
|
||||||
|
}
|
||||||
|
),
|
||||||
|
s(
|
||||||
|
{
|
||||||
|
trig = "date",
|
||||||
|
name = "Date",
|
||||||
|
dscr = "Insert the current date."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f(get_datetime, {})
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
s(
|
s(
|
||||||
{
|
{
|
||||||
trig = "id",
|
trig = "id",
|
||||||
Name = "ID",
|
Name = "ID",
|
||||||
dscr = "Insert an id based on the datetime"
|
dscr = "Insert an id based on the current datetime."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
f(get_id, {})
|
f(get_id, {})
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
s(
|
||||||
|
{
|
||||||
|
trig = "today",
|
||||||
|
Name = "Today",
|
||||||
|
dscr = "Insert the number of the current day."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f(get_day, {})
|
||||||
|
}
|
||||||
|
),
|
||||||
s(
|
s(
|
||||||
{
|
{
|
||||||
trig = "fm",
|
trig = "fm",
|
||||||
|
|
Loading…
Reference in New Issue