annotate runtime/ftplugin/javascript.vim @ 20632:f8940db0dd14

Added tag v8.2.0869 for changeset d6827bd31d1d1652eabd1cf21e2b7f1f6f8110fd
author Bram Moolenaar <Bram@vim.org>
date Sun, 31 May 2020 23:15:04 +0200
parents 53938adac247
children bbca88cd13d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
2 " Language: Javascript
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
1623
53938adac247 updated for version 7.2a
vimboss
parents: 1125
diff changeset
4 " Last Change: 2008 Jun 15
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
5 " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/ftplugin/javascript.vim
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
6
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin")
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
8 finish
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
9 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
11
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
12 let s:cpo_save = &cpo
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
13 set cpo-=C
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
14
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
15 " Set 'formatoptions' to break comment lines but not other lines,
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
16 " " and insert the comment leader when hitting <CR> or using "o".
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
17 setlocal formatoptions-=t formatoptions+=croql
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
18
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
19 " Set completion with CTRL-X CTRL-O to autoloaded function.
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
20 if exists('&ofu')
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
21 setlocal omnifunc=javascriptcomplete#CompleteJS
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
22 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
23
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
24 " Set 'comments' to format dashed lists in comments.
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
25 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
26
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
27 setlocal commentstring=//%s
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
28
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
29 " Change the :browse e filter to primarily show Java-related files.
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
30 if has("gui_win32")
1623
53938adac247 updated for version 7.2a
vimboss
parents: 1125
diff changeset
31 let b:browsefilter="Javascript Files (*.js)\t*.js\n" .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
32 \ "All Files (*.*)\t*.*\n"
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
33 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
34
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
35 let b:undo_ftplugin = "setl fo< ofu< com< cms<"
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
36
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
37 let &cpo = s:cpo_save
96cd8222a819 updated for version 7.1a
vimboss
parents: 651
diff changeset
38 unlet s:cpo_save