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
0dbcf730bf
commit
692ff13e18
23
init.lua
23
init.lua
|
@ -195,7 +195,10 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
|
||||
{ 'benfowler/telescope-luasnip.nvim' },
|
||||
{
|
||||
-- Allow to search for snippets
|
||||
'benfowler/telescope-luasnip.nvim'
|
||||
},
|
||||
|
||||
{
|
||||
-- Highlight, edit, and navigate code
|
||||
|
@ -472,7 +475,7 @@ local servers = {
|
|||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
|
||||
|
||||
marksman = {
|
||||
ft = {
|
||||
'markdown',
|
||||
|
@ -486,6 +489,22 @@ local servers = {
|
|||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
|
||||
texlab = {
|
||||
settings = {
|
||||
build = {
|
||||
executable = "tectonic",
|
||||
args = {
|
||||
"-X",
|
||||
"compile",
|
||||
"%f",
|
||||
"--syntex",
|
||||
"--keep-logs",
|
||||
"--keep-intermediates"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
|
|
|
@ -8,14 +8,21 @@ local fmt = require("luasnip.extras.fmt").fmt
|
|||
-- Function to get the datetime
|
||||
-- with daylight saving time
|
||||
-- according to the locale
|
||||
local get_date = function()
|
||||
local get_datetime = function()
|
||||
return os.date("%Y-%m-%dT%H:%M:%S%z")
|
||||
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()
|
||||
return os.date("%B")
|
||||
end
|
||||
|
||||
-- Function to get the current year
|
||||
local get_month_year = function()
|
||||
return os.date("%B-%Y")
|
||||
end
|
||||
|
@ -25,27 +32,52 @@ local get_id = function()
|
|||
return os.date("%Y%m%d%H%M%S")
|
||||
end
|
||||
|
||||
-- Function to get the number of the current day
|
||||
local get_day = function()
|
||||
return os.date("%d")
|
||||
end
|
||||
|
||||
return {
|
||||
s(
|
||||
{
|
||||
trig = "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(
|
||||
{
|
||||
trig = "id",
|
||||
Name = "ID",
|
||||
dscr = "Insert an id based on the datetime"
|
||||
dscr = "Insert an id based on the current datetime."
|
||||
},
|
||||
{
|
||||
f(get_id, {})
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "today",
|
||||
Name = "Today",
|
||||
dscr = "Insert the number of the current day."
|
||||
},
|
||||
{
|
||||
f(get_day, {})
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "fm",
|
||||
|
|
Loading…
Reference in New Issue