Remove old files

This commit is contained in:
Thomas Avé 2024-05-31 19:03:49 +02:00
parent 1c1c9befdd
commit fa8d665e9e
52 changed files with 72 additions and 3572 deletions

View File

@ -1,26 +0,0 @@
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-zircon-*,
-bugprone-easily-swappable-parameters
-readability-identifier-length
-readability-avoid-const-params-in-decls,
-readability-magic-numbers
-bugprone-narrowing-conversions
-modernize-use-trailing-return-type
-cppcoreguidelines-pro-type-union-access
-modernize-use-nodiscard
-cppcoreguidelines-narrowing-conversions
-cppcoreguidelines-avoid-magic-numbers
-Wsign-compare
-hicpp-uppercase-literal-suffix
-readability-uppercase-literal-suffix
-readability-named-parameter
-performance-avoid-endl"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none

View File

@ -1,17 +0,0 @@
require('settings')
require('mappings')
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(require("plugins.catppuccin"))
vim.opt.laststatus = 0

View File

@ -1,8 +0,0 @@
require('settings')
require('lazy_config')
require('mappings')
require('teaching')
vim.api.nvim_create_autocmd("FileType", { pattern = "make", command = [[set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab]] })
vim.api.nvim_create_autocmd("FileType", { pattern = "javascript", command = [[setlocal shiftwidth=2 softtabstop=2 expandtab]] })
vim.api.nvim_create_autocmd("FileType", { pattern = "vue", command = [[setlocal shiftwidth=2 softtabstop=2 expandtab]] })

View File

@ -1,46 +0,0 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"bufferline.nvim": { "branch": "main", "commit": "f4b4b980ce88d546aeb69d11463187c8f716a1a1" },
"catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-snippy": { "branch": "master", "commit": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3" },
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" },
"gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" },
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"neogit": { "branch": "master", "commit": "98e6e855266282a3dd32e642ea14209b8787882a" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
"nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" },
"nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
"nvim-snippy": { "branch": "master", "commit": "1184a8734e998649f3bb9a5db9efd4543282050b" },
"nvim-tree.lua": { "branch": "master", "commit": "59e65d88db177ad1e6a8cffaafd4738420ad20b6" },
"nvim-treesitter": { "branch": "master", "commit": "99d3e799b46f5c2a1fc0d7a42d7ab452de48c067" },
"nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" },
"obsidian.nvim": { "branch": "main", "commit": "754d3410b907b5f5ae3c9f4ccf643ea945021341" },
"oil.nvim": { "branch": "master", "commit": "bcfc0a2e01def5019aa14fac2fc6de20dedb6d3d" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" },
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
"telescope-undo.nvim": { "branch": "main", "commit": "95b61c01ea3a4c9e8747731148e905bbcf0ccaee" },
"telescope.nvim": { "branch": "master", "commit": "2d0d057791854decb2c9b6a0b52d43f3900dff40" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"tree-sitter-hyprlang": { "branch": "master", "commit": "e5da7d0aa44403153e0394d87d9edea4e5bd6609" },
"tree-sitter-typst": { "branch": "master", "commit": "823309ed8b872dd33c7f350a3bab3d6e51436a5a" },
"trim.nvim": { "branch": "master", "commit": "4fe47a46c02a58894ded8328ca81f6c214a892f5" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"vim-bracketed-paste": { "branch": "master", "commit": "ffa3bc10ab511a646f1b30bc9345f240c15394e9" },
"vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" },
"vim-hypr-nav": { "branch": "main", "commit": "6ab4865a7eb5aad35305298815a4563c9d48556a" },
"vim-rooter": { "branch": "master", "commit": "45e53f01e4e1c4a3ee20814de232162713aff578" },
"vim-snippets": { "branch": "master", "commit": "393d980157b8149b3ff65a48bc4aae24dca9c846" },
"vimtex": { "branch": "master", "commit": "a80934749c69cc6875b3c9b13ef59573a4824fb2" }
}

View File

@ -1,19 +0,0 @@
-- Install Lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
change_detection = {
enabled = false,
notify = false, -- get a notification when changes are found
}
})

View File

@ -1,68 +0,0 @@
local log = require("ltex_extra.src.log")
local M = {}
local default_opts = {
load_langs = { "es-AR", "en-US" },
init_check = true,
}
M.opts = {}
local ltex_languages = {
"en-GB",
"nl-BE",
"en-US",
"fr",
"auto",
}
local register_user_cmds = function()
vim.api.nvim_create_user_command("LtexSwitchLang", function()
vim.ui.select(ltex_languages, {
prompt = "Select language:",
}, function(choice)
require("ltex_extra.src.commands-lsp").switchLanguage(choice)
end)
end, { desc = "ltex_extra.nvim: Switch sever language" })
end
M.setup = function(opts)
log.trace("Merge options")
M.opts = opts or default_opts
for key, value in pairs(default_opts) do
if not M.opts[key] then
M.opts[key] = value
end
end
log.trace("Add commands to lsp")
register_user_cmds()
vim.lsp.commands['_ltex.addToDictionary'] = require("ltex_extra.src.commands-lsp").addToDictionary
vim.lsp.commands['_ltex.hideFalsePositives'] = require("ltex_extra.src.commands-lsp").hideFalsePositives
vim.lsp.commands['_ltex.disableRules'] = require("ltex_extra.src.commands-lsp").disableRules
log.trace("Inital load files")
if opts.init_check == true then
require("ltex_extra.src.commands-lsp").updateConfigFull(opts.load_langs)
end
end
return M
-- Dev notes:
--
-- Dummy functions for test vim.lsp.commands
-- local dummy_calls = 0
-- local dummy_cmd = function()
-- print(dummy_calls)
-- dummy_calls = dummy_calls + 1
-- print(dummy_calls)
-- end
-- Inspect function for arguments. Doesn't work after nvim 0.7.
-- local orig_execute_command = vim.lsp.buf.execute_command
-- vim.lsp.buf.execute_command = function (command)
-- print(vim.inspect(command))
-- orig_execute_command(command)
-- end

View File

