Skip to content

Commit 4263742

Browse files
authored
Merge pull request #162 from gonzoooooo/swift-support
Add Swift support
2 parents 26b91dd + 61e52d7 commit 4263742

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

after/ftplugin/swift/caw.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
" vim:foldmethod=marker:fen:
2+
scriptencoding utf-8
3+
4+
let b:caw_oneline_comment = '//'
5+
let b:caw_wrap_oneline_comment = ['/*', '*/']
6+
7+
if !exists('b:did_caw_ftplugin')
8+
if exists('b:undo_ftplugin')
9+
let b:undo_ftplugin .= ' | '
10+
else
11+
let b:undo_ftplugin = ''
12+
endif
13+
let b:undo_ftplugin .= 'unlet! b:caw_oneline_comment b:caw_wrap_oneline_comment b:caw_wrap_multiline_comment b:did_caw_ftplugin'
14+
let b:did_caw_ftplugin = 1
15+
endif

macros/generate-ftplugins.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ function! s:oneline() abort
266266
\ 'stp': '--',
267267
\ 'stylus': '//',
268268
\ 'swig': '//',
269+
\ 'swift': '//',
269270
\ 'systemd': '#',
270271
\ 'systemverilog': '//',
271272
\ 'tads': '//',
@@ -399,6 +400,7 @@ function! s:wrap_oneline() abort
399400
\ 'smil': ['<!', '>'],
400401
\ 'sml': ['(*', '*)'],
401402
\ 'swig': ['/*', '*/'],
403+
\ 'swift': ['/*', '*/'],
402404
\ 'systemverilog': ['/*', '*/'],
403405
\ 'tads': ['/*', '*/'],
404406
\ 'tsalt': ['/*', '*/'],

0 commit comments

Comments
 (0)