Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with vim-markdownfmt #43

Open
greut opened this issue Oct 27, 2016 · 6 comments
Open

Compatibility with vim-markdownfmt #43

greut opened this issue Oct 27, 2016 · 6 comments

Comments

@greut
Copy link

greut commented Oct 27, 2016

vim-markdownfmt works with gomd and markdownfmt but not this one as it seems that it's not operating on the same file: the -w option.

Any chances to get this working?

Cheers

@wavded
Copy link

wavded commented Dec 30, 2016

Any movement on this one? I concur it would be nice for vim users.

@greut
Copy link
Author

greut commented Dec 30, 2016

I'm doing it using :0,$!tidy-markdown as an acceptable work-around.

@wavded
Copy link

wavded commented Dec 31, 2016

@greut thanks!

@wavded
Copy link

wavded commented Dec 31, 2016

@greut works pretty good so far. Any idea on how to retain the position in the document after the format is ran?

@wavded
Copy link

wavded commented Dec 31, 2016

@greut figured it out with a little function and some help from http://vi.stackexchange.com/a/10700

" Format Markdown files.
function! MarkdownFormat()
   let save_pos = getpos(".")
   let query = getreg('/')
   execute ":0,$!tidy-markdown"
   call setpos(".", save_pos)
   call setreg('/', query)
endfunction

au BufWritePre *.md :call MarkdownFormat()

@greut
Copy link
Author

greut commented Jan 1, 2017

@wavded even better! Thanks mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants