neilagabriel / vim-geeknote

Vim plugin for Geeknote
233 stars 16 forks source link

How about note name editing inline #4

Closed slavaGanzin closed 10 years ago

slavaGanzin commented 10 years ago

Hello, again

I'm using my super vim oneliner

 !geeknote create --title "`cat % | head -n1`" --content "`cat % | tail -n +2`"

as you can see first stroke used as name of note and so you can edit it inline. What about implementing it in vim-geeknote.

p.s. I see only 10 notes in my notebook is it ok?

neilagabriel commented 10 years ago

Sounds possible. In more specific terms, you want a command that will create a new note in the selected notebook (or the default notebook if nothing is selected) using the contents of the buffer in the active window and using the first line as the title?

The 10 note thing sounds wrong. I just tried creating a notebook here with >10 notes and it showed up just fine.

slavaGanzin commented 10 years ago

And editing note in this mode to:

name1 content1

moves to

name2 content1

There are no any cons of editing note name in same place with content

neilagabriel commented 10 years ago

This should be working now if you want to grab the latest.

Note titles are now shown the first line on any note. Modifying the name and saving the note will update the title. I also added a command called :GeeknoteSaveAsNote that you can run without any parameters that will create a note either in the default notebook or the selected notebook using the contents of the current buffer. Again the first line establishes the note's title.

Please try it out and open a new issue if you find any bugs with it.

Also, this is somewhat unrelated, but if you do intent to use vim-geeknote, I highly recommend adding the following to your .vimrc:

let g:GeeknoteFormat="pre"

See the README for a description on what that does. I may ultimately just make that a default setting.

slavaGanzin commented 10 years ago
Error detected while processing function Vim_GeeknoteSaveAsNote: line 4: Traceback (most recent call last): File "", line 2, in File "/home/vganzin/.config/.vim/bundle/vim-geeknote/plugin/vim_geeknote.py", line 185, in GeeknoteSaveAsNote GeeknoteHandleNoteSaveFailure(note, e) File "/home/vganzin/.config/.vim/bundle/vim-geeknote/plugin/vim_geeknote.py", line 262, in GeeknoteHandleNoteSaveFai lure vim.command('echoerr "%s"' % msg) vim.error: Vim(echoerr):EDAMUserException(errorCode=5, parameter='Note.guid') +------------------- WARNING -------------------+ Failed to save note (see error above)
Save buffer to a file to avoid losing content

+------------------- WARNING -------------------+

neilagabriel commented 10 years ago

Hmm. Looks like I regressed something with my last bugfix. Give me a minute to fix this. Sorry

neilagabriel commented 10 years ago

Sorry about that. Should be okay now.

slavaGanzin commented 10 years ago

Thanks for your work