jakewvincent / mkdnflow.nvim Goto Github PK
View Code? Open in Web Editor NEWFluent navigation and management of markdown notebooks
License: GNU General Public License v3.0
Fluent navigation and management of markdown notebooks
License: GNU General Public License v3.0
e.g. [link](file:~/Personal projects)
error message: $HOME/Personal\ projects doesn't seem to exist!
OS: macOS
Current behavior:
Possible enhanced behavior:
If the document contains a line like the following, using <Tab>
to go to the next link will cause the cursor to land on the first open square bracket, rather than the open square bracket that is a part of the link.
As Noam Chomsky [@chomsky1957] says, [colorless green ideas sleep furiously](https://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_furiously).
When navigating through files in nested directories, navigate backwards, and then navigate through nested directories along a different path, doesn't take you to last-opened, but to a file on the first path.
As [@foo] says, [bar](https://link-to-bar.com).
@foo
<CR>
If the cursor is in the | position in the below example and <CR>
is mapped to MkdnNewListItem, the cursor will move to the | position in (2) without bringing the rest of the contents of (1) to the next line
Before <CR>:
1. Foo foo foo |bar bar bar
After <CR>:
1. Foo foo foo bar bar bar
2. |
Expected behavior:
Before <CR>:
1. Foo foo foo |bar bar bar
After <CR>:
1. Foo foo foo
2. |bar bar bar
What do you think of applying the keymaps locally to the buffer with an autocommand instead of globally? In my opinion it would be a lot nicer, if the mappings would only be applied to markdown buffers (except maybe for some keybindings, for example MkdnGoBack. However, <C-^> could also be used in a non-markdown buffer to navigate back).
packer update fails, trying to manually git pull
doesn't work either due to 'unrelated history' error. please make sure to keep your git history straight as having to un- and then reinstall the whole plugin with packer is annoying. (manual git pull --allow-unrelated-history
creates a merge conflict and just removing the repos and cloning it anew is almost imopssible on m$-windows :()
#error attempt to index a nil value stack traceback:
I want to stop listitem▫{number list}
when i press again.
but there has an error
i hope there has a solution
MkdnToggleTodo doesn't take the header back to Done state.
I am getting the following error
E5108: Error executing lua ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:68: bad argument #1 to 'match' (string expected, got nil) stack traceback: [C]: in function 'match' ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:68: in function 'get_status' ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:102: in function 'same_siblings' ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:182: in function 'update_parent_to_do' ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:249: in function 'toggleToDo' [string ":lua"]:1: in main chunk
Steps I followed
I was planning to use this Plugin as lightweight Vimwiki (Actually wiki.vim) alternative because I actually only used the file/link navigation.
Nevertheless, I saw that Wiklinks( [[wikilink]]
) are not supported or I did not find the configuration. As I mainly use Obsidian and telekasten support for this would be great.
I could think of this as a config like in wiki.vim.
Hi Jake.
On my system, when I'm opening rmd filetypes, The plugin do not start automatic. I can start the plugin maunally with ':Mkdnflow'. when I run ':set filetype' the value is rmd.
When I open a filetype 'md' the plugin starts automatic.
I'm uncertain how to debug this, so please advise me, for more information.
system:
Archlinux
NVIM: v0.6.1
ya
## April 4-8
Hi Jake.
I would like to use your plugin. for my personal knowledge system(PKS). I imaging that I have a root folder the PKS.
Could you imaging that there is another type of link. to (papers, documentations, websites) which is not saved relative to the PKS. ex. another folder where I have my library of papers. Maybe another project where I have education materials.
I would like to be able to do something link link to source or paper or [website](source:www.paper.com]
I can take a stab of trying to implement a solution from what you already have build. But I havn't done anything in Lua before, an is a novice programmer.
Greetings from denmark
Dan Olesen
The new config format for mappings allows one to easily change a mapping but not to disable a single mapping completely. It would be helpful if one could just set a particular command to false
in the mappings list to avoid mapping it to anything altogether (preventing the user from having to manually unmap it).
--...
MkdnToggleTodo = false,
--...
Behaviour: When i open a markdown file (as in nvim index.md
, not when vim is already open) the mkdnflow message is indented:
⬇️ Notebook: wiki
Expected behaviour: I would expect the message to appear unindented as it does when i open a markdown file from within nvim (like :e index.md
):
⬇️ Notebook: wiki
:version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Scenario: Currently in a notebook Notes
Follow link: [Other notebook](../Other notes)
Current behavior: Create a file called Other notes.md
in the parent directory of the current file
Proposed behavior: Check whether Other notes
is the name of a directory and if there is a file index.md
(possibly specify default index filename in config?) inside it. If not, create a file called Other notes.md
in the parent directory of the current file.
To replicate: Insert link whose url has a hash (#) symbol in it, e.g. [link](https://people.ucsc.edu/~jwvincen/teaching.html#primary-instructor)
. on the link to follow.
Verified: macOS
Unverified: Linux
I enjoy that Vimwiki will simplify links to just their link names, then they expand to the link name when the cursor is on top of them. It's just a nice feature that de-clutters the viewing experience. Is this something that could be added?
is there a way to use both mkdwnflow and due.nvim?
https://github.com/NFrid/due.nvim
When using followPath()
(mapped to <CR>
by default in normal mode) on a link that goes to a local file (e.g. [Notes](file:~/Documents/notes.xopp)
), nothing happens.
On Windows. Relative links work with the file prefix without issue, and markdown links using absolute path also work without error.
If I use "file:C:\Users\user\file.py" as my path, Windows tries to open the file with the default program, but starts at the location of the file I'm in. For example, if the above link was in C:\Project\Start.md, Windows would try to open the file at "C:\Project\C:\Users\user\file.py".
If I start the path with / instead of C:, the file opens correctly with the default program, but Neovim gives the below error.
If in index.md
and there's a link [My to-do lists](20220420_to-do.md#grocery-list)
, first navigate to the file and then jump to the appropriate heading (if it exists).
Hi Jake
As disuessed in #11 It would be nice to be able to insert citations in a document.
I think we can be inspired from from citr and bookdown.
maybe wee can use the syntax '[@Yudkin2006]', and then use files in current directory ending with .bib, or bib files in a 'master' folder defined i configurations. So if there is a bib file in the current dir, then that file is used, else use hte master dir.
Then look up the citation in the bib files. If there is a entry file in the citation, then open that with system default. if no file entry, but one of doi, howpublished, url, then open in browser
example of bibtex entry. here is more info. https://www.bibtex.com/g/bibtex-format/
`
@incollection{Yudkin2006,
title = {Kap 5 - {{Materials}} and Methods},
booktitle = {Critical {{Reading}} - {{Making}} Sense of Research Papers in Life Sciences and Medicine},
author = {Yudkin, Ben},
year = {2006},
issn = {00029262},
doi = {10.1038/sj.bjc.6602452},
file = {/home/dano/data/projects/zotero/storage/SMLHDV5X/Yudkin, 2006, Kap 5 Materials and methods.pdf},
isbn = {85-7133-010-7},
pmid = {7704928}
}
@misc{_bp,
title = {Clinical Guidelines for Best Practice Management of Acute and Chronic Whiplash-Associated Disorders - {{UQ eSpace}}},
file = {/home/dano/data/projects/zotero/storage/9HUTF35P/UQ266894.html},
howpublished = {https://espace.library.uq.edu.au/view/UQ:266894}
}
`
What do you think of this suggestion?
Greetings from denmark
Dan Olesen
Is there any way to enable mkdnflow in an already existing nvim buffer? I use alpha and would love to open my notebook from it.
If I just open up my index.md file with nvim your plugin works wonderfully, so it isn't an installation issue to my knowledge.
## Issue 20: "Can't yank anchor link from heading if it contains quotation marks"
ya
to yank an anchor linkI'm noticing that my Mkdnflow config activates when I open a document directly from the command line, but if I open it from something like a fuzzy finder or telescope from within Neovim, I need to :Mkdnflow
explicitly, which subsequently warns me that the default config is being loaded (and thus my custom config is ignored...in theory).
E5108: Error executing lua ...nfig/nvim/plugged/mkdnflow.nvim/lua/mkdnflow/buffers.lua:52: attempt to concatenate local 'prev_buf' (a nil value) stack traceback: ...nfig/nvim/plugged/mkdnflow.nvim/lua/mkdnflow/buffers.lua:52: in function 'goBack' [string ":lua"]:1: in main chunk
use goback error
When I try to goback in first link & press again
I am feeling picky about not having to replicate a bunch of notes that will also belong to some static site generator that cannot drop the "markdown" extension and just build a valid route.
I am also noticing that GitJournal/ZettleNotes can happily follow implicit links on Android.
This is strictly a "have your cake and eat it too" scenario, but maybe if this were an optional feature in the config such as "followImplicitLinks = false" by default. When true, links such as [I am a link](some-file)
could automatically resolve to some-file.md
or whatever other possible format we've chosen to accept as flowy in the filetypes
table will do.
Setting the mappings on a case-by-case basis in the setup function does not seem to be working, e.g.:
mkdnflow.setup({
mappings = {
MkdnDecreaseHeading = '<Space>'
}
})
If a line has a to-do checkbox and parentheses following somewhere, it is jumped to as if it is a link. In an example like the following, the first "Finance chores" to-do is jumped to because there is a set of square brackets and a set of parentheses in the line.
* [.] Finance chores (Personal)
- [Bank](https://my.bank.com)
- [X] Transfer funds to savings
- [ ] Pay credit card bill
- [ ] Buy bonds
Current behavior: the forceStart()
function does not (is not designed to) respect config settings, but should.
init.forceStart = function()
if init.loaded == true then
print("MkdnFlow already running!")
else
-- Record load status (i.e. loaded)
init.loaded = true
-- Load functions
init.cursor = require('mkdnflow.cursor')
init.paths = require('mkdnflow.paths')
init.links = require('mkdnflow.links')
init.buffers = require('mkdnflow.buffers')
init.bib = require('mkdnflow.bib')
init.lists = require('mkdnflow.lists')
init.files = require('mkdnflow.compat')
-- Only load the mappings if the user hasn't said "no"
if init.config.default_mappings == true then
require('mkdnflow.maps')
end
end
end
The function that creates missing directories has stopped working. An error is thrown on attempted write:
E212: Can't open file for writing: no such file or directory
When a to-do item like the following is toggled, an error is produced.
* [ ] Do something fun - hopefully
Error:
E5108: Error executing lua ...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:177: attempt to get length of local 'indentation' (a nil value)
stack traceback:
...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:177: in function 'update_parent_to_do'
...e/pack/packer/start/mkdnflow.nvim/lua/mkdnflow/lists.lua:267: in function 'toggleToDo'
[string ":lua"]:1: in main chunk
Currently, doing MkdnFollowLink on a link such as the following will not result in the named file being opened:
[Experiment data analysis](analysis.Rmd)
Instead, it opens a new buffer called analysis.Rmd.md
. The plugin should not assume that the lack of a .md
extension means there's no extension at all, and it should behave as expected when opening non-md filetypes within and without the notebook/wiki.
Hi Jake.
I've been thinking if it makes sence to enhance the function 'open-relative_to'. In my workflow, I create links to documents in my 'wiki' in two ways. Either a sub link from my document, or a link from another domain(which is in other sub filer/directories from the wiki root folder. These two a used random in my wiki pages.
I suggest that instead of setting the option in config 'open_relative_to', then use some logic to define if the link is relative to the document or relative to root of the wiki.
From my thinking there should be a function which defines root, based on content i a paraent folder( should search up in the directory tree untill it finds a folder with the defined content.) the content could be defined in config ex. 'root_dir_content = {'.git', '.root', '.wiki_root'}
then the open file function could choose who to open relative files from this logic.
[relative sub file]('relative/sub-file.Rmd')
[relative root file]('~/relative/root-file.Rmd')
From my thinking this should not interfer with how we implemented files from outside the wiki, because we prefix with 'file:'
What do you think?
Greetings from denmark.
Dan Olesen
Hi !
There is a small mistake in the mappings option :
It's written :
MkdnPrevLink = {'<S-Tab>'},
instead of :
MkdnPrevLink = {'n', '<S-Tab>'},
It would be nice if path completions (e.g. via nvim-cmp + cmp-path) were always relative to the perspective MkdnFlow currently takes. Might require making a custom completion source, or a combination of changing working directories + suggesting completion settings.
I didn't want a change in perspective to change the working directly. I tried switching nvim_wd_heel to false, but it did nothing. I looked at the code a bit, set vimwd_heel to false in my config, and the functionality was disabled as expected.
Calling MkdnNewListItem does not add a new to-do if it is called on a line with a filled checkbox. It will add a new ordinary unordered list item. To reproduce, call :MkdnNewListItem
when on any line like the following:
* [-] foo foo foo
* [X] bar bar bar
Toggle multiple to-do items on contiguous lines selected with Visual(-{Line, Block})
Currently, calling MkdnNewListItem on an empty list item will (a) remove a bullet point (if an unordered list), (b) remove the number (if an ordered list), or (c) remove a to-do box (if an unordered to-do list). This happens regardless of whether the item is indented. Calling MkdnNewListItem should first demote the list item (as in remove indentation) before doing the above if the list item is indented.
Improvements to make:
Currently, ing on a URL will make a markdown link out of whatever part of what's under the cursor is identified as a "word". It would be nice if it created a markdown link from the whole URL.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.