@ -1,139 +0,0 @@
local log = require("ltex_extra.src.log")
local inspect = require("ltex_extra.src.utils").inspect
local writeFile = require("ltex_extra.src.utils").writeFile
local loadFile = require("ltex_extra.src.utils").readFile
local types = {
["dict"] = "dictionary",
["dRules"] = "disabledRules",
["hRules"] = "hiddenFalsePositives",
["language"] = "language"
}
local function catch_ltex()
log.trace("catch_ltex")
local buf_clients = vim.lsp.buf_get_clients()
local client = nil
for _, lsp in ipairs(buf_clients) do
if lsp.name == "ltex" then client = lsp end
end
return client
end
local function update_language(client, lang)
log.trace("update_language")
if not client.config.settings.ltex.language then
client.config.settings.ltex.language = {}
end
client.config.settings.ltex.language = lang
log.debug(vim.inspect(client.config.settings.ltex.language))
return client.notify("workspace/didChangeConfiguration", client.config.settings)
end
local function update_dictionary(client, lang)
log.trace("update_dictionary")
if not client.config.settings.ltex.dictionary then
client.config.settings.ltex.dictionary = {}
end
client.config.settings.ltex.dictionary[lang] = loadFile(types.dict, lang)
log.debug(inspect(client.config.settings.ltex.dictionary))
return client.notify('workspace/didChangeConfiguration', client.config.settings)
end
local function update_disabledRules(client, lang)
log.trace("update_disabledRules")
if not client.config.settings.ltex.disabledRules then
client.config.settings.ltex.disabledRules = {}
end
client.config.settings.ltex.disabledRules[lang] = loadFile(types.dRules, lang)
log.debug(inspect(client.config.settings.ltex.disabledRules))
return client.notify('workspace/didChangeConfiguration', client.config.settings)
end
local function update_hiddenFalsePositive(client, lang)
log.trace("update_hiddenFalsePositive")
if not client.config.settings.ltex.hiddenFalsePositives then
client.config.settings.ltex.hiddenFalsePositives = {}
end
client.config.settings.ltex.hiddenFalsePositives[lang] = loadFile(types.hRules, lang)
log.debug(inspect(client.config.settings.ltex.hiddenFalsePositives))
return client.notify('workspace/didChangeConfiguration', client.config.settings)
end
local M = {}
M.updateConfig = function(configtype, lang)
log.trace("updateConfig")
local client = catch_ltex()
if client then
if configtype == types.dict then
update_dictionary(client, lang)
elseif configtype == types.dRules then
update_disabledRules(client, lang)
elseif configtype == types.hRules then
update_hiddenFalsePositive(client, lang)
elseif configtype == types.language then
update_language(client, lang)
else
log.fmt_error("Config type unknown")
return vim.notify("Config type unknown")
end
else
log.fmt_error("Error catching ltex client")
return vim.notify("Error catching ltex client")
end
end
M.updateConfigFull = function(langs)
log.trace("updateConfigFull")
langs = langs or package.loaded.ltex_extra.opts.load_langs
for _, lang in pairs(langs) do
log.fmt_trace("Loading %s", lang)
M.updateConfig(types.dict, lang)
M.updateConfig(types.dRules, lang)
M.updateConfig(types.hRules, lang)
end
end
M.addToDictionary = function(command)
log.trace("addToDictionary")
local args = command.arguments[1].words
for lang, words in pairs(args) do
log.fmt_debug("Lang: %s Words: %s", inspect(lang), inspect(words))
writeFile(types.dict, lang, words)
M.updateConfig(types.dict, lang)
end
end
M.disableRules = function(command)
log.trace("disableRules")
local args = command.arguments[1].ruleIds
for lang, rules in pairs(args) do
log.fmt_debug("Lang: %s Rules: %s", inspect(lang), inspect(rules))
writeFile(types.dRules, lang, rules)
M.updateConfig(types.dRules, lang)
end
end
M.hideFalsePositives = function(command)
log.trace("hideFalsePositives")
local args = command.arguments[1].falsePositives
for lang, rules in pairs(args) do
log.fmt_debug("Lang: %s Rules: %s", inspect(lang), inspect(rules))
writeFile(types.hRules, lang, rules)
M.updateConfig(types.hRules, lang)
end
end
function M.switchLanguage(lang)
log.trace("language")
local client = catch_ltex()
if client then
M.updateConfig(types.language, lang)
else
return error("Error catching ltex client", 1)
end
end
return M

View File

@ -1,62 +0,0 @@
local debug = false
local log = {}
if debug then
log = require("plenary.log").new {
plugin = "ltex_extra",
use_file = false,
level = "trace"
}
else
local dummy = function (...) return true end
log.trace = dummy
log.debug = dummy
log.info = dummy
log.warn = dummy
log.error = dummy
log.fatal = dummy
log.fmt_trace = dummy
log.fmt_debug = dummy
log.fmt_info = dummy
log.fmt_warn = dummy
log.fmt_error = dummy
log.fmt_fatal = dummy
end
-- local default_config = {
-- -- Name of the plugin. Prepended to log messages
-- plugin = "plenary",
--
-- -- Should print the output to neovim while running
-- -- values: 'sync','async',false
-- use_console = "async",
--
-- -- Should highlighting be used in console (using echohl)
-- highlights = true,
--
-- -- Should write to a file
-- use_file = true,
--
-- -- Should write to the quickfix list
-- use_quickfix = false,
--
-- -- Any messages above this level will be logged.
-- level = p_debug and "debug" or "info",
--
-- -- Level configuration
-- modes = {
-- { name = "trace", hl = "Comment" },
-- { name = "debug", hl = "Comment" },
-- { name = "info", hl = "None" },
-- { name = "warn", hl = "WarningMsg" },
-- { name = "error", hl = "ErrorMsg" },
-- { name = "fatal", hl = "ErrorMsg" },
-- },
--
-- -- Can limit the number of decimals displayed for floats
-- float_precision = 0.01,
-- }
return log

View File

