sponsor Vim development Vim logo Vim Book Ad

ywchaos : Journal taking and diary making, to record all the chaos of your life :)

 script karma  Rating 14/10, Downloaded by 2703  Comments, bugs, improvements  Vim wiki

created by
Yue Wu
 
script type
utility
 
description
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!

4. keybinding:

<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" >
<TAGS>
Chinese
Programming      C
vim              ywchaos
中文
</TAGS>

Logo pic:
<img src=http://www.google.com/intl/en_ALL/images/logo.gif >

11/18/2009
22:40:40 @中文|Chinese
这是中文测试. This is a test for Chinese.
11/08/2009
15:52:00 @vim:ywchaos
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
<BEGINSNIP=c>
#include <stdio.h>
/* Just for example. */
main()
{
    int i;
    printf("Hello, ywchaos!\n");
}
<ENDSNIP=c>

vim:ft=ywchaos:
------------------------------------------------

6. Thanks:

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]
 
install details
1. Unzip(tar jxvf) ywchaos.tar.bz2 into your ~/.vim/(or vimfiles/ when on windows).

ywchaos has the following files:

    plugin/ywchaos.vim
    ftplugin/ywchaos.vim
    syntax/ywchaos.vim

2. Create a new file with a line at the very end of the file:

    vim:ft=ywchaos:

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.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ywchaos-0.14.tar.bz2 0.14 2010-02-23 7.0 Yue Wu 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.
ywchaos-0.13.tar.bz2 0.13 2010-02-08 7.0 Yue Wu 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!
ywchaos-0.12.tar.bz2 0.12 2009-12-13 7.0 Yue Wu 1. Fixed bug that cursor position may change after refresh the TAGS list region.
2. Improved the highlight after tag name changed.
ywchaos-0.11.tar.bz2 0.11 2009-11-27 7.0 Yue Wu 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.
ywchaos-0.10.tar.bz2 0.10 2009-11-20 7.0 Yue Wu 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'.
ywchaos-0.9.tar.bz2 0.9 2009-11-16 7.0 Yue Wu 1. Arrange the subtags alphabetically.
2. Improved <Tab> for subtag completion.
ywchaos-0.8.tar.bz2 0.8 2009-11-15 7.0 Yue Wu 1) Fixed <C-]> not working for the new format of TAGS list region.
2) Improved TAGS list region generating function.
ywchaos-0.7_2.tar.bz2 0.7_2 2009-11-13 7.0 Yue Wu Fixed a bug with the var undefined...
ywchaos-0.7.tar.bz2 0.7 2009-11-13 7.0 Yue Wu 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.
ywchaos-0.6.tar.bz2 0.6 2009-11-11 7.0 Yue Wu 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.
ywchaos-0.5_2.tar.bz2 0.5_2 2009-11-10 7.0 Yue Wu Fixed bug that snips can't be highlighted when start editing.
ywchaos-0.5.tar.bz2 0.5 2009-11-10 7.0 Yue Wu Supports inserting any other filetypes of snip and their highlightings!
ywchaos-0.4.tar.bz2 0.4 2009-11-09 7.0 Yue Wu 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.
ywchaos-0.3.tar.bz2 0.3 2009-11-09 7.0 Yue Wu TAGSLINE treament improved.
<Tab> key map improved.
Accept 'yy' and 'yyyy' as year string, but 'yyyy' is recommended.
Minor bugs fixed.
ywchaos-0.2.tar.bz2 0.2 2009-11-08 7.0 Yue Wu 1. More highlightings support.
2. Timestamp format changed to show second now.
3. Timestamp entry can be folded now.
ywchaos-0.1_2.tar.bz2 0.1_2 2009-11-07 7.0 Yue Wu Fixed wrong package suffix, sorry for inconvenient!
ywchaos-0.1_2.vim 0.1_2 2009-11-07 7.0 Yue Wu Fixed non-work highlighting and some minor bugs.
ywchaos-0.1_1.tar.bz2 0.1_1 2009-11-07 7.0 Yue Wu Fix function name typo.
ywchaos-0.1.tar.bz2 0.1 2009-11-07 7.0 Yue Wu Initial upload
ip used for rating: 18.226.177.223

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github