Giter Club home page Giter Club logo

mkdnflow.nvim's People

Contributors

aadriance avatar denolehov avatar horriblename avatar jakewvincent avatar jmbuhr avatar jpoppe avatar matrig avatar name-snrl avatar octvs avatar pbogut avatar pipoprods avatar seantwie03 avatar svenrdz avatar uggedal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mkdnflow.nvim's Issues

Set command to false to prevent mapping it at all

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,
--...

Link to notebooks

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.

open relative links to root

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

E5108

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

Set mappings as buffer local

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).

` - ` in a to-do item throws an error when toggling

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

Support better path completion for completion frameworks?

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.

In readme, seems like nvim_wd_heel should be vimwd_heel

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.

Mkdnflow doesn't always intuitively (de)activate

I'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).

citation links

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

Update fails ("unrelated history" error) -- see here for how to resolve

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 :()

Open non-md filetypes in window with MkdnFollowLink

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.

MkdnNewListItem improvements

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:

  • If the line ends in a colon, the new list item on the next line should be a child of the current item.
  • Demote one indentation level if MkdnNewListItem is done on an empty line that is indented

New type of link 'source'

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

Implement conceal to make links nicer looking

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?

Support Wikilink syntax

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.

Change perspectives if entering buffer in a different wiki

Current behavior:

  1. Create two wikis/notebooks: notes_1, notes_2, specifying the same root tell for each
  2. Within a document in notes_1, add a link to a document to notes_2
  3. Follow link
  4. If document in notes_1 was opened first, the perspective remains fixed to notes_1

Possible enhanced behavior:

  1. Create two wikis/notebooks: notes_1, notes_2, specifying the same root tell for each
  2. Within a document in notes_1, add a link to a document to notes_2
  3. Follow link
  4. Perspective shifts to notes_2 root directory

attempt to index a nil value

#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

Idea - Follow implicit links?

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.

Absolute links seem to be broken for "file:" on Windows

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.

Screenshot 2022-06-13 024829

<Tab> goes to pair of square brackets on lines w/ links

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).

the plugin do not start on rmd filetype

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

Customize MkdnNewListItem behavior

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

MkdnToggleTodo doesn't take the header back to Done state.

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

  1. Created
  • parent
    • child
  1. I toggled child and both the child and parent toggled to In progress state
  2. Again toggled child to done state but parent state didn't change and got the error.

To-do items are jumped to as if they are links if line contains parens

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

Local files are not opening

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.

Force-starting does not respect config settings

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

Bug: Messages echoed to command line are (sometimes) indented

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.