From TextMate to MacVim: Introduce Vim-Task (GTD)

[ Update: Vim-Task 1.1 was released, the latest version can be downloaded here. ] Introduce a recently written vim plugin for GTD, basically it’s just the TextMate Tasks Bundle port for Vim. [Screenshot] I like the Mac default font Monaco, unfortunately it doesn’t support bold and italic: If use font like Consolas which support bold and italic, all the syntax highlights should take effect: [Code Repository] github: http://github.com/samsonw/vim-task [Installation] Normal installation steps follow the vim tradition: download the zip/tar archive then copy all the directories/files to ~/.vim directory. You can download vim-task zip/tar archive by clicking the “Download Source” button in github. You can also check out the latest code if you have git installed: [cc lang=”bash”] $ git clone git://github.com/samsonw/vim-task.git $ cd vim-task $ rm README.mkd $ cp -rv ~/.vim [/cc] For those guys who use pathogen, the installation should be as simple as a git clone: [cc lang=”bash”] $ cd ~/.vim/bundle $ git clone git://github.com/samsonw/vim-task.git [/cc] unfortunately ftdetect directory seems not take effect in pathogen, I’m still wondering about why, but anyway here is a temporary workaround for now: this issue is now fixed in vim-task 1.1, following 3 commands are not necessary any more. [cc lang=”bash”] $ mkdir -p ~/.vim/ftdetect $ cd ~/.vim/ftdetect $ ln -s ../bundle/vim-task/ftdetect/task.vim task.vim [/cc] [Shortcut Key, Key Binding & Customization] By default, I mapped Ctrl+Command+Enter for toggling task status, you can simply remap to what’s the most comfortable for you: [cc lang=”vim”] inoremap :call Toggle_task_status()i noremap :call Toggle_task_status() [/cc] Note, if you find the key binding doesn’t work as expect, please make sure your vim instance was compiled with the +ruby feature. Compiled with +ruby is not required any more, following +ruby check is optional since this plugin has already been ported to native vim script. [cc lang=”bash”] $ vim –version | grep +ruby -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent [/cc] [File Format & Syntax] The Tasks grammar and commands by default apply to file todo.txt and files with the .task and .tasks extensions. You can customize this by editing ftdetect/task.vim: [cc lang=”vim”] autocmd BufNewFile,BufRead todo.txt,.task,*.tasks setfiletype task [/cc] All the formats and syntax is similar with the TextMate Tasks bundle, I just quoted below for your references:

Headers end with a colon (“:”). Pending (uncompleted) tasks start with a hyphen (“-“). Completed tasks start with a checkmark (“✓”). Headers and tasks can be indented for grouping/hierarchy, as seen in the screenshot above.

[Bug & Feedback] Please report bugs and issues to github: http://github.com/samsonw/vim-task/issues, any feedback and suggestion is welcome and appreciated.

Buy me a coffee
  • Post author: Samson Wu
  • Post link: 2223.html
  • Copyright Notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.
0%