diff --git a/clang/.clang-tidy b/clang/.clang-tidy index 0299936..e758d62 100644 --- a/clang/.clang-tidy +++ b/clang/.clang-tidy @@ -18,7 +18,9 @@ Checks: "*, -cppcoreguidelines-avoid-magic-numbers -Wsign-compare -hicpp-uppercase-literal-suffix - -readability-uppercase-literal-suffix" + -readability-uppercase-literal-suffix + -readability-named-parameter + -performance-avoid-endl" WarningsAsErrors: '' HeaderFilterRegex: '' FormatStyle: none diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 779de37..767dcda 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -25,6 +25,7 @@ "nvim-tree.lua": { "branch": "master", "commit": "59e65d88db177ad1e6a8cffaafd4738420ad20b6" }, "nvim-treesitter": { "branch": "master", "commit": "07c8c3d84f67b1530f636dcad31971f569a3df5f" }, "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, + "obsidian.nvim": { "branch": "main", "commit": "e2d6ce7b07941b0788177e1297699ad99c1470dc" }, "oil.nvim": { "branch": "master", "commit": "dd432e76d01eda08b8658415588d011009478469" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, diff --git a/nvim/lua/plugins/obsidian.lua b/nvim/lua/plugins/obsidian.lua new file mode 100644 index 0000000..d9d009e --- /dev/null +++ b/nvim/lua/plugins/obsidian.lua @@ -0,0 +1,37 @@ +local function open_link() + local util = require("obsidian.util") + if util.cursor_on_markdown_link(nil, nil, true) then + vim.cmd("ObsidianFollowLink") + else + util.toggle_checkbox() + end +end + +return { + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + ft = "markdown", + -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: + -- event = { + -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. + -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md" + -- "BufReadPre path/to/my-vault/**.md", + -- "BufNewFile path/to/my-vault/**.md", + -- }, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + workspaces = { + { + name = "Lumentis", + path = "~/Workspace/DnD/Lumentis Campaign Setting/", + }, + }, + disable_frontmatter = true, + }, + keys = { + {"", open_link, ft = "markdown" }, + {"gd", open_link, ft = "markdown" }, + {"rn", ":ObsidianRename"}, + }, + detect_cwd = true, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 44dd3a3..2b7a483 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -3,7 +3,7 @@ return { dependencies = {'luckasRanarison/tree-sitter-hypr'}, build = ":TSUpdate", opts = { - ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml" }, + ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline" }, auto_install = true, highlight = { enable = true, diff --git a/nvim/lua/plugins/vimwiki.lua b/nvim/lua/plugins/vimwiki.lua index 1f3214a..2f97edc 100644 --- a/nvim/lua/plugins/vimwiki.lua +++ b/nvim/lua/plugins/vimwiki.lua @@ -1,69 +1,70 @@ -local pickers = require("telescope.pickers") -local actions = require "telescope.actions" -local action_state = require("telescope.actions.state") -local finders = require("telescope.finders") -local conf = require("telescope.config").values - -local root_path = '/home/user/Workspace/DnD/Lumentis Campaign Setting' - -local function get_title(file) - for line in io.lines(file) do - line = string.gsub(line, "#", "") - line = string.gsub(line, "^%s*", "") - line = string.gsub(line, "%s*$", "") - return line - end -end - -local function choose_link(opts, titles, links) - opts = opts or {} - pickers.new(opts, { - prompt_title = "Choose a file", - finder = finders.new_table { - results = titles - }, - sorter = conf.generic_sorter(opts), - attach_mappings = function(prompt_bufnr, _) - actions.select_default:replace(function() - actions.close(prompt_bufnr) - local selection = action_state.get_selected_entry() - vim.api.nvim_put({ links[selection['index']] }, "", false, true) - end) - return true - end, - }):find() -end - -local function insert_link() - local scan = require("plenary.scandir").scan_dir(root_path) - local titles = {} - local links = {} - for _, v in ipairs(scan) do - if v:match("^.+(%..+)$") == ".md" then - local absolute_filename = string.sub(v, root_path:len()+1, v:len()) - local title = get_title(v) - if title:len() > 0 then - local link = "[" .. title .. "](" .. absolute_filename .. ")" - table.insert(titles, title) - table.insert(links, link) - end - end - end - choose_link(require("telescope.themes").get_dropdown{}, titles, links) -end - -return { - 'vimwiki/vimwiki', - dependencies = {'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim'}, - init = function () - vim.g.vimwiki_list = {{path = '~/Workspace/DnD/Lumentis Campaign Setting/', syntax = 'markdown', ext = '.md'}} - vim.g.vimwiki_key_mappings = { table_mappings = 0 } - vim.g.vimwiki_markdown_link_ext = 1 - vim.g.vimwiki_global_ext = 0 - end, - lazy = false, - keys = { - {"l", insert_link}, - {"l", insert_link, mode="i"} - } -} +return {} +-- local pickers = require("telescope.pickers") +-- local actions = require "telescope.actions" +-- local action_state = require("telescope.actions.state") +-- local finders = require("telescope.finders") +-- local conf = require("telescope.config").values +-- +-- local root_path = '/home/user/Workspace/DnD/Lumentis Campaign Setting' +-- +-- local function get_title(file) +-- for line in io.lines(file) do +-- line = string.gsub(line, "#", "") +-- line = string.gsub(line, "^%s*", "") +-- line = string.gsub(line, "%s*$", "") +-- return line +-- end +-- end +-- +-- local function choose_link(opts, titles, links) +-- opts = opts or {} +-- pickers.new(opts, { +-- prompt_title = "Choose a file", +-- finder = finders.new_table { +-- results = titles +-- }, +-- sorter = conf.generic_sorter(opts), +-- attach_mappings = function(prompt_bufnr, _) +-- actions.select_default:replace(function() +-- actions.close(prompt_bufnr) +-- local selection = action_state.get_selected_entry() +-- vim.api.nvim_put({ links[selection['index']] }, "", false, true) +-- end) +-- return true +-- end, +-- }):find() +-- end +-- +-- local function insert_link() +-- local scan = require("plenary.scandir").scan_dir(root_path) +-- local titles = {} +-- local links = {} +-- for _, v in ipairs(scan) do +-- if v:match("^.+(%..+)$") == ".md" then +-- local absolute_filename = string.sub(v, root_path:len()+1, v:len()) +-- local title = get_title(v) +-- if title:len() > 0 then +-- local link = "[" .. title .. "](" .. absolute_filename .. ")" +-- table.insert(titles, title) +-- table.insert(links, link) +-- end +-- end +-- end +-- choose_link(require("telescope.themes").get_dropdown{}, titles, links) +-- end +-- +-- return { +-- 'vimwiki/vimwiki', +-- dependencies = {'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim'}, +-- init = function () +-- vim.g.vimwiki_list = {{path = '~/Workspace/DnD/Lumentis Campaign Setting/', syntax = 'markdown', ext = '.md'}} +-- vim.g.vimwiki_key_mappings = { table_mappings = 0 } +-- vim.g.vimwiki_markdown_link_ext = 1 +-- vim.g.vimwiki_global_ext = 0 +-- end, +-- lazy = false, +-- keys = { +-- {"l", insert_link}, +-- {"l", insert_link, mode="i"} +-- } +-- } diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 11c37f9..849100d 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -38,6 +38,7 @@ vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/", "meson. vim.g.rooter_silent_chdir = 1 vim.opt.shada = "!,'2000,f1,<50,s10,h" vim.o.updatetime = 250 +vim.opt.conceallevel = 1 -- Vimtex vim.g.tex_flavor = 'latex'