Update 16.09.2023

This commit is contained in:
Kristofers Solo
2023-09-16 19:53:03 +03:00
parent 32789241bf
commit f37a67d62f
17 changed files with 229 additions and 119 deletions

6
after/ftplugin/norg.lua Normal file
View File

@@ -0,0 +1,6 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.wrap = true
vim.opt_local.spell = true
vim.opt_local.spelllang = "lv_LV"

View File

@@ -190,9 +190,7 @@ null_ls.setup({
"strict",
},
}),
formatting.markdownlint.with({
extra_filetypes = { "vimwiki" },
}),
-- formatting.markdownlint.with({ extra_filetypes = { "vimwiki" }, }),
formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }),
-- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
-- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
@@ -285,6 +283,7 @@ cmp.setup({
{ name = "path" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "neorg" },
},
snippet = {
expand = function(args)
@@ -299,9 +298,10 @@ cmp.setup({
nvim_lsp = "[LSP]",
nvim_lua = "[api]",
luasnip = "[snip]",
buffer = "[buf]",
path = "[path]",
emoji = "[emoji]",
neorg = "[neorg]",
buffer = "[buf]",
gh_issues = "[issues]",
})[entry.source.name]
return vim_item

View File

@@ -27,7 +27,7 @@ require("lualine").setup({
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { "filename", "diff" },
lualine_c = { "filename", "diff", "lsp_progress" },
lualine_x = { "diagnostics", "encoding", "filetype", "filesize" },
lualine_y = { "progress" },
lualine_z = { "location" },

View File

@@ -48,13 +48,13 @@ vim.keymap.set({ "i" }, "<C-l>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end)
end, { silent = true })
vim.keymap.set({ "i" }, "<C-h>", function()
if ls.choice_active() then
ls.change_choice(-1)
end
end)
end, { silent = true })
ls.config.set_config({
-- This tells LuaSnip to remember to keep around the last snippet.

31
after/plugin/neorg.lua Normal file
View File

@@ -0,0 +1,31 @@
if not pcall(require, "neorg") then
return
end
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
university = "~/neorg/University",
},
default_workspace = "university",
},
},
["core.completion"] = {
config = {
engine = "nvim-cmp",
name = "[Neorg]",
},
},
["core.export.markdown"] = {},
["core.summary"] = {
config = {
strategy = "default",
},
},
-- ["core.ui.calendar"] = {},
},
})

View File

@@ -1,34 +0,0 @@
if not pcall(require, "luasnip") then
return
end
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local c = ls.choice_node
local fmt = require("luasnip.extras.fmt").fmt
ls.add_snippets("norg", {
s(
"meta",
fmt(
[[
@document.meta
title: {}
author: {}
categories: {}
@end
]],
{
i(1),
c(2, {
t("Kristofers Solo"),
t("Kristiāns Francis Cagulis, kc22015"),
t("Kristiāns Francis Cagulis"),
}),
i(0),
}
)
),
})

View File

@@ -0,0 +1,29 @@
if not pcall(require, "luasnip") then
return
end
local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local t = ls.text_node
local fmt = require("luasnip.extras.fmt").fmt
local c = ls.choice_node
ls.add_snippets("python", {
s(
"main",
fmt(
[[
def main() -> None:
{}
if __name__ == "__main__":
main()
]],
{
i(1, "pass"),
}
)
),
})

View File

@@ -4,32 +4,10 @@ end
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local shared = require("solo.snips")
local same = shared.same
ls.add_snippets("rust", {
s(
@@ -38,13 +16,50 @@ ls.add_snippets("rust", {
[[
#[cfg(test)]
mod tests {{
{}
use super::*;
{}
}}
]],
{
c(1, { t(" use super::*;"), t("") }),
i(0),
i(1),
}
)
),
s(
"tmain",
fmt(
[[
#[tokio::main]
async fn main() -> Result<()> {{
Ok(())
}}
]],
{}
)
),
s("pd", fmt([[println!("{}: {{:?}}", {});]], { same(1), i(1) })),
s(
"dead",
fmt(
[[
#[allow(dead_code)]
]],
{}
)
),
s(
"some",
fmt(
[[
if let Some({}) = torrent.{}{{
torrent_fields.push({}.to_string());
}}
]],
{
same(1),
i(1),
same(1),
}
)
),

View File

@@ -205,7 +205,7 @@ local mappings = {
g = { vim.cmd.RustViewCrateGraph, "View Create [G]raph" },
d = { vim.cmd.RustOpenExternalDocs, "Open External [D]ocs" },
r = { vim.cmd.RustRunnables, "Open [R]unnables" },
ca = { vim.cmd.RustCodeAction, "[C]ode [A]ction Groups" },
a = { vim.cmd.RustCodeAction, "Code [A]ction Groups" },
},
L = {
name = "[L]anguage settings",