-
Notifications
You must be signed in to change notification settings - Fork 106
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
Pandoc: Table edit commands #313
base: master
Are you sure you want to change the base?
Conversation
Thanks! I like the idea. Some comments:
|
Yes a license file should be placed in the top of the repository. Individual files shouldn't bother with it in their headers. |
I agree with using the MIT license, do you too @alerque? Since I am the main contributor to the code, I think I can do it on my own, but do you think there might be trouble in doing it without contacting other contributors? |
Yes I'm fine with MIT and it's a pretty good choice for plugins. Since you are the main contributor and the license wasn't clear before I don't think adding a permissive license like MIT is an issue. It can be a concern if implementing a more restrictive license and previous contributors can whine about that, but I don't think that is a concern here. I'd just go for it. |
Moved that to #314. |
@fmoralesc Good that you liked the idea. Regarding the comments you have:
Let me know how you think. |
Now it is converted to a module. Please review. Per my simple tests, it works out greatly. |
We will probably need to add some documentation too. |
Agree, documentation is needed. I can write a simple draft when having time. |
Copying the documentation from vimwiki can be a start. We will need to add references to it and other things later. |
Ping @randomizedthinking Any update on the docs? |
I will draft a simple doc soon... thanks for the reminder.
|
A simple write-up for the table editing is now added. Please review... |
Could inoremap <expr> <buffer> <Tab> pandoc#table#kbd_tab()
inoremap <expr> <buffer> <S-Tab> pandoc#table#kbd_shift_tab() be made optional? Some may have overriden Perhaps one could mention (or incorporate) https://github.com/dhruvasagar/vim-table-mode that aligns the table automatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the binding issue everything looks pretty good to me, if we can get that dealt with I think we can merge this.
command! -buffer PandocTableMoveColumnRight call pandoc#table#move_column_right() | ||
|
||
" Table mappings | ||
inoremap <expr> <buffer> <Tab> pandoc#table#kbd_tab() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @Konfekt noted in issue comments, can you please wrap these bindings in a check to make sure they are not already bound to a different key and that this key isn't already bound to something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This vim-script idiom comes to mind.
nnoremap <silent><script><buffer> | ||
\ <Plug>PandocTableMoveColumnRight :PandocTableMoveColumnRight<CR> | ||
|
||
" Table autocmds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these global? I think it's best to use <buffer>
as the pattern.
In any case, what are they for?
function! pandoc#table#Init() | ||
" Table commands | ||
command! -buffer -nargs=* PandocTable call pandoc#table#create(<f-args>) | ||
command! -buffer PandocTableAlignQ call pandoc#table#align_or_cmd('gqq') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These commands need to be documented.
Hmmmm, there are also some lint errors that need cleaning up. |
The table edit function of vimwiki is quite nice. Here the code is ported to pandoc with minor modifications. It would serve as a good starting point to add more functionalities.
My initial test shows everything works:
Let me know how you think.