@ -1,54 +0,0 @@
local M = {}
-- PRIVATE FUNCTIONS
M.file_exists = function(filename)
local file = io.open(filename, "r")
if file ~= nil then io.close(file) return true else return false end
end
-- PUBLIC FUNCTIONS
M.writeFile = function(type, lang, lines)
local filename = vim.fn.getenv("HOME") .. "/.config/nvim/spell/" .. table.concat({ "ltex", type, lang, "txt" }, ".")
local file = io.open(filename, "a+")
io.output(file)
for _, line in ipairs(lines) do
io.write(line .. "\n")
end
io.close(file)
end
M.readFile = function(type, lang)
local filename = vim.fn.getenv("HOME") .. "/.config/nvim/spell/" .. table.concat({ "ltex", type, lang, "txt" }, ".")
local lines = {}
if M.file_exists(filename) then
local file = io.open(filename, "r")
io.input(file)
for line in io.lines(filename) do
lines[#lines + 1] = line
end
io.close(file)
end
return lines
end
M.loadFile = function(type, langs)
local content = {}
for _, lang in ipairs(langs) do
content[lang] = M.readFile(type, lang)
end
return content
end
M.inspect = function(args)
local inspect = nil
if vim then
inspect = vim.inspect
else
inspect = require("inspect") -- from luarocks
end
return inspect(args)
end
return M

View File

@ -1,41 +0,0 @@
local inspect = require("inspect")
local lnsep = "=========="
local function println(arg) print("\n" .. lnsep .. arg .. lnsep) end
local commands = require("test.commands")
local addToDictionary = require("src.commands-lsp").addToDictionary
local disableRules = require("src.commands-lsp").disableRules
local hideFalsePositives = require("src.commands-lsp").hideFalsePositives
local inspect = require("src.utils").inspect
local writeFile = require("src.utils").writeFile
local readFile = require("src.utils").readFile
local load_file = require("src.utils").load_file
local langs = {"es-AR", "en-US"}
-- Command Handler mockup.
local function execute_command(command)
println(command.command)
print("command = " .. inspect(command))
if command.command == '_ltex.addToDictionary' then
addToDictionary(commands.dictionary)
elseif command.command == '_ltex.disableRules' then
disableRules(commands.disableRules)
elseif command.command == '_ltex.hideFalsePositives' then
hideFalsePositives(commands.hideFalsePositives)
end
end
execute_command(commands.dictionary)
execute_command(commands.disableRules)
execute_command(commands.hideFalsePositives)
println("Reading file")
local dictionary = load_file("dictionary", langs)
local disabledRules = load_file("disabledRules", langs)
local hiddenFalsePositives = load_file("hiddenFalsePositives", langs)
print(inspect({dictionary, disabledRules, hiddenFalsePositives}))
-- local dictionary_example = {["es-AR"] = {"Errorr"}, ["en-US"] = {"Errorr"}}
-- print(M.inspect(dictionary_example))

View File

@ -1,38 +0,0 @@
-- Commands captured from LSP Code action.
local commands = {}
commands.dictionary = {
arguments = { {
uri = "file:///home/leonardo/.config/nvim/lua/test/latex/main.tex",
words = {
["en-US"] = { "Error", "Warning" },
}
} },
command = "_ltex.addToDictionary",
title = "Add 'Errorr' to dictionary"
}
commands.disableRules = {
arguments = { {
ruleIds = {
["en-US"] = { "MORFOLOGIK_RULE_ES", "INCORRECT_SPACES" }
},
uri = "file:///home/leonardo/develop/ltex-lua/readme.md"
} },
command = "_ltex.disableRules",
title = "Disable rule"
}
commands.hideFalsePositives = {
arguments = { {
falsePositives = {
["en-US"] = { '{"rule":"UPPERCASE_SENTENCE_START","sentence":"^\\\\Qerror with false positive.\\\\E$"}',
'{"rule":"UPPERCASE_SENTENCE_START","sentence":"^\\\\Qerror with false positive.\\\\E$"}' }
},
uri = "file:///home/leonardo/develop/ltex-lua/readme.md"
} },
command = "_ltex.hideFalsePositives",
title = "Hide false positive"
}
return commands

View File

@ -1,9 +0,0 @@
@online{ltex,
author = {Valentjn},
keywords = {ltex},
month = jun,
publisher = {Github},
title = {LTeX language server},
url = {https://valentjn.github.io/ltex/settings.html},
year = {2022}
}

View File

@ -1,10 +0,0 @@
---
lang: es-AR
---
This is a misspelling.
this sentences should beggining uppercase.
This rules is going to be disabled.
Esto es un errorr.
esta oración debe comenzar con mayúsculas.
Esta regla sera desactivada.

View File

@ -1,16 +0,0 @@
\documentclass{article}
% \usepackage[english]{babel}
\usepackage[spanish]{babel}
\begin{document}
This is a missspell.
this sentences should beggining uppercase.
This rules is going to be disabled.
Esto es un errorr.
esta oración debe comenzar con mayúsculas.
Esta regla sera desactivada.
\end{document}

View File

@ -1,42 +0,0 @@
vim.keymap.set("i", "jj", "<Esc>", {})
vim.keymap.set("n", "j", "gj", {})
vim.keymap.set("n", "k", "gk", {})
vim.keymap.set("n", "<S-k>", "<Nop>", {})
vim.keymap.set("t", "jj", "<C-\\><C-n>", { noremap = true, silent = true })
vim.keymap.set("n", "<Backspace>", ":q<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-Backspace>", ":q!<cr>", { noremap = true, silent = true })
vim.keymap.set("n", ",;", ":", { noremap = true, silent = true })
vim.keymap.set("n", "<C-U>", "<C-O>", { noremap = true })
vim.keymap.set("n", "<S-C-U>", "g;", { noremap = true })
vim.keymap.set("n", "<S-C-I>", "g,", { noremap = true })
vim.keymap.set("n", "<C-E>", "<C-U>zz", { noremap = true })
vim.keymap.set("n", "<C-D>", "<C-D>zz", { noremap = true })
vim.keymap.set("n", "<C-I>", "<C-I>", { noremap = true })
vim.keymap.set("n", "n", "nzz", { noremap = true })
vim.keymap.set("n", "N", "Nzz", { noremap = true })
vim.keymap.set("x", "<leader>p", [["_dP]], { noremap = true })
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
vim.keymap.set({"n", "v"}, "<leader>Y", [["+Y]])
vim.keymap.set("n", "<Tab>", "<Nop>", { noremap = true })
vim.keymap.set("n", "<leader><space>", ":noh<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "gn", ":n<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>d", function () require("trouble").toggle() end, { noremap = true, silent = true })
vim.keymap.set("n", "gi", ":ClangdSwitchSourceHeader<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>t", ":NvimTreeFindFileToggle<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "-", function () require("oil").open() end, { desc = "Open parent directory" })
vim.keymap.set("n", "<leader>-", function () require("oil").open() end, { desc = "Open parent directory" })
vim.keymap.set("n", "<leader>g", function () require("neogit").open({kind="replace"}) end, { noremap = true, silent = true })
vim.keymap.set("x", "<leader>a", "<C-A>", { noremap = true, silent = true })
vim.keymap.set("x", "<leader>x", "<C-X>", { noremap = true, silent = true })
vim.keymap.set("x", "<leader>ga", "g<C-A>", { noremap = true, silent = true })
vim.keymap.set("x", "<leader>ga", "g<C-A>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>s", ":sp<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>v", ":vs<cr>", { noremap = true, silent = true })
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- Backup in case hyprnav doesn't work
vim.keymap.set("n", "<C-h>", ":wincmd h<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-j>", ":wincmd j<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-k>", ":wincmd k<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-l>", ":wincmd l<CR>", { noremap = true, silent = true })

View File

@ -1,43 +0,0 @@
return {
"catppuccin/nvim",
name = "catppuccin",
opts = {
flavour = "mocha",
integrations = {
mason = true,
lsp_trouble = true,
},
custom_highlights = function(colors)
return {
TelescopeNormal = { bg = "#191926"},
TelescopeBorder = { bg = "#191926", fg = "#191926" },
TelescopePromptBorder = { bg = "#191926", fg = "#191926" },
TelescopeTitle = { fg = colors.blue },
WinSeparator = { fg = "#023269" },
FlashCursor = { bg = colors.red },
}
end,
color_overrides = {
mocha = {
-- this 16 colors are changed to onedark
base = "#11121D",
text = "#abb2bf",
rosewater = "#b6bdca",
lavender = "#ed8897",
red = "#e06c75",
peach = "#d19a66",
yellow = "#e5c07b",
green = "#98c379",
teal = "#56b6c2",
blue = "#61afef",
mauve = "#c678dd",
flamingo = "#be5046",
pink="#ef9f76"
}
}
},
config = function (_, opts)
require("catppuccin").setup(opts)
vim.cmd("colorscheme catppuccin")
end
}

View File

@ -1,22 +0,0 @@
return {
"David-Kunz/gen.nvim",
opts = {
model = "mistral", -- The default model to use.
host = "localhost", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening.
display_mode = "float", -- The display mode. Can be "float" or "split".
show_prompt = false, -- Shows the Prompt submitted to Ollama.
show_model = false, -- Displays which model you are using at the beginning of your chat session.
quit_map = "q", -- set keymap for quit
no_auto_close = false, -- Never closes the window automatically.
command = function(options)
return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
debug = false -- Prints errors and the command which is run.
}
}

View File

@ -1,17 +0,0 @@
return {
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
opts = {
suggestion = {
auto_trigger = true,
auto_refresh = true,
keymap = {
accept = "<leader><Tab>",
},
},
filetypes = {
markdown = true,
}
}
}

View File

@ -1,10 +0,0 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {
highlight = {backdrop=false},
modes = {char = {highlight = {backdrop = false}}, search = {enabled = false}},
prompt = {enabled = false}
},
keys = {{"s", mode = {"n","x","o"}, function() require("flash").jump() end}}
}

View File

@ -1,16 +0,0 @@
return {
'mhartington/formatter.nvim',
config = function ()
require("formatter").setup({
filetype = {
lua = {
require("formatter.filetypes.lua").stylua,
},
python = {
require("formatter.filetypes.python").black,
},
}
})
end
}

View File

@ -1,13 +0,0 @@
return {
'ConradIrwin/vim-bracketed-paste',
'airblade/vim-rooter',
'nuchs/vim-hypr-nav',
'isobit/vim-caddyfile',
'debugloop/telescope-undo.nvim',
{'windwp/nvim-autopairs', event = "InsertEnter", opts = {}},
{'NeogitOrg/neogit', dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "sindrets/diffview.nvim"}, config = true, lazy = true},
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'},
{'lervag/vimtex', ft='latex'},
{'numToStr/Comment.nvim', config = function () require('Comment').setup() end},
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" }, opts = {} }
}

View File

@ -1,30 +0,0 @@
local function getWords()
return tostring(vim.fn.wordcount().words) .. " Words"
end
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
opts = {
options = {
theme = 'nightfly',
globalstatus = true
},
sections = {
lualine_a = {'mode'},
lualine_b = {'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'filesize', getWords},
lualine_z = {'branch'},
},
inactive_sections = {
lualine_a = {'mode'},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {'filesize'},
lualine_z = {'branch'},
}
}
}

View File

@ -1,16 +0,0 @@
return {
'williamboman/mason-lspconfig.nvim',
dependencies = {
{'williamboman/mason.nvim', opts = {
ui = {
icons = {
package_installed = ""
}
}
}},
'neovim/nvim-lspconfig'
},
opts = {
ensure_installed = { "pyright", "texlab", "clangd", "bashls", "cmake", "jsonls", "tsserver", "vuels", "dockerls", "vimls", "html", "yamlls", "cssls", "lua_ls", "ltex", "gopls", "rust_analyzer", "jdtls", "emmet_ls", "ruff_lsp", "csharp_ls", "typst_lsp" },
}
}

View File

@ -1,26 +0,0 @@
return {
"AckslD/nvim-neoclip.lua",
dependencies = {
'nvim-telescope/telescope.nvim',
{'kkharji/sqlite.lua', module = 'sqlite'},
},
opts = {
continuous_sync = true,
enable_persistent_history = true,
keys = {
telescope = {
i = {
paste = "<cr>",
paste_behind = "<S-cr>",
},
n = {
paste = "<cr>",
paste_behind = "<S-cr>",
}
},
}
},
keys = {
{'<leader>c', '<cmd>Telescope neoclip<cr>'},
},
}

View File

@ -1,278 +0,0 @@
local function select_next(fallback)
if require("cmp").visible() then
if require'snippy'.can_expand_or_advance() then
require("cmp").select_next_item({ behavior = require("cmp").SelectBehavior.Select })
else
require("cmp").select_next_item({ behavior = require("cmp").SelectBehavior.Insert })
end
elseif require'snippy'.can_expand_or_advance() then
require'snippy'.expand_or_advance()
else
fallback()
end
end
local function select_previous(fallback)
if require("cmp").visible() then
if require'snippy'.can_expand_or_advance() then
require("cmp").select_prev_item({ behavior = require("cmp").SelectBehavior.Select })
else
require("cmp").select_prev_item({ behavior = require("cmp").SelectBehavior.Insert })
end
elseif require'snippy'.can_jump(-1) then
require'snippy'.previous()
else
fallback()
end
end
return {
"hrsh7th/nvim-cmp",
dependencies = {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'honza/vim-snippets',
'dcampos/cmp-snippy',
'neovim/nvim-lspconfig',
'williamboman/mason-lspconfig.nvim',
{'dcampos/nvim-snippy', opts = {
mappings = {
is = {
['<leader><Tab>'] = 'expand_or_advance',
['<leader><S-Tab>'] = 'previous',
},
},
}},
},
keys = {
{"<leader>n", vim.diagnostic.goto_next},
{"<leader>p", vim.diagnostic.goto_prev},
{"<leader>f", vim.lsp.buf.code_action},
{"gd", vim.lsp.buf.definition},
{"gr", vim.lsp.buf.references},
{"<space>", vim.lsp.buf.hover},
{"<leader>rn", vim.lsp.buf.rename},
},
lazy = false,
config = function ()
local cmp = require("cmp")
cmp.setup({
snippet = { expand = function(args) require('snippy').expand_snippet(args.body) end },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(select_next, { "i", "s" }),
["<C-J>"] = cmp.mapping(select_next, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(select_previous, { "i", "s" }),
["<C-K>"] = cmp.mapping(select_previous, { "i", "s" }),
}),
sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'path' }, { name = 'snippy' }, }, { { name = 'buffer' } })
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
local cmp_completion = require('nvim-autopairs.completion.cmp')
cmp.event:on('confirm_done',cmp_completion.on_confirm_done())
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig').pyright.setup {
capabilities = capabilities,
settings = {
python = {
analysis = {
typeCheckingMode = "off"
}
}
}
}
require('lspconfig').texlab.setup {
capabilities = capabilities
}
require('lspconfig').clangd.setup {
capabilities = capabilities,
-- root_dir = function()
-- return require('lspconfig').util.root_pattern({'.clang-format', 'build/', 'compile_flags.txt'})
-- end,
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"-j=8",
"--clang-tidy-checks=*",
"--all-scopes-completion",
"--completion-style=bundled",
"--cross-file-rename",
"--completion-style=detailed",
"--header-insertion-decorators",
"--header-insertion=iwyu",
"--pch-storage=memory"
}
}
require('lspconfig').bashls.setup {
capabilities = capabilities
}
require('lspconfig').csharp_ls.setup {
capabilities = capabilities
}
require('lspconfig').typst_lsp.setup {
capabilities = capabilities
}
require('lspconfig').cmake.setup {
capabilities = capabilities
}
require('lspconfig').jsonls.setup {
capabilities = capabilities
}
require('lspconfig').tsserver.setup {
capabilities = capabilities
}
require('lspconfig').kotlin_language_server.setup {
capabilities = capabilities
}
require('lspconfig').vuels.setup {
capabilities = capabilities
}
require('lspconfig').dockerls.setup {
capabilities = capabilities
}
require('lspconfig').vimls.setup {
capabilities = capabilities
}
require('lspconfig').html.setup {
capabilities = capabilities
}
require('lspconfig').emmet_ls.setup({
capabilities = capabilities,
filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
init_options = {
html = {
options = {
["bem.enabled"] = true,
},
},
}
})
require('lspconfig').yamlls.setup {
capabilities = capabilities
}
require('lspconfig').cssls.setup {
capabilities = capabilities
}
require('lspconfig').jdtls.setup {
capabilities = capabilities
}
require('lspconfig').rust_analyzer.setup {
capabilities = capabilities,
}
require('lspconfig').gopls.setup {
capabilities = capabilities
}
require('lspconfig').ruff_lsp.setup {
capabilities = capabilities
}
require('lspconfig').lua_ls.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim', 'use', 'awesome', 'client', 'root'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
['/usr/share/nvim/runtime/lua'] = true,
['/usr/share/nvim/runtime/lua/lsp'] = true,
['/usr/share/awesome/lib'] = true
}
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
local filetypes = { "bibtex", "gitcommit", "markdown", "org", "tex", "restructuredtext", "rsweave", "latex", "quarto", "rmd", "context", "html", "xhtml", "typst", "mail" }
require('lspconfig').ltex.setup {
capabilities = capabilities,
on_attach = function(_, _)
require("ltex_extra").setup{
load_langs = {"nl-BE", "en-US", "en-GB"},
init_check = true,
}
end,
settings = {
ltex = {
enabled = filetypes,
language = "en-GB"
},
},
filetypes = filetypes
}
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.cmd("autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})")
end,
}

View File

@ -1,27 +0,0 @@
return {
'nvim-tree/nvim-tree.lua',
dependencies = {'nvim-tree/nvim-web-devicons'},
tag = 'nightly',
opts = {
sort_by = "case_sensitive",
sync_root_with_cwd = true,
update_focused_file = {
update_root = true,
},
view = {
adaptive_size = true,
mappings = {
list = {
{key = "cd", action = "cd"},
{key = "<backspace>", action = "close"},
}
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
}
}

View File

@ -1,72 +0,0 @@
local function handle_enter()
local util = require("obsidian.util")
if util.cursor_on_markdown_link(nil, nil, true) then
vim.cmd("ObsidianFollowLink")
else
local line = vim.api.nvim_get_current_line()
if string.match(line, "^%s*- %[[x ]%].*") then
util.toggle_checkbox()
else
vim.cmd("normal! viw:'<,'>ObsidianLink")
end
end
end
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = false,
dependencies = { "nvim-lua/plenary.nvim" },
config = function(_, opts)
local notes_path = (os.getenv "HOME") .. "/Workspace/Notes"
if vim.fn.isdirectory(notes_path) == 0 then
return
end
local scan = require("plenary.scandir").scan_dir(notes_path, {add_dirs = true, depth = 1 })
local found = false
for _, v in ipairs(scan) do
local subdir = v:match("([^/]+)$")
found = true
if vim.fn.isdirectory(notes_path .. "/" .. subdir .. "/.obsidian") == 1 then
table.insert(opts.workspaces, {
name = subdir,
path = notes_path .. "/" .. subdir,
overrides = {
daily_notes = {
folder = "Daily",
},
},
})
end
end
if found then
require("obsidian").setup(opts)
end
end,
opts = {
workspaces = {},
note_id_func = function(title) return title end,
daily_notes = {
folder = "."
},
disable_frontmatter = true,
ui = {
hl_groups = {
ObsidianRefText = { fg = "#61afef" },
}
}
},
keys = {
{"<cr>", handle_enter, ft = "markdown" },
{"<cr>", "<cmd>ObsidianLink<cr>", ft = "markdown", mode = "v"},
{"<leader>rn", "<cmd>ObsidianRename<cr>", ft = "markdown" },
{"<leader>l", "i- [ ] ", ft = "markdown"},
{"<leader>o", "o- [ ] ", ft = "markdown"},
{"<leader>l", "- [ ] ", ft = "markdown", mode = "i" },
{"<leader>jt", "<cmd>ObsidianToday<cr>"},
{"<leader>jy", "<cmd>ObsidianYesterday<cr>"},
{"<leader>ju", "<cmd>ObsidianTomorrow<cr>"},
{"<tab>", ":set nohlsearch<cr>/\\[[^\\[\\]]*\\]([^()]*)<cr>:let @/ = \"\"<cr>:set hlsearch<cr>", ft = "markdown", silent = true },
},
}

View File

@ -1,33 +0,0 @@
local function save_dir()
local dir = require("oil").get_current_dir()
if dir ~= nil then
local f = io.open("/tmp/oil_dir", "w")
if f then
f:write(dir)
f:close()
end
end
end
return {
'stevearc/oil.nvim',
dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true,
opts = {
default_file_explorer = true,
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = function() require("oil").select({}, save_dir) end,
["<leader>v"] = "actions.select_vsplit",
["<leader>s"] = "actions.select_split",
["<leader>p"] = "actions.preview",
["<backspace>"] = function() vim.cmd("q!") end,
["<leader>r"] = "actions.refresh",
["-"] = function() require("oil").open(); save_dir() end,
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["g."] = "actions.toggle_hidden",
},
use_default_keymaps = false,
}
}

View File

@ -1,88 +0,0 @@
return {
'nvim-telescope/telescope.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope-fzy-native.nvim',
},
opts = {
defaults = {
file_ignore_patterns = {
".cache/.*",
"node_modules/.*",
".git/.*",
"Venv/.*",
"venv/.*",
"wandb/.*",
"Resources/.*",
"build/.*"
},
mappings = {
i = {
["jj"] = require("telescope.actions").close,
["<C-j>"] = require("telescope.actions").move_selection_next,
["<C-k>"] = require("telescope.actions").move_selection_previous,
},
},
file_sorter = require'telescope.sorters'.get_fzy_sorter,
generic_sorter = require'telescope.sorters'.get_fzy_sorter,
},
extensions = {
undo = {
side_by_side = false,
layout_strategy = "vertical",
use_delta = true,
layout_config = {
preview_height = 0.5,
},
mappings = {
i = {
["<cr>"] = require("telescope-undo.actions").restore,
["<S-y>"] = require("telescope-undo.actions").yank_additions,
},
},
}
},
fzy_native = {
override_generic_sorter = false,
override_file_sorter = true,
}
},
keys = {
{ "<leader>u", require("telescope").extensions.undo.undo},
{ "<C-Space>", require("telescope.builtin").oldfiles},
{ "<C-f>", function () require"telescope.builtin".live_grep({ path_display = { 'smart' }, }) end},
{ "<C-p>", function () -- git files
local opts = require('telescope.themes').get_ivy({})
opts["show_untracked"] = true
opts["layout_config"] = {height=0.2}
if not pcall(require"telescope.builtin".git_files, opts) then
require"telescope.builtin".find_files(opts)
end
end},
{ "<C-o>", function () -- project files
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
require"telescope.builtin".find_files(opts)
end},
{ "<C-S-o>", function () -- buffer files
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
require"telescope.builtin".buffers(opts)
end},
{ "<C-S-f>", function () -- fuzzy search
require"telescope.builtin".grep_string({
path_display = { 'smart' },
only_sort_text = true,
word_match = "-w",
search = '',
})
end},
},
config = function (_, opts)
local telescope = require("telescope")
telescope.setup(opts)
telescope.load_extension("undo")
telescope.load_extension('fzy_native')
end
}

View File

@ -1,44 +0,0 @@
return {
'nvim-treesitter/nvim-treesitter',
dependencies = {
"https://github.com/TheZoq2/tree-sitter-typst",
"luckasRanarison/tree-sitter-hyprlang"
},
build = ":TSUpdate",
opts = {
ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline", "nix" },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
disable = function(lang, buf) -- Disable if file size is too big
if lang == "ini" or lang == "markdown" then
return true
end
local max_filesize = 2000 * 1024 -- 2MB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
indent = {
enable = true
},
},
config = function (_, opts)
require("nvim-treesitter.configs").setup(opts)
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
require'nvim-treesitter.install'.prefer_git = true
parser_config.typst = {
install_info = {
url = "https://github.com/frozolotl/tree-sitter-typst.git", -- local path or git repo
files = {"src/parser.c", "src/scanner.cc"},
},
filetype = "typst", -- if filetype does not match the parser name
}
vim.filetype.add({
pattern = { [".*.typ"] = "typst" },
})
end
}

View File

@ -1,4 +0,0 @@
return {
'cappyzawa/trim.nvim',
opts = { ft_blocklist= {"markdown", "vimwiki"}, patterns = { [[%s/\s\+$//e]], [[%s/\($\n\s*\)\+\%$//]], [[%s/\%^\n\+//]], },}
}

View File

@ -1,12 +0,0 @@
return {
'folke/trouble.nvim',
dependencies = {"nvim-tree/nvim-web-devicons"},
opts = {
action_keys = {
close = {"q", "<Esc>"},
jump = {"<cr>"},
toggle_fold = {"<tab>"},
}
},
lazy = true
}

View File

@ -1,47 +0,0 @@
vim.opt.autoindent = true
vim.opt.background = "dark"
vim.opt.backspace = {"indent", "eol", "start"}
vim.opt.encoding = "utf-8"
vim.opt.expandtab = true
vim.opt.hidden = true
vim.opt.hlsearch = true
vim.opt.ignorecase = true
vim.opt.incsearch = true
vim.opt.laststatus = 2
vim.opt.lbr = true
vim.opt.modelines = 0
vim.opt.mouse = "a"
vim.opt.compatible = false
vim.opt.modeline = false
vim.opt.number = true
vim.opt.numberwidth = 4
vim.opt.scrolloff = 5
vim.opt.shiftwidth = 4
vim.opt.sidescrolloff = 10
vim.opt.smartcase = true
vim.opt.softtabstop = 4
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.tabstop = 4
vim.opt.ttimeoutlen = 50
vim.opt.undofile = true
vim.opt.undolevels = 1000
vim.opt.undoreload = 10000
vim.opt.wildmenu = true
vim.opt.termguicolors = true
vim.opt.wildmode = {"longest", "list"}
vim.g.mapleader = ","
vim.g.python_highlight_all = 1
vim.wo.signcolumn = "yes"
vim.wo.relativenumber = true
vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/", "meson.build"}
vim.g.rooter_silent_chdir = 1
vim.opt.shada = "!,'2000,f1,<50,s10,h"
vim.o.updatetime = 250
vim.opt.conceallevel = 2
vim.opt.foldmethod = "expr"
vim.opt.foldlevel = 0
vim.opt.foldexpr = "getline(v:lnum)=~'^X-ExtEditorR'?1:0"
-- Vimtex
vim.g.tex_flavor = 'latex'

View File

@ -1,55 +0,0 @@
local teaching = {}
local function ends_with(path, extension)
return string.sub(path, -#extension) == extension
end
local function should_load(path)
local ignore = {
[1] = "rapidjson",
[2] = "json.hpp",
[3] = "build",
[4] = "third-party",
[5] = "sfml/",
[5] = "SFML/",
[6] = "TinyXML"
}
local match = {
[1] = ".hpp",
[2] = ".h",
[3] = ".cpp",
[4] = ".c",
}
for _, pattern in ipairs(ignore) do
if string.find(path, pattern, 0, true) then
return false
end
end
for _, pattern in ipairs(match) do
if ends_with(path, pattern) then
return true
end
end
return false
end
function teaching.load()
require("trouble").open()
require("nvim-tree").open()
local scan = require("plenary.scandir").scan_dir('.')
local cwd = vim.fn.getcwd()
for _, v in ipairs(scan) do
local filename = vim.fs.normalize(v)
if should_load(v) then
vim.api.nvim_set_current_dir(cwd)
local buf_id = vim.fn.bufadd(filename)
vim.api.nvim_set_current_buf(buf_id)
vim.api.nvim_buf_set_option(buf_id, "buflisted", true)
end
end
vim.api.nvim_set_current_dir(cwd)
end
vim.api.nvim_create_user_command("AP", teaching.load, {})
return teaching

View File

@ -1 +0,0 @@
std="lua51+vim"

View File

@ -1,7 +0,0 @@
snippet frontmatter
---
id: ${1:id}
aliases:
- ${2:alias}
tags: [${3:tag1}]
---

View File

@ -1,9 +0,0 @@
logits
OpenSwarm
Lumentis
stochasticity
Feywild
closeby
ECML
theshold-based
distill

View File

@ -1,2 +0,0 @@
scaler
stochasticity

View File

@ -1,2 +0,0 @@
[vim]
any = true

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
# Load and configure smartcd
source ~/.smartcd/lib/core/arrays
source ~/.smartcd/lib/core/varstash
source ~/.smartcd/lib/core/smartcd
smartcd setup chpwd-hook
# smartcd setup cd
# smartcd setup pushd
# smartcd setup popd
# smartcd setup prompt-hook
smartcd setup exit-hook
smartcd setup completion
# VARSTASH_AUTOCONFIGURE=1
# VARSTASH_AUTOEDIT=1
# SMARTCD_NO_INODE=1
# SMARTCD_AUTOMIGRATE=1
# SMARTCD_LEGACY=1
# SMARTCD_QUIET=1
# VARSTASH_QUIET=1

View File

@ -1,3 +0,0 @@
if [ -d "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi

View File

@ -1,321 +0,0 @@
source ~/.profile
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Home Manager
if [ -f "$XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh" ]; then
source $XDG_STATE_HOME/nix/profile/etc/profile.d/hm-session-vars.sh
fi
# Use LS colors for ZSH completion
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu select
# Use cd without cd
setopt autocd
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -g -A key
# We need this here since it's used below
if command -v fdfind &> /dev/null; then
alias fd="fdfind"
fi
# Use vi-mode
source ${XDG_CONFIG_HOME}/zsh/zsh-vi-mode/zsh-vi-mode.plugin.zsh
ZVM_VI_INSERT_ESCAPE_BINDKEY=jj
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx }
function zle_application_mode_stop { echoti rmkx }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
function cd_to() {
setopt localoptions pipefail no_aliases 2> /dev/null
local dir=$1
if [[ -z "$dir" ]]; then
zle redisplay
return 0
fi
zle push-line # Clear buffer. Auto-restored on next prompt.
cd $dir
zle accept-line
local ret=$?
unset dir # ensure this doesn't end up appearing in prompt expansion
zle reset-prompt
}
function find_local() {
fd . -t $1 | fzy -l 20
}
function find_global() {
file_type=$1
FZY_CACHE=~/.cache/fzy_paths_$file_type
if [ -f $FZY_CACHE ]; then
if [ $(stat -c %Y $FZY_CACHE) -lt $(date +%s -d '-1 day') ]; then
rm $FZY_CACHE
fi
fi
if [ ! -f $FZY_CACHE ]; then
PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files)"
if [ "$file_type" = "d" ]; then
PATHS="$(echo -e $PATHS | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})"
else
PATHS="$(echo -e $PATHS | parallel echo ~/{})"
fi
search_dirs=(~/Workspace/ ~/Containers/ /home/server/Storage/Thomas/)
for i in "$search_dirs[@]"; do
if [ -d $i ]; then
PATHS="$PATHS\n$i"
PATHS+="\n$(fd . $i -t $file_type -d 8)"
fi
done
echo -e "$PATHS" > $FZY_CACHE
fi
file="$(cat $FZY_CACHE | fzy -l 20)"
echo "$file" | cat - $FZY_CACHE | awk '!x[$0]++' > /tmp/fzy_paths_$file_type && mv /tmp/fzy_paths_$file_type $FZY_CACHE
echo "$file"
}
function open_path() {
file_type=$1
search_fn=$2
selection="$($search_fn $file_type)"
if [ "$selection" = "" ]; then
zle reset-prompt
return
fi
if [ "$LBUFFER" = "" ]; then
if [ "$file_type" = "d" ]; then
cd_to "$selection"
else
selection=$(realpath "$selection")
cd_to "$(dirname \"$selection\")"
nvim "$selection"
fi
else
emulate -L zsh
zle -I
LBUFFER="${LBUFFER}\"$selection\""
zle reset-prompt
fi
}
function zvm_after_init() {
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search
if [ -f "/usr/share/doc/pkgfile/command-not-found.zsh" ]; then
source /usr/share/doc/pkgfile/command-not-found.zsh
fi
#FZF
if [ -f "/usr/share/doc/fzf/examples/key-bindings.zsh" ]; then
source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh
elif [ -f "/usr/share/fzf/key-bindings.zsh" ]; then
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
fi
if [ -f "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ]; then
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
function open_global_path_d() { open_path d find_global }
function open_global_path_f() { open_path f find_global }
function open_local() { open_path f find_local }
zle -N push_local_files
zle -N find_local_directories
function register_key() {
zle -N $2
bindkey "^$1" $2
bindkey -M emacs "^$1" $2
bindkey -M vicmd "^$1" $2
bindkey -M viins "^$1" $2
}
register_key "T" open_global_path_d
register_key "E" open_global_path_f
register_key "W" open_local
if [ "$SSH_SESSION_ID" != "" ]; then
mkdir -p /tmp/ssh_sessions
echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID"
fi
if [ "$REMOTE_PATH" != "" ]; then
if [ -d "$REMOTE_PATH" ]; then
cd "$REMOTE_PATH"
fi
elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
fi
}
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':completion:*' rehash true
autoload -Uz compinit
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
export HISTFILE="$XDG_STATE_HOME"/zsh/history
export HISTSIZE=10000000
export SAVEHIST=10000000
source $XDG_CONFIG_HOME/zsh/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
unsetopt share_history
BROWSER=/usr/bin/firefox
# Add bash aliases.
if [ -f ~/.bash_aliases ]; then
source ~/.bash_aliases
fi
# GPULab
export GPULAB_CERT="$XDG_DATA_HOME/gpulab.pem"
export GPULAB_DEV='False'
# Smartcd
export SMARTCD_QUIET=1
if [ -f ~/.smartcd_config ]; then
source ~/.smartcd_config
fi
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
export EDITOR=nvim
export LANG=en_US.UTF-8
export ARCHFLAGS="-arch x86_64"
export SSH_KEY_PATH="~/.ssh/rsa_id"
export PYTHONDONTWRITEBYTECODE=1
export TERM="screen-256color"
export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH
export GOPATH=/tmp/go
if command -v micromamba &> /dev/null; then
eval "$(micromamba shell hook --shell zsh)"
export MAMBA_ROOT_PREFIX="$HOME/.micromamba";
fi
autoload -Uz add-zsh-hook
eval "$(zoxide init zsh --cmd j)"
function xterm_title_precmd () {
print -Pn -- '\e]2;%n@%m %~\a'
}
function xterm_title_preexec () {
print -Pn -- '\e]2;' && print -n -- "${(q)1}\a"
}
if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
add-zsh-hook -Uz preexec xterm_title_preexec
fi
###########################################
# Aliases
###########################################
if [[ "$(hostname)" == "mallorea" ]]; then
alias lf="/usr/bin/lf -last-dir-path /tmp/lf_dir && cd \"\$(cat /tmp/lf_dir 2> /dev/null || pwd)\""
else
alias lf="cd \"\$(/usr/bin/lf -print-last-dir)\""
fi
function o () {
xdg-open "$1" &!
}
function run_waypipe() {
SSH_SESSION_ID=$RANDOM
REMOTE_PATH=$(echo $(pwd) | sed "s|/home/[a-z]*|\$HOME|g")
SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t $1 env REMOTE_PATH=\"$REMOTE_PATH\" SSH_SESSION_ID=$SSH_SESSION_ID "zsh --login"
}
function git() {
if [ "$HOME" = "$(pwd)" ]; then
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
else
/usr/bin/git "$@"
fi
}
alias mallorea="run_waypipe mallorea"
alias vault="run_waypipe vault"
alias riva="run_waypipe riva"
alias kell="run_waypipe kell"
alias aloria="run_waypipe aloria"
alias ls="ls --color=auto"
alias gdb='gdb -q'
alias ll='ls -lhat'
alias compress="tar --use-compress-program=lbzip2 -cvf"
alias vim="nvim"
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"'
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias python=python3
alias v="nvim -c ':lua require(\"oil\").open()' && cd \"\$(cat /tmp/oil_dir 2> /dev/null || pwd)\""
alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1"
alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files"
alias rg="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"
alias ag="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"
alias push="git add -A && git commit -m '`date`' && git push"
alias reset="tput reset"

@ -1 +0,0 @@
Subproject commit bcef7cafdf3005a3d59335df618f89474ef4dd8b

@ -1 +0,0 @@
Subproject commit 196810035992abea65e54852c4278af2069ee482

@ -1 +0,0 @@
Subproject commit 7cf6fd19cf2ab38ec5b116eced158377cb3c35f6

View File

@ -1 +0,0 @@
text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput

View File

@ -1,21 +0,0 @@
XDG_RUNTIME_DIR=/run/user/1000
XDG_CONFIG_HOME=$HOME/.config
XDG_CACHE_HOME=$HOME/.cache
XDG_DATA_HOME=$HOME/.local/share
XDG_STATE_HOME=$HOME/.local/state
export XDG_RUNTIME_DIR XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_STATE_HOME
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
export LESSHISTFILE="$XDG_CACHE_HOME"/less/history
export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel
export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc"
export SQLITE_HISTORY="$XDG_CACHE_HOME"/sqlite_history
export WINEPREFIX="$XDG_DATA_HOME"/wine
export ZDOTDIR="$XDG_CONFIG_HOME"/zsh
export XDG_CURRENT_DESKTOP=GNOME
export OPENCV_LOG_LEVEL=ERROR
export PATH="$HOME/.local/bin:$PATH"
export COLORTERM=truecolor
export NIX_PATH=$XDG_STATE_HOME/nix/defexpr/channels

1
.zshrc
View File

@ -1 +0,0 @@
.config/zsh/.zshrc

View File

@ -4,6 +4,7 @@
imports = [
(import ./modules/zsh/config.nix {inherit config pkgs;})
(import ./modules/nvim/config.nix {inherit config pkgs;})
(import ./modules/notmuch/config.nix {inherit config pkgs;})
];
home.stateVersion = "24.11";
@ -12,8 +13,13 @@
home.packages = with pkgs; [
htop
mailcap
];
home.file = {
".mailcap".text = "text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput";
};
programs.bash.enable = true;
programs.home-manager.enable = true;
programs.git = {
@ -25,4 +31,22 @@
a = "add";
};
};
home.sessionVariables = {
XDG_CONFIG_HOME = "${config.xdg.configHome}";
XDG_CACHE_HOME = "${config.xdg.cacheHome}";
XDG_DATA_HOME = "${config.xdg.dataHome}";
XDG_STATE_HOME = "${config.xdg.stateHome}";
CUDA_CACHE_PATH = "${config.xdg.cacheHome}/nv";
DOCKER_CONFIG = "${config.xdg.configHome}/docker";
LESSHISTFILE = "${config.xdg.cacheHome}/less/history";
PARALLEL_HOME = "${config.xdg.configHome}/parallel";
PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc";
SQLITE_HISTORY = "${config.xdg.cacheHome}/sqlite_history";
WINEPREFIX = "${config.xdg.dataHome}/wine";
XDG_CURRENT_DESKTOP = "GNOME";
OPENCV_LOG_LEVEL = "ERROR";
COLORTERM = "truecolor";
};
}

View File

@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
programs.notmuch = {
enable = true;
extraConfig = ''
[database]
path=/home/user/.config/aerc/mail
[user]
name=Thomas Avé
primary_email=email@thomasave.be
other_email=Thomas.Ave@uantwerpen.be;Thomas.Ave@imec.be;
[maildir]
synchronize_flags=true
'';
};
}

View File

@ -20,6 +20,35 @@
recursive = true;
};
home.file.".clang-tidy".text = ''
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-zircon-*,
-bugprone-easily-swappable-parameters
-readability-identifier-length
-readability-avoid-const-params-in-decls,
-readability-magic-numbers
-bugprone-narrowing-conversions
-modernize-use-trailing-return-type
-cppcoreguidelines-pro-type-union-access
-modernize-use-nodiscard
-cppcoreguidelines-narrowing-conversions
-cppcoreguidelines-avoid-magic-numbers
-Wsign-compare
-hicpp-uppercase-literal-suffix
-readability-uppercase-literal-suffix
-readability-named-parameter
-performance-avoid-endl"
WarningsAsErrors: '''
HeaderFilterRegex: '''
FormatStyle: none
'';
programs.neovim = {
enable = true;
viAlias = true;