annotate runtime/ftplugin/clojure.vim @ 19872:8a7bede7b138 v8.2.0492

patch 8.2.0492: Vim9: some error messages not tested Commit: https://github.com/vim/vim/commit/a8c1770469504ae66c80bbdb03b6b31641215848 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 1 21:17:24 2020 +0200 patch 8.2.0492: Vim9: some error messages not tested Problem: Vim9: some error messages not tested. Solution: Add more tests. Remove dead code. Fix uncovered bugs.
author Bram Moolenaar <Bram@vim.org>
date Wed, 01 Apr 2020 21:30:03 +0200
parents 9f7bcc2c3b97
children 5b37a0bf7e3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
9644
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
2 " Language: Clojure
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
3 " Author: Meikel Brandmeyer <mb@kotka.de>
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 "
9644
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
5 " Maintainer: Sung Pae <self@sungpae.com>
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
6 " URL: https://github.com/guns/vim-clojure-static
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
7 " License: Same as Vim
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
8 " Last Change: 18 July 2016
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 if exists("b:did_ftplugin")
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
11 finish
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 let b:did_ftplugin = 1
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 let s:cpo_save = &cpo
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 set cpo&vim
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
18 let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<'
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
19
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
20 setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 " There will be false positives, but this is better than missing the whole set
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 " of user-defined def* definitions.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 setlocal define=\\v[(/]def(ault)@!\\S*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
26 " Remove 't' from 'formatoptions' to avoid auto-wrapping code.
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
27 setlocal formatoptions-=t
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 " Lisp comments are routinely nested (e.g. ;;; SECTION HEADING)
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 setlocal comments=n:;
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 setlocal commentstring=;\ %s
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
33 " Specially indented symbols from clojure.core and clojure.test.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
34 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
35 " Clojure symbols are indented in the defn style when they:
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
36 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
37 " * Define vars and anonymous functions
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
38 " * Create new lexical scopes or scopes with altered environments
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
39 " * Create conditional branches from a predicate function or value
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
40 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
41 " The arglists for these functions are generally in the form of [x & body];
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
42 " Functions that accept a flat list of forms do not treat the first argument
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
43 " specially and hence are not indented specially.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
44 "
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
45 " -*- LISPWORDS -*-
9644
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
46 " Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
47 setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
48
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 " Provide insert mode completions for special forms and clojure.core. As
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 " 'omnifunc' is set by popular Clojure REPL client plugins, we also set
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 " 'completefunc' so that the user has some form of completion available when
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 " 'omnifunc' is set and no REPL connection exists.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 for s:setting in ['omnifunc', 'completefunc']
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
54 if exists('&' . s:setting) && empty(eval('&' . s:setting))
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
55 execute 'setlocal ' . s:setting . '=clojurecomplete#Complete'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
56 let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
57 endif
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 endfor
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 " Take all directories of the CLOJURE_SOURCE_DIRS environment variable
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 " and add them to the path option.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 "
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 " This is a legacy option for VimClojure users.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 if exists('$CLOJURE_SOURCE_DIRS')
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
65 for s:dir in split($CLOJURE_SOURCE_DIRS, (has("win32") || has("win64")) ? ';' : ':')
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
66 let s:dir = fnameescape(s:dir)
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
67 " Whitespace escaping for Windows
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
68 let s:dir = substitute(s:dir, '\', '\\\\', 'g')
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
69 let s:dir = substitute(s:dir, '\ ', '\\ ', 'g')
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
70 execute "setlocal path+=" . s:dir . "/**"
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
71 endfor
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
72 let b:undo_ftplugin .= ' | setlocal path<'
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 " Skip brackets in ignored syntax regions when using the % command
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 if exists('loaded_matchit')
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
77 let b:match_words = &matchpairs
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
78 let b:match_skip = 's:comment\|string\|regex\|character'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
79 let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip'
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 " Win32 can filter files in the browse dialog
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 if has("gui_win32") && !exists("b:browsefilter")
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
84 let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" .
9644
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
85 \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" .
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
86 \ "Java Source Files (*.java)\t*.java\n" .
9f7bcc2c3b97 commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents: 5763
diff changeset
87 \ "All Files (*.*)\t*.*\n"
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
88 let b:undo_ftplugin .= ' | unlet! b:browsefilter'
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 let &cpo = s:cpo_save
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 unlet! s:cpo_save s:setting s:dir
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
95 " vim:sts=8:sw=8:ts=8:noet