ywchaos : Journal taking and diary making, to record all the chaos of your life :)
| script karma
Downloaded by 1719
Comments, bugs, improvements
script versions (upload new version)
|It's at the very early stage. If you feel the script is useful but still not so convenient in the journal taking and chaos orgnizing with vim in KISS way, any feedback is welcome, if you have thoughts on improvement, any advice is appreciated! My email is:
ywupub AT gmail DOT com
1. Journal recording.
Hit the key <Leader>n (<Leader> normally means \ on your keyboard if you haven't changed the <Leader> definition.) to create a new journal entry. ywchaos will insert a new entry with timestamp under today's datestamp for you.
2. Tag support.
you can add a tag with the format of "@tag"(Without the double quotes) at anywhere you want in a file, or use "@tag1|tag2" for creating multi-tags, you can also use "@tag:subtag" to define sub-tags. <tab> can be used for autocompletion after '@', '|' or ':'.
After a "@tag" has been defined, next time you edit ywchaos file, ywchaos will add the "tag" to TAGS list region which is on the very first part of the file. You can also use <Leader><C-l> to reflesh the TAGS list region manually.
(subtag support is experimental, not so convenient for subtag adding at present, you much create tag then :subtag for every subtag.)
3. Folding & highlighting & picture supporting.
ywchaos folds the file according to the datestamp[mm/dd/yyyy], the timestamp[hh:mm:ss], and the snip. Just a few highlightings(tags, journal entries) for ywchaos itself are supported at present, ywchaos is to manage the..., chaos, so I've no idea which stuffs should be highlighted, if you have a good advice, please let me know.
BUT great news is, you can insert any other different filetypes of snip as you like, and use their syntaxs to hightlight(if they exists), so ywchaos can actually support all highlightings as vim supports! Only syntax is supported, not indentation. I don't know if filetype's indentation can be integrated in one file, if you know, please let me know.
ywchaos makes the insertion of picture is easy, you can hit <Leader>i, select the html tag, then use the auto completion to insert a <img src=> tag(auto-completion for file name after '=' is supported), then you can rename ywchaos file from foo.ywchaos to foo.html, then see the pictures in your browser.
Special note for txtfmt users: you can use set ft=ywchaos.txtfmt, instead of simply ft=ywchaos to make ywchaos and txtfmt[http://www.vim.org/scripts/script.php?script_id=2208] work together. Thanks Brett Stahlman for such nice script to turn vim into a word processor :) You could go to http://txtfmt.webs.com/ywchaos.htm for the screenshots!
<Leader>n Create a new journal entry with the format of "$datestamp\n$timestamp" and start editing.
<Leader>i ywchaos will prompt you to insert html tags or other filetype of snips as you like(auto-completion is supported), and use the corresponding syntax to highlight the html tag or snip region.
<Tab> When on TAGS list region, unfolds all the entries which have the tag under the cursor, another <Tab> will restore to old fold way, otherwise do folding/unfolding toggling. When in insert mode, <tab> will try to complete the tag name after '@' or '|'.
<Leader><C-l> Refresh the TAGS list region manually.
<C-]> To vimgrep the tag(auto-completion is supported) for current file.
5. A sample test.ywchaos(Trick: you can name it to test.htm to view the picture):
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<pre style="word-wrap: break-word; white-space: pre-wrap; white-space: -moz-pre-wrap" >
<img src=http://www.google.com/intl/en_ALL/images/logo.gif >
这是中文测试. This is a test for Chinese.
I've created a new ywchaos entry in vim.
It's not so good, I'll email developer to improve it!
Following the a C snip that I'm learning for programming! @Programming:C
/* Just for example. */
Christian Brabandt for the help with the function that gets tags in file.
Xbeta for the inspiration of html tag support[http://xbeta.info/pre-txt.htm]
|1. Unzip(tar jxvf) ywchaos.tar.bz2 into your ~/.vim/(or vimfiles/ when on windows).
ywchaos has the following files:
2. Create a new file with a line at the very end of the file:
3. That's all. Now close the file then re-open it. If modeline is annoying, you can add one line in your ~/.vimrc:
au BufRead,BufNewFile *.ywchaos set ft=ywchaos
Then next time when you want to create a new ywchaos file, named it with foo.ywchaos is enough.
Click on the package to download.
ip used for rating: 220.127.116.11
||1) Reserved first two lines for html pre tags to fix html encoding issue, please see the example file and adjust for your own file.
2) Changed folding functions. Now use <tab> in tags list region to toggle tags view or dates view.
3) Fixed bug in new entry creation.
||1. Implemented html syntax, now you can rename ywchaos file to .html to view the pictures.
2. Added simplist html tags insertion & completion support.
3. Changed Tag list region to start from 2nd line. 1st line reserves for html pre tag.
Please take the test file in the document for a try!
||1. Fixed bug that cursor position may change after refresh the TAGS list region.
2. Improved the highlight after tag name changed.
||1) Tag grep(<C-]>) and tag outlining(<TAB>) now differ well with the subtags sharing a same name which in different parent tags.
2) Improved TAGS list region generation function.
||1) Improved TAGS list region generating function to prevent the lost of TAGS header.
2) Fixed the bug of messing up the highlighting when inserting multi filetypes of snips.
3) Fixed bug of vimgrep(<C-]>) for the multi-tag & subtag's matching.
4) Ignore case in tags highlighting.
5) Improved highlighting. Highlights accroding to English *word* and Chinese *charactors* .
6) Removed '@' from the option of 'iskwd'.
||1. Arrange the subtags alphabetically.
2. Improved <Tab> for subtag completion.
||1) Fixed <C-]> not working for the new format of TAGS list region.
2) Improved TAGS list region generating function.
||Fixed a bug with the var undefined...
||UPGRATE NOTE!!!: Delete the TAGSLINE manually please, new version use a different fomat which is called TAGS list region now. Please see the document and the sample file for detail.
1) Tagsline format has changed to TAGS list region. Also note that the modeline should be change to the end of file if you use modeline.
2) Added sub-tags supported which defined by @tag:subtag.
3) Improved to test condition that if <tab> should try to complete on '|' and ':'.
4) Fixed minor highlighting bug.
||1) Added <tab> autocompetion for tag name when in insert mode after '@' and '|'.
2) Added folding support on snips.
3) Added syntax of @tag1|tag2 to support multi-tags.
4) Improved syntax highlighting.
5) Removed useless buffer variable.
||Fixed bug that snips can't be highlighted when start editing.
||Supports inserting any other filetypes of snip and their highlightings!
||1) Suppressed <Tab> no fold found's warning.
2) Fixed bug of <Tab> behavior on TAGSLINE.
3) Added <Leader><C-l> for easing the TAGSLINE refresh.
||TAGSLINE treament improved.
<Tab> key map improved.
Accept 'yy' and 'yyyy' as year string, but 'yyyy' is recommended.
Minor bugs fixed.
||1. More highlightings support.
2. Timestamp format changed to show second now.
3. Timestamp entry can be folded now.
||Fixed wrong package suffix, sorry for inconvenient!
||Fixed non-work highlighting and some minor bugs.
||Fix function name typo.