All posts tagged Vim

Multiple line support in SublimeTask

[废话]
鄙人新一年有个小计划,那便是需要开始protect起自己的private personal time,过去的一年因为工作牺牲了太多的个人时间,这样的策略抑或无奈是物有所值还是得不偿失需要被重新审视和评估;

==================== 废话的分割线 ====================

[Introduction]
Check out this introductory post if you don’t know what is SublimeTask.

[Overview]
Let’s keep it simple and short this time, since it’s very late now :(.

As issue #3 indicated, previous version of SublimeTask lacks the feature of multiple line support, this update just addressed this issue and addressed it well.

2 kinds of multiple types are now supported:

  • Multiple selections (hold ⌘ during multiple selections, one key fancy feature of Sublime Text)
  • One selection with multiple lines (this should be self explanatory)

So from now on you should be able to mark multiple tasks as completed/incomplete in just one shot, enjoy!
Continue reading →

Highlight URL in SublimeTask

[Redirection]
Check out this introductory post if you don’t know what is SublimeTask.

[Overview]
As this issue ticket indicated, people want the url (http, https, ftp etc) to be processed and displayed differently in SublimeTask.

Although opening url link in default browser is possible and actually turns out to be fairly simple, I still haven’t fully made my mind whether I want this functionality goes in or not, cuz it sounds like a separate project/plugin. Anyway, it’s really a nice-to-have feature, I will be glad to add this in in the future, either directly built in or as a separate plugin.

In this update/patch, what I did is just highlighting the url. One screenshot should be enough to tell the whole story.

[Screenshot]

Note all the url above are highlighted.

[Customization]
As always, check out the “Customization” section here should you need to customize the url display style.

Vim-Task 1.1

Thanks to tUrG0n, vim-task won’t suffer from the pathogen issue anymore from now on, and we also have a new feature which will prepend a “-” for a non-task line when toggling the task status.

So by toggling the task status, we’re now actually toggling between 3 statuses of the task:

  • blank: normal text
  • pending: -
  • completed: ✓

all with the same 1 keyboard shortcut as before, as always. So neat!

PS: Vim native regex i is pretty awkward to work with, unless you use some additional features ii, the regex will quickly become a mess, which maybe makes the person who reads your code thinks “wow, how complicated the regex is!”, but actually the truth is always: “well, it’s not, it’s just that ugly, man…”

[Footnotes]
  1. to make the script portable, substitute() method will always use the ‘magic’ option in the regex match []
  2. but we don’t want more dependencies though… []

Introducing SublimeTask (GTD)

[Overview]
We already have Vim-Task, now we need one task plugin for Sublime Text 2.

[Screenshot]
As always, I’m a fan of the mac default font monaco, unfortunately it doesn’t support bold and italic:

If you use font (e.g. Consolas) which support bold and italic and your current color scheme also support these highlighting, you can config the “scope” to display whatever style you want (see Customization section below).

[Code Repository]
github: https://github.com/samsonw/SublimeTask
Continue reading →

Vim-Task overhauled with native vim script support

Thanks to anfernee, vim-task now supports vim native script, which means +ruby compile option is not required any more in your vim instance.

This is great because the default vim package some Linux distributions (debian, ubuntu etc) distribute do NOT build with +ruby feature by default, which makes very frustrated experiences for these users. This commit simplifies the process and will eventually provide benefit in the long run.

If you’re a user of vim-task and not so into ruby, upgrade is highly recommended.

vim-task on vim.org

很多事情很难预料,比如 vim-task 这个两个小时捣鼓出来,写readme和 blog intro 都比写code来的时间长的玩物竟然是我个人在github上最 “popular” 的 project(其余的都鲜有人watch和fork),真是有意栽花花不成,无心插柳柳成荫,悲哉悲哉;

如此这般说明这东西值得更广的分享,于是10分钟前便有了放到 vim.org 的想法,然后2分钟后它便成功上了 vim.org i,最后还是希望它对真正感兴趣的人有用吧.

[Footnotes]
  1. wordpress你情何以堪…… []

From TextMate to MacVim: Markdown File Editing

Sunng号召大伙用markdown书写文档,这里积极响应一下~

TextMate out of box bundle了Markdown.tmbundle,所以默认就支持markdown file syntax,vim里面貌似默认没有那么幸运,也不是很确定,不过anyway,vim里面的default就是让你改的…

[Markdown Syntax Support]
具体markdown的syntax可以参见这里,这里不赘述。
市面上找到了不少关于vim markdown syntax的plugin(这个算不算是vim user幸福的烦恼?):
1. http://www.vim.org/scripts/script.php?script_id=1242 (http://github.com/plasticboy/vim-markdown)
2. http://github.com/tpope/vim-markdown
3. http://github.com/hallison/vim-markdown
4. http://github.com/mikewest/vim-markdown

make your choice then install it,你选择,你喜欢.

[Markdown Preview Support]
TextMate有个很nice的markdown preview功能,截图如下:


Continue reading →

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:

Continue reading →

From TextMate to MacVim: Vim installation

本文分成两部分,前半部分介绍用macports安装terminal版本的vim,后半部分介绍gui版本的MacVim的安装,一般不推荐在macports里面安装vim的gui variants,想象一下编译的时间……

[MacPorts Vim Installation]
MacPorts的Vim 3天前刚刚更新到7.3.3,为了安装最新的版本,我们需要首先更新同步一下macports的port file tree:

$ sudo port -v selfupdate

安装之前先查看一下这个Vim包的variants:

$ port variants vim
vim has the variants:
   athena: Build GUI version using Athena widgets
     * conflicts with gtk1 gtk2 motif
     * requires x11
   big: Build big feature set
     * conflicts with small tiny
   cscope: Enable source code browsing with cscope
   gtk1: Build GUI version using GTK 1.x widgets
     * conflicts with athena gtk2 motif
     * requires x11
   gtk2: Build GUI version using GTK 2.x widgets
     * conflicts with athena gtk1 motif
     * requires x11
   huge: Build huge feature set
     * conflicts with big small tiny
   motif: Build GUI version with Motif widgets
     * conflicts with athena gtk1 gtk2
     * requires x11
   nls: National Language Support
   perl: Enable Perl scripting
   python: Compatibility variant, requires +python25
     * requires python25
   python25: Enable Python scripting
     * conflicts with python26 python27 python31
   python26: Enable Python scripting
     * conflicts with python25 python27 python31
   python27: Enable Python scripting
     * conflicts with python25 python26 python31
   python31: Enable Python scripting
     * conflicts with python25 python26 python27
   ruby: Enable Ruby scripting
   small: Build small feature set
     * conflicts with tiny
   tcl: Enable Tcl scripting
   tiny: Build tiny feature set
   universal: Build for multiple architectures
   x: Compatibility variant, requires +x11
     * requires x11
   x11: Build CLI version with X support
   xim: Build with support for X Input Method

Continue reading →