Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I combine two features of vim wiki plugins?

Tags:

vim

wiki

Sorry in advance for the newbie question. I've been trying to use vim for keeping a personal wiki, but I can't quite seem to decide on a good plugin. Vimwiki is great, and I really like the way it does checkboxes and uses the enter key to follow links. Notes.vim is simpler but I like it a lot better: it dynamically makes names of notes into links like Tomboy Notes, makes pretty bullet points, and has a search function built in. I can't get vimwiki to use files with no extension, but notes.vim does that automatically.

What I want to know is: is there an easy way (calling a vimscript file or something?) to combine some features of both of these plugins? I've tried doing some cutting-and-pasting but so far nothing has been working.

like image 514
Jonathan Avatar asked Nov 05 '22 21:11

Jonathan


1 Answers

I doubt whether tbere is any simple automated way to do it. Both Vimwiki and notes.vim are "filetype" plugins. Generally in Vim any file (or buffer) can be set to just a single filetype.

It would depend on how the ftplugins were written, but it may be possible to apply them both to same buffer by making sure that the buffer is set to both filetypes, sequentially. That is, the buffer can be set to one filetype at a time, but setting it to both one after the other may do part of what you need.

For example, opening a notes.vim file will automatically set the buffer to a notes.vim filetype. Once open you could issue the command :setlocal filetype=vimwiki to change it to a vimwiki buffer. If vimwiki filetype initialization doesn't wipe out crucial notes.vim settings or have conflicting operation then you may then be able to access some functionality from both ftplugins. Not likely to get you very far, but maybe worth a try. Better would be to combine sections of their code into a single ftplugin.

like image 188
Herbert Sitz Avatar answered Nov 15 '22 04:11

Herbert Sitz