It would be nice to be able to do that from normal mode instead of only from inside the note pane with Shift-F
OK (the plugin obviously lacks this), but I need some input on how this should behave. On the long term, I want to support the API I have outlined in issue #37 (#37), but for now adding this will need either a change in the :OpenPad command or the creation of a new command, perhaps :NewPad. I'm not sure which is best.
In any case, I would also add the ability for :OpenPad to take an argument so it is possible to open a not by matching the filename (it should also support autocompletion), so in the first case I would have to incorporate the same logic the list searches use, that is, create a new note only if there is not a matching note. But this could not answer to user intent (if somehow I want to create a note with a title that already exists, which is possible with vim-pad). In the second case I could keep those behaviors separate (this solves that difficulty, but I'm not too fond on creating a new command, just for simplicity's sake). What do you think is best?
OK, I've been looking at how to implement this and found the simpler way for now will be to modify the OpenPad command, so
:OpenPad #this is a new note
will create a new note with the line "#this is a new note" already in it (I already have this working). To modify the search mapping (<leader>s) to support what the plugin does in the list (both searching and creation of new pads), I would have to decouple the padlib.list_local.incremental_search function from the list, and that will require some redesign.
OpenPad can take an argument now.
Should acomodate the use-case of issue #39.
A fuller fix could require some mayor changes.
How hard would it be to add a new mapping for this new functionality instead, while you do the redesign you mention in the API Proposal?
You can use the mapping
:noremap <leader>ss :OpenPad
(with a space at the end).
I added this to my .vimrc :
noremap <leader>ss :OpenPad
(with a space at the end)
Then I closed vim, reopened it, and used the shortcut. It created a note twice. That is what I expected it to do, but not what I had asked.
What I suggested was a new mapping / a new function that does in normal mode what Shift-F does (search or add) in the vim-pad window, while you are working on the redesign. Is that possible?
Implementing solution for issue #39
Adds a prompt that can search or create notes in normal mode
without opening the list.
I see now. I copied the function that handles the prompt in the list buffer and modified it to support this use-case. It is mapped to <leader>ss.
Sorry about how long it took me to check this out. It works great! :-) Good luck with the refactor.