mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 00:03:16 +00:00 
			
		
		
		
	replace vimwiki with mkdnflow
This commit is contained in:
		@@ -1,8 +1,5 @@
 | 
			
		||||
{ config, pkgs, lib, ... }: {
 | 
			
		||||
 | 
			
		||||
  # Required to place identity file on machine
 | 
			
		||||
  imports = [ ../shell/age.nix ];
 | 
			
		||||
 | 
			
		||||
  options = {
 | 
			
		||||
    mailUser = lib.mkOption {
 | 
			
		||||
      type = lib.types.str;
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,37 @@ M.packer = function(use)
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    -- Markdown renderer / wiki notes
 | 
			
		||||
    use("vimwiki/vimwiki")
 | 
			
		||||
    -- use("vimwiki/vimwiki")
 | 
			
		||||
    use({
 | 
			
		||||
        "jakewvincent/mkdnflow.nvim",
 | 
			
		||||
        config = function()
 | 
			
		||||
            require("mkdnflow").setup({
 | 
			
		||||
                modules = {
 | 
			
		||||
                    bib = false,
 | 
			
		||||
                    conceal = true,
 | 
			
		||||
                    folds = false,
 | 
			
		||||
                },
 | 
			
		||||
                perspective = {
 | 
			
		||||
                    priority = "current",
 | 
			
		||||
                    fallback = "first",
 | 
			
		||||
                    nvim_wd_heel = false, -- Don't change working dir
 | 
			
		||||
                },
 | 
			
		||||
                links = {
 | 
			
		||||
                    style = "markdown",
 | 
			
		||||
                    conceal = true,
 | 
			
		||||
                },
 | 
			
		||||
                wrap = true,
 | 
			
		||||
                to_do = {
 | 
			
		||||
                    symbols = { " ", "-", "x" },
 | 
			
		||||
                },
 | 
			
		||||
            })
 | 
			
		||||
            -- Save when moving to new buffer
 | 
			
		||||
            vim.api.nvim_create_autocmd("FileType", {
 | 
			
		||||
                pattern = "markdown",
 | 
			
		||||
                command = "set autowriteall",
 | 
			
		||||
            })
 | 
			
		||||
        end,
 | 
			
		||||
    })
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
return M
 | 
			
		||||
 
 | 
			
		||||
@@ -83,34 +83,3 @@ vim.g.netrw_banner = 0 -- Remove useless banner
 | 
			
		||||
vim.g.netrw_winsize = 15 -- Explore window takes % of page
 | 
			
		||||
vim.g.netrw_browse_split = 4 -- Open in previous window
 | 
			
		||||
vim.g.netrw_altv = 1 -- Always split left
 | 
			
		||||
 | 
			
		||||
-- VimWiki
 | 
			
		||||
vim.g.vimwiki_list = {
 | 
			
		||||
    {
 | 
			
		||||
        ["path"] = "$NOTES_PATH",
 | 
			
		||||
        ["syntax"] = "markdown",
 | 
			
		||||
        ["index"] = "home",
 | 
			
		||||
        ["ext"] = ".md",
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
vim.g.vimwiki_key_mappings = {
 | 
			
		||||
    ["all_maps"] = 1,
 | 
			
		||||
    ["mouse"] = 1,
 | 
			
		||||
}
 | 
			
		||||
vim.g.vimwiki_auto_chdir = 1 -- Set local dir to Wiki when open
 | 
			
		||||
vim.g.vimwiki_create_link = 0 -- Don't automatically create new links
 | 
			
		||||
vim.g.vimwiki_listsyms = " x" -- Set checkbox symbol progression
 | 
			
		||||
vim.g.vimwiki_table_mappings = 0 -- VimWiki table keybinds interfere with tab completion
 | 
			
		||||
vim.api.nvim_exec(
 | 
			
		||||
    [[
 | 
			
		||||
    au FileType markdown inoremap ;tt <Esc>:AddTag<CR>
 | 
			
		||||
 | 
			
		||||
    function! PInsert(item)
 | 
			
		||||
        let @z=a:item
 | 
			
		||||
        norm "zpx
 | 
			
		||||
    endfunction
 | 
			
		||||
 | 
			
		||||
    command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
 | 
			
		||||
]],
 | 
			
		||||
    false
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
  home-manager.users.${config.user} = {
 | 
			
		||||
 | 
			
		||||
    home.sessionVariables = {
 | 
			
		||||
      NOTES_PATH = "${config.homePath}/dev/personal/notes";
 | 
			
		||||
      NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user