aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/autoload/dist/ft.vim5
-rw-r--r--src/nvim/testdir/test_filetype.vim616
2 files changed, 333 insertions, 288 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 5d8734a625..aacecc521e 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -726,7 +726,7 @@ func dist#ft#FTperl()
endif
let save_cursor = getpos('.')
call cursor(1,1)
- let has_use = search('^use\s\s*\k', 'c', 30)
+ let has_use = search('^use\s\s*\k', 'c', 30) > 0
call setpos('.', save_cursor)
if has_use
setf perl
@@ -758,7 +758,8 @@ func dist#ft#FTtex()
let save_cursor = getpos('.')
call cursor(1,1)
let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
- if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
+ if firstNC > 0
+ " Check the next thousand lines for a LaTeX or ConTeXt keyword.
let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index d4e5563865..4ef35b3a46 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -731,101 +731,126 @@ func Test_setfiletype_completion()
call assert_equal('"setfiletype java javacc javascript javascriptreact', @:)
endfunc
-func Test_hook_file()
+"""""""""""""""""""""""""""""""""""""""""""""""""
+" Tests for specific extentions and filetypes.
+" Keep sorted.
+"""""""""""""""""""""""""""""""""""""""""""""""""
+
+func Test_bas_file()
filetype on
- call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
- split Xfile.hook
- call assert_equal('dosini', &filetype)
+ call writefile(['looks like BASIC'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('basic', &filetype)
bwipe!
- call writefile(['not pacman'], 'Xfile.hook')
- split Xfile.hook
- call assert_notequal('dosini', &filetype)
+ " Test dist#ft#FTbas()
+
+ let g:filetype_bas = 'freebasic'
+ split Xfile.bas
+ call assert_equal('freebasic', &filetype)
bwipe!
+ unlet g:filetype_bas
- call delete('Xfile.hook')
- filetype off
-endfunc
+ " FreeBASIC
-func Test_tf_file()
- filetype on
+ call writefile(["/' FreeBASIC multiline comment '/"], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('freebasic', &filetype)
+ bwipe!
- call writefile([';;; TF MUD client is super duper cool'], 'Xfile.tf')
- split Xfile.tf
- call assert_equal('tf', &filetype)
+ call writefile(['#define TESTING'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('freebasic', &filetype)
bwipe!
- call writefile(['provider "azurerm" {'], 'Xfile.tf')
- split Xfile.tf
- call assert_equal('terraform', &filetype)
+ call writefile(['option byval'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('freebasic', &filetype)
bwipe!
- call delete('Xfile.tf')
- filetype off
-endfunc
+ call writefile(['extern "C"'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('freebasic', &filetype)
+ bwipe!
+ " QB64
-func Test_ts_file()
- filetype on
+ call writefile(['$LET TESTING = 1'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('qb64', &filetype)
+ bwipe!
- call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts')
- split Xfile.ts
- call assert_equal('xml', &filetype)
+ call writefile(['OPTION _EXPLICIT'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('qb64', &filetype)
bwipe!
- call writefile(['// looks like Typescript'], 'Xfile.ts')
- split Xfile.ts
- call assert_equal('typescript', &filetype)
+ " Visual Basic
+
+ call writefile(['Attribute VB_NAME = "Testing"'], 'Xfile.bas')
+ split Xfile.bas
+ call assert_equal('vb', &filetype)
bwipe!
- call delete('Xfile.hook')
+ call delete('Xfile.bas')
filetype off
endfunc
-func Test_ttl_file()
+func Test_dep3patch_file()
filetype on
- call writefile(['@base <http://example.org/> .'], 'Xfile.ttl')
- split Xfile.ttl
- call assert_equal('turtle', &filetype)
- bwipe!
+ call assert_true(mkdir('debian/patches', 'p'))
- call writefile(['looks like Tera Term Language'], 'Xfile.ttl')
- split Xfile.ttl
- call assert_equal('teraterm', &filetype)
+ " series files are not patches
+ call writefile(['Description: some awesome patch'], 'debian/patches/series')
+ split debian/patches/series
+ call assert_notequal('dep3patch', &filetype)
bwipe!
- call delete('Xfile.ttl')
- filetype off
-endfunc
+ " diff/patch files without the right headers should still show up as ft=diff
+ call writefile([], 'debian/patches/foo.diff')
+ split debian/patches/foo.diff
+ call assert_equal('diff', &filetype)
+ bwipe!
-func Test_pp_file()
- filetype on
+ " Files with the right headers are detected as dep3patch, even if they don't
+ " have a diff/patch extension
+ call writefile(['Subject: dep3patches'], 'debian/patches/bar')
+ split debian/patches/bar
+ call assert_equal('dep3patch', &filetype)
+ bwipe!
- call writefile(['looks like puppet'], 'Xfile.pp')
- split Xfile.pp
- call assert_equal('puppet', &filetype)
+ " Files in sub-directories are detected
+ call assert_true(mkdir('debian/patches/s390x', 'p'))
+ call writefile(['Subject: dep3patches'], 'debian/patches/s390x/bar')
+ split debian/patches/s390x/bar
+ call assert_equal('dep3patch', &filetype)
bwipe!
- let g:filetype_pp = 'pascal'
- split Xfile.pp
- call assert_equal('pascal', &filetype)
+ " The detection stops when seeing the "header end" marker
+ call writefile(['---', 'Origin: the cloud'], 'debian/patches/baz')
+ split debian/patches/baz
+ call assert_notequal('dep3patch', &filetype)
bwipe!
- unlet g:filetype_pp
- " Test dist#ft#FTpp()
- call writefile(['{ pascal comment'], 'Xfile.pp')
- split Xfile.pp
- call assert_equal('pascal', &filetype)
+ call delete('debian', 'rf')
+endfunc
+
+func Test_dsl_file()
+ filetype on
+
+ call writefile([' <!doctype dsssl-spec ['], 'dslfile.dsl')
+ split dslfile.dsl
+ call assert_equal('dsl', &filetype)
bwipe!
- call writefile(['procedure pascal'], 'Xfile.pp')
- split Xfile.pp
- call assert_equal('pascal', &filetype)
+ call writefile(['workspace {'], 'dslfile.dsl')
+ split dslfile.dsl
+ call assert_equal('structurizr', &filetype)
bwipe!
- call delete('Xfile.pp')
+ call delete('dslfile.dsl')
filetype off
endfunc
@@ -866,20 +891,183 @@ func Test_ex_file()
filetype off
endfunc
-func Test_dsl_file()
+func Test_foam_file()
filetype on
+ call assert_true(mkdir('0', 'p'))
+ call assert_true(mkdir('0.orig', 'p'))
- call writefile([' <!doctype dsssl-spec ['], 'dslfile.dsl')
- split dslfile.dsl
- call assert_equal('dsl', &filetype)
+ call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict')
+ split Xfile1Dict
+ call assert_equal('foam', &filetype)
bwipe!
- call writefile(['workspace {'], 'dslfile.dsl')
- split dslfile.dsl
- call assert_equal('structurizr', &filetype)
+ call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict.something')
+ split Xfile1Dict.something
+ call assert_equal('foam', &filetype)
bwipe!
- call delete('dslfile.dsl')
+ call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
+ split XfileProperties
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
+ split XfileProperties.something
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
+ split XfileProperties
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
+ split XfileProperties.something
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call writefile(['FoamFile {', ' object something;'], '0/Xfile')
+ split 0/Xfile
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call writefile(['FoamFile {', ' object something;'], '0.orig/Xfile')
+ split 0.orig/Xfile
+ call assert_equal('foam', &filetype)
+ bwipe!
+
+ call delete('0', 'rf')
+ call delete('0.orig', 'rf')
+ call delete('Xfile1Dict')
+ call delete('Xfile1Dict.something')
+ call delete('XfileProperties')
+ call delete('XfileProperties.something')
+ filetype off
+endfunc
+
+func Test_frm_file()
+ filetype on
+
+ call writefile(['looks like FORM'], 'Xfile.frm')
+ split Xfile.frm
+ call assert_equal('form', &filetype)
+ bwipe!
+
+ " Test dist#ft#FTfrm()
+
+ let g:filetype_frm = 'form'
+ split Xfile.frm
+ call assert_equal('form', &filetype)
+ bwipe!
+ unlet g:filetype_frm
+
+ " Visual Basic
+
+ call writefile(['Begin VB.Form Form1'], 'Xfile.frm')
+ split Xfile.frm
+ call assert_equal('vb', &filetype)
+ bwipe!
+
+ call delete('Xfile.frm')
+ filetype off
+endfunc
+
+func Test_fs_file()
+ filetype on
+
+ call writefile(['looks like F#'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('fsharp', &filetype)
+ bwipe!
+
+ let g:filetype_fs = 'forth'
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+ unlet g:filetype_fs
+
+ " Test dist#ft#FTfs()
+
+ " Forth (Gforth)
+
+ call writefile(['( Forth inline comment )'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ call writefile(['.( Forth displayed inline comment )'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ call writefile(['\ Forth line comment'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ " empty line comment - no space required
+ call writefile(['\'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ call writefile(['\G Forth documentation comment '], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ call writefile([': squared ( n -- n^2 )', 'dup * ;'], 'Xfile.fs')
+ split Xfile.fs
+ call assert_equal('forth', &filetype)
+ bwipe!
+
+ call delete('Xfile.fs')
+ filetype off
+endfunc
+
+func Test_git_file()
+ filetype on
+
+ call assert_true(mkdir('Xrepo.git', 'p'))
+
+ call writefile([], 'Xrepo.git/HEAD')
+ split Xrepo.git/HEAD
+ call assert_equal('', &filetype)
+ bwipe!
+
+ call writefile(['0000000000000000000000000000000000000000'], 'Xrepo.git/HEAD')
+ split Xrepo.git/HEAD
+ call assert_equal('git', &filetype)
+ bwipe!
+
+ call writefile(['0000000000000000000000000000000000000000000000000000000000000000'], 'Xrepo.git/HEAD')
+ split Xrepo.git/HEAD
+ call assert_equal('git', &filetype)
+ bwipe!
+
+ call writefile(['ref: refs/heads/master'], 'Xrepo.git/HEAD')
+ split Xrepo.git/HEAD
+ call assert_equal('git', &filetype)
+ bwipe!
+
+ call delete('Xrepo.git', 'rf')
+ filetype off
+endfunc
+
+func Test_hook_file()
+ filetype on
+
+ call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_equal('dosini', &filetype)
+ bwipe!
+
+ call writefile(['not pacman'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_notequal('dosini', &filetype)
+ bwipe!
+
+ call delete('Xfile.hook')
filetype off
endfunc
@@ -983,111 +1171,6 @@ func Test_m_file()
filetype off
endfunc
-func Test_xpm_file()
- filetype on
-
- call writefile(['this is XPM2'], 'file.xpm')
- split file.xpm
- call assert_equal('xpm2', &filetype)
- bwipe!
-
- call delete('file.xpm')
- filetype off
-endfunc
-
-func Test_fs_file()
- filetype on
-
- call writefile(['looks like F#'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('fsharp', &filetype)
- bwipe!
-
- let g:filetype_fs = 'forth'
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
- unlet g:filetype_fs
-
- " Test dist#ft#FTfs()
-
- " Forth (Gforth)
-
- call writefile(['( Forth inline comment )'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- call writefile(['.( Forth displayed inline comment )'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- call writefile(['\ Forth line comment'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- " empty line comment - no space required
- call writefile(['\'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- call writefile(['\G Forth documentation comment '], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- call writefile([': squared ( n -- n^2 )', 'dup * ;'], 'Xfile.fs')
- split Xfile.fs
- call assert_equal('forth', &filetype)
- bwipe!
-
- call delete('Xfile.fs')
- filetype off
-endfunc
-
-func Test_dep3patch_file()
- filetype on
-
- call assert_true(mkdir('debian/patches', 'p'))
-
- " series files are not patches
- call writefile(['Description: some awesome patch'], 'debian/patches/series')
- split debian/patches/series
- call assert_notequal('dep3patch', &filetype)
- bwipe!
-
- " diff/patch files without the right headers should still show up as ft=diff
- call writefile([], 'debian/patches/foo.diff')
- split debian/patches/foo.diff
- call assert_equal('diff', &filetype)
- bwipe!
-
- " Files with the right headers are detected as dep3patch, even if they don't
- " have a diff/patch extension
- call writefile(['Subject: dep3patches'], 'debian/patches/bar')
- split debian/patches/bar
- call assert_equal('dep3patch', &filetype)
- bwipe!
-
- " Files in sub-directories are detected
- call assert_true(mkdir('debian/patches/s390x', 'p'))
- call writefile(['Subject: dep3patches'], 'debian/patches/s390x/bar')
- split debian/patches/s390x/bar
- call assert_equal('dep3patch', &filetype)
- bwipe!
-
- " The detection stops when seeing the "header end" marker
- call writefile(['---', 'Origin: the cloud'], 'debian/patches/baz')
- split debian/patches/baz
- call assert_notequal('dep3patch', &filetype)
- bwipe!
-
- call delete('debian', 'rf')
-endfunc
-
func Test_patch_file()
filetype on
@@ -1110,171 +1193,132 @@ func Test_patch_file()
filetype off
endfunc
-func Test_git_file()
+func Test_perl_file()
filetype on
- call assert_true(mkdir('Xrepo.git', 'p'))
-
- call writefile([], 'Xrepo.git/HEAD')
- split Xrepo.git/HEAD
- call assert_equal('', &filetype)
- bwipe!
-
- call writefile(['0000000000000000000000000000000000000000'], 'Xrepo.git/HEAD')
- split Xrepo.git/HEAD
- call assert_equal('git', &filetype)
- bwipe!
-
- call writefile(['0000000000000000000000000000000000000000000000000000000000000000'], 'Xrepo.git/HEAD')
- split Xrepo.git/HEAD
- call assert_equal('git', &filetype)
- bwipe!
+ " only tests one case, should do more
+ let lines =<< trim END
- call writefile(['ref: refs/heads/master'], 'Xrepo.git/HEAD')
- split Xrepo.git/HEAD
- call assert_equal('git', &filetype)
- bwipe!
+ use a
+ END
+ call writefile(lines, "Xfile.t")
+ split Xfile.t
+ call assert_equal('perl', &filetype)
+ bwipe
- call delete('Xrepo.git', 'rf')
+ call delete('Xfile.t')
filetype off
endfunc
-func Test_foam_file()
+func Test_pp_file()
filetype on
- call assert_true(mkdir('0', 'p'))
- call assert_true(mkdir('0.orig', 'p'))
- call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict')
- split Xfile1Dict
- call assert_equal('foam', &filetype)
+ call writefile(['looks like puppet'], 'Xfile.pp')
+ split Xfile.pp
+ call assert_equal('puppet', &filetype)
bwipe!
- call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict.something')
- split Xfile1Dict.something
- call assert_equal('foam', &filetype)
+ let g:filetype_pp = 'pascal'
+ split Xfile.pp
+ call assert_equal('pascal', &filetype)
bwipe!
+ unlet g:filetype_pp
- call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
- split XfileProperties
- call assert_equal('foam', &filetype)
+ " Test dist#ft#FTpp()
+ call writefile(['{ pascal comment'], 'Xfile.pp')
+ split Xfile.pp
+ call assert_equal('pascal', &filetype)
bwipe!
- call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
- split XfileProperties.something
- call assert_equal('foam', &filetype)
+ call writefile(['procedure pascal'], 'Xfile.pp')
+ split Xfile.pp
+ call assert_equal('pascal', &filetype)
bwipe!
- call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
- split XfileProperties
- call assert_equal('foam', &filetype)
- bwipe!
+ call delete('Xfile.pp')
+ filetype off
+endfunc
- call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
- split XfileProperties.something
- call assert_equal('foam', &filetype)
- bwipe!
+func Test_tex_file()
+ filetype on
- call writefile(['FoamFile {', ' object something;'], '0/Xfile')
- split 0/Xfile
- call assert_equal('foam', &filetype)
- bwipe!
+ " only tests one case, should do more
+ let lines =<< trim END
+ % This is a sentence.
- call writefile(['FoamFile {', ' object something;'], '0.orig/Xfile')
- split 0.orig/Xfile
- call assert_equal('foam', &filetype)
- bwipe!
+ This is a sentence.
+ END
+ call writefile(lines, "Xfile.tex")
+ split Xfile.tex
+ call assert_equal('plaintex', &filetype)
+ bwipe
- call delete('0', 'rf')
- call delete('0.orig', 'rf')
+ call delete('Xfile.tex')
filetype off
endfunc
-func Test_bas_file()
+func Test_tf_file()
filetype on
- call writefile(['looks like BASIC'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('basic', &filetype)
+ call writefile([';;; TF MUD client is super duper cool'], 'Xfile.tf')
+ split Xfile.tf
+ call assert_equal('tf', &filetype)
bwipe!
- " Test dist#ft#FTbas()
-
- let g:filetype_bas = 'freebasic'
- split Xfile.bas
- call assert_equal('freebasic', &filetype)
+ call writefile(['provider "azurerm" {'], 'Xfile.tf')
+ split Xfile.tf
+ call assert_equal('terraform', &filetype)
bwipe!
- unlet g:filetype_bas
- " FreeBASIC
-
- call writefile(["/' FreeBASIC multiline comment '/"], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('freebasic', &filetype)
- bwipe!
+ call delete('Xfile.tf')
+ filetype off
+endfunc
- call writefile(['#define TESTING'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('freebasic', &filetype)
- bwipe!
+func Test_ts_file()
+ filetype on
- call writefile(['option byval'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('freebasic', &filetype)
+ call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts')
+ split Xfile.ts
+ call assert_equal('xml', &filetype)
bwipe!
- call writefile(['extern "C"'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('freebasic', &filetype)
+ call writefile(['// looks like Typescript'], 'Xfile.ts')
+ split Xfile.ts
+ call assert_equal('typescript', &filetype)
bwipe!
- " QB64
+ call delete('Xfile.ts')
+ filetype off
+endfunc
- call writefile(['$LET TESTING = 1'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('qb64', &filetype)
- bwipe!
+func Test_ttl_file()
+ filetype on
- call writefile(['OPTION _EXPLICIT'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('qb64', &filetype)
+ call writefile(['@base <http://example.org/> .'], 'Xfile.ttl')
+ split Xfile.ttl
+ call assert_equal('turtle', &filetype)
bwipe!
- " Visual Basic
-
- call writefile(['Attribute VB_NAME = "Testing"'], 'Xfile.bas')
- split Xfile.bas
- call assert_equal('vb', &filetype)
+ call writefile(['looks like Tera Term Language'], 'Xfile.ttl')
+ split Xfile.ttl
+ call assert_equal('teraterm', &filetype)
bwipe!
- call delete('Xfile.bas')
+ call delete('Xfile.ttl')
filetype off
endfunc
-func Test_frm_file()
+func Test_xpm_file()
filetype on
- call writefile(['looks like FORM'], 'Xfile.frm')
- split Xfile.frm
- call assert_equal('form', &filetype)
- bwipe!
-
- " Test dist#ft#FTfrm()
-
- let g:filetype_frm = 'form'
- split Xfile.frm
- call assert_equal('form', &filetype)
- bwipe!
- unlet g:filetype_frm
-
- " Visual Basic
-
- call writefile(['Begin VB.Form Form1'], 'Xfile.frm')
- split Xfile.frm
- call assert_equal('vb', &filetype)
+ call writefile(['this is XPM2'], 'file.xpm')
+ split file.xpm
+ call assert_equal('xpm2', &filetype)
bwipe!
- call delete('Xfile.frm')
+ call delete('file.xpm')
filetype off
endfunc
+
" vim: shiftwidth=2 sts=2 expandtab