]> gitweb.factorcode.org Git - factor.git/blob - misc/vim/ftplugin/factor.vim
bb34b3a60d769014094c75d34690e682b6fb686d
[factor.git] / misc / vim / ftplugin / factor.vim
1 " Vim filetype plugin file
2 " Language: Factor
3 " Maintainer: Tim Allen <screwtape@froup.com>
4 " Last Change: 2011 Apr 05
5
6 " Only do this when not done yet for this buffer
7 if exists("b:did_ftplugin")
8     finish
9 endif
10 let b:did_ftplugin = 1
11
12 " Code formatting settings loosely adapted from:
13 " http://concatenative.org/wiki/view/Factor/Coding%20Style
14
15 " Tabs are not allowed in Factor source files; use four spaces instead.
16 setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
17
18 " Try to limit lines to 64 characters, except for documentation, which can be
19 " any length.
20 if expand("%:t") !~ "-docs\.factor$"
21     setlocal textwidth=64
22
23     " Mark anything in column 64 or beyond as a syntax error.
24     match Error /\%>63v.\+/
25 endif
26
27 " Teach Vim what comments look like.
28 setlocal comments+=b:!,b:#!