Giter Site home page Giter Site logo

vim-clojure-static's People

Contributors

bk2204 avatar bounceme avatar cemerick avatar deraen avatar ethewalt avatar guns avatar jballanc avatar michaelblume avatar noprompt avatar nwjsmith avatar raymond-w-ko avatar sethyuan avatar skanev avatar tchagnon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-clojure-static's Issues

Using <! from core.async cause false error highlighting on closing parens.

When vim-clojure-static is installed, using <! causes false red error highlighting at the end of go blocks and some others forms.

To see the error open https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/master/1.Simple-Producer-Consumer/simple-core-async/src/simple_core_async/core.clj with vim-clojure static installed.

You will see error highlighting on the final three parens of the go blocks and final two parens of the main function.

When I uninstall vim-clojure-static the problem goes away.

Names with ' in them are not colored correctly

Not sure if this is a vim-clojure-static or vim-clojure-highlight issue.

Names that contain ' become clojureSymbol instead of clojureFunc when using vim-clojure-highlight.

Also, another problem with ' is the following:

(defn some-func [args] body)

(defn some-other-func [args]
  (let [some-func' (fn ...)]
    ...))

In this case, the some-func part of the name some-func' becomes clojureFunc while the ' becomes clojureQuote, resulting in a name with two colors in it, which can be confusing. Normally, the name in the let should be a clojureSymbol, but it seems that because some-func is also a function this happens somehow.

Indenter thinks comments are function arguments

There are (primarily) two different ways that function arguments are indented in Clojure:

(function
  arg arg arg)

(function arg
          arg
          arg)

Now, when I put a comment directly after the function name, vim-clojure-static thinks that it is an argument:

(function ; comment
          arg
          arg)

I think this would make more sense:

(function ; comment
  arg
  arg)

Syntax highlighting for #_ reader macro

This reader macro effectively comments out the following form; it would be nice if there was syntax highlighting to reflect this. I realize this might be a bit challenging, since a form might span multiple lines, but it would still be helpful.

Indentation not working with rainbow_parentheses

Installing rainbow_parentheses (https://github.com/kien/rainbow_parentheses.vim) breaks the indentation of vim-clojure-static.

Without rainbow_parentheses indentation works fine. After installting rainbow_parentheses, the auto-indentation just removes all indentation.

:echo GetClojureIndent() returns 0 for every line

Indentation still works fine for non-clojure files after installing the rainbow_parens.

I just switched from VimClojure to vim-clojure-static. Rainbow parens worked fine with VimClojure.

Incompatible with delimitMate

I use delimitMate to automatically insert matched pairs for (, {, [, and " characters. That plugin doesn't seem to operate correctly (eg doesn't insert characters into the buffer automatically) when used in conjunction with vim-clojure-static and I'm having a hard time pinning down why. Any direction on getting them to play nice would be greatly appreciated.

Thanks for all your hard work!

ClojureScript keywords?

I'm not sure where this should go, if anywhere, but I thought it might be worth adding the special ClojureScript builtins when working with *.cljs files. I've added this to ftplugin/clojure.vim in my personal clone:

au BufEnter,BufNewFile, *.cljs syntax keyword clojureSpecial js-obj array clj->js js->clj

I'm not sure if that's the right place or even if it's the right way to go about doing this sort of thing. Any thoughts?

Error with processing function

I recently installed both vim-fireplace and vim-clojure-static and keep running into an issue when opening a Clojure file within Vim. The stack trace looks like the following:

4018 Searching for "/Users/Serenity/.vim/bundle/vim-clojure-static/after/compiler/lein.vim"
4019 Error detected while processing function <SNR>78_activate..<SNR>78_path:
4020 line   17:
4021 E15: Invalid expression:▫
4022 Error detected while processing function <SNR>78_activate:
4023 line    7:
4024 E714: List required
4025 Executing BufWinEnter Auto commands for "*"
4026 autocommand call ResCur()

I was wondering if maybe I installed something incorrectly. Any help would be awesome!

Indention Support for Speclj

When using the Speclj testing framework with this plugin, the indentation is off. It doesn't recognize the components and doesn't indent properly.

Weird behaviour of -> and ->> indention inside defn

Hi, I love current indention of -> and ->> but I found something strange when I'm trying to use -> or ->> inside defn

(defn a [b]
  (-> k
            z
            d
            c))

(defn z [k]
  (->> a
            b
            c))

(defn z []
  (->> a
           (-> a
         b
         c
         z)))

But it's ok when argument list is on separate line:

(defn a
  [b]
  (-> a
      b
      c))

Also nested -> or ->> usage can be indented in the wrong way:

(-> a
    b
    (->> map
      (fun)
      k)
    i)

vim version is 7.3.875

Btw thanks for keeping vim and clojure together! :)

Indentation seems to be wrong

In the docs the correct indentation is two spaces, but having installed this plugin, i'm getting four spaces instead, like so:

omk3g

Suggestions about customizing keyword classification, lispwords, specialcaseworkers

Hey!

I read on the vimclojure google group that you would like input on syntax and indentation. I have a few suggestions regarding customization. I have kind of an OCD about the look of my code, and I would like vim-clojure-static to be more customizable about how it handles:

  • keyword classification, for example I would like let and def to be part of clojureDefine instead of clojureSpecial.
  • lispwords, I would like to be able to easily add to the lispwords.
  • specialcaseworkers, I would like to be able to easily add to the specialcaseworkers, like letfn and deftype.

I don't know much vimscript at all, so I don't know how to best implement this customization.

Also, I liked that vimclojure did rainbow parens, because it worked better than rainbow_parentheses.vim that you suggest. The latter does not color parens inside vectors, e.g. inside let bindings. And even if it did, I liked how the coloring restarted inside vectors with vimclojure, and I'm not sure that would work that well with a plugin that was unaware of the syntax of clojure code.

Always indent two spaces option?

I saw recently that in the the Clojure emacs indentation plugin they added an option for "always indent two spaces", which solves the problem of userland macros not being properly supported in your editor.

It's been something that's bothered me for a while, wondering if this might be something someone could pull off for this project.

ftdetect not working

Hello,
I installed this via Vundle but it doesn't seem like syntax or filetype are set properly. They would work if I manually set them in the file but not auto-detected.

Clojure 1.7 support

Please re-run your generator with Clojure 1.7. There are several new core functions that are not currently highlighted. Thanks!

Remove "formatoptions+=croql" setting

I'm opening this issue to make you aware of current vim_dev discussion concerning the boilerplate

formatoptions+=croql

in the filetype plugin.

There's an initiative to remove this boilerplate from ftplugins because it is (as you remark in the comment) "arguably intrusive". Perhaps you would like to join in?

Duplicate tags in doc/clojure.txt

Hello, I autogen tags on startup using call pathogen#helptags(), and it is reporting that there are some duplicate tags. This fix is pretty easy, just convert * to |

diff --git a/doc/clojure.txt b/doc/clojure.txt
index 2c12545..e8d5b40 100644
--- a/doc/clojure.txt
+++ b/doc/clojure.txt
@@ -79,7 +79,7 @@ fuzzy indent feature. The defaults are:
     let g:clojure_fuzzy_indent_patterns = 'with.*,def.*,let.*'
 <

-*g:clojure_fuzzy_indent_patterns* and *g:clojure_fuzzy_indent_blacklist* are
+|g:clojure_fuzzy_indent_patterns| and |g:clojure_fuzzy_indent_blacklist| are
 *Lists* of patterns that will be matched against the unqualified symbol at the
 head of a list. This means that a pattern like "^foo" will match all these
 candidates: "foobar", "my.ns/foobar", and "#'foobar".
@@ -87,8 +87,8 @@ candidates: "foobar", "my.ns/foobar", and "#'foobar".
 Each candidate word is tested for special treatment in this order:

     1. Return true if word is literally in 'lispwords'
-    2. Return false if word matches a pattern in *g:clojure_fuzzy_indent_blacklist*
-    3. Return true if word matches a pattern in *g:clojure_fuzzy_indent_patterns*
+    2. Return false if word matches a pattern in |g:clojure_fuzzy_indent_blacklist|
+    3. Return true if word matches a pattern in |g:clojure_fuzzy_indent_patterns|
     4. Return false and indent normally otherwise

                                           *g:clojure_special_indent_words*

Incorrect indentation for *

I noticed that I get incorrect indentation for the following form:

(* (func arg
     more-args))

Should be similar to:

(+ (func arg
         more-args))

That is at the top level, in an otherwise empty file. It's like * acts as a special indent word; without * wrapping it,

(func arg
      more-args)

indents correctly. I'm using these settings:

let g:clojure_fuzzy_indent = 1
let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let', '^while-let$',
            \'call-update-fns', 'start-new-thread']
let g:clojure_fuzzy_indent_blacklist = ['-fn$', '\v^with-%(meta|out-str|loading-context)$']
let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn,deftype-'
let g:clojure_align_multiline_strings = 1

Using version: b802e88

Plugin seems to only work in the context of a project

This may have been what was behind #61. Much more appears not to work outside the context of a project though, including indentation. This makes it difficult to work with scripts via lein-exec, or for sketching out quick code demonstrations.

Backslashes in character classes confuse regex support

This is not highlighted properly:

#"[\\]"

i.e. the closing quote is not colored to match the opening quote. And, though I don't understand how it happens, a regex containing a backslash in a character class causes paredit to "fail" anywhere later in the same file (i.e. matching pairs of parens or brackets aren't inserted); removing the regex in question makes paredit work properly again.

FWIW, the real-world regex I had in a file that prompted this issue was #"[/\\]([^/\\]+)$".

Switching between Clojure and Scheme buffers breaks indentation settings

I'm not sure if this is a bug in vim-clojure-static, Vim itself, or something else. In a freshly opened Vim (7.3), if I open a Scheme file before anything else, I get the correct indentation for Scheme code. If I then switch to a Clojure buffer, nothing is indented correctly; as if it still thinks I'm editing Scheme (e.g. the (:require ... ) forms in a (ns ... ) are indented aligned with the namespace name, instead of under the 's'.

Likewise, if the first buffer I open is a Clojure buffer, my Clojure code is indented correctly, but when I switch to a Scheme buffer, it refuses to indent correctly (e.g. the body of a (define (x y z) ... ) form indents in line with the parameter list.

gf/ctlr-o clobbers iskeyword

(moved from vim-foreplay issue 24)

hmmm... I just did it with a clean .vim dir. Here's what I did:

$ cd
$ mv .vim .vim.old
$ mkdir -p .vim/autoload .vim/bundle

Next, I set up .vimrc, pathogen, vim-clojure-static, and vim-foreplay as described in their readmes. Then:

$ git clone git://github.com/daveray/cljpp.git
$ cd cljpp
$ lein2 repl

in another term:

$ cd cljpp
$ vim src/cljpp/core.clj

and then:

  • verify that . is a keyword char because e skips over cljpp.core rather than stopping at the .
  • Hit gf while the cursor is on clojure.pprint
  • Hit ctrl-o to jump back to core.clj
  • verify that e now stops at . chars

Is there additional diagnostic info I can provide about my config? FWIW, here's the output of :scriptnames:

  1: /Applications/MacVim.app/Contents/Resources/vim/vimrc
  2: ~/.vimrc
  3: ~/.vim/vimrc.vim
  4: ~/.vim/autoload/pathogen.vim
  5: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
  6: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
  7: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
  8: /Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
  9: ~/.vim/bundle/vim-clojure-static/ftdetect/clojure.vim
 10: /Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
 11: /Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
 12: ~/.vim/bundle/vim-foreplay/plugin/foreplay.vim
 13: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
 14: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
 15: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
 16: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
 17: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
 18: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
 19: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
 20: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
 21: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
 22: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim
 23: /Applications/MacVim.app/Contents/Resources/vim/runtime/scripts.vim
 24: ~/.vim/bundle/vim-clojure-static/syntax/clojure.vim
 25: ~/.vim/bundle/vim-clojure-static/ftplugin/clojure.vim
 26: ~/.vim/bundle/vim-clojure-static/indent/clojure.vim
 27: ~/.vim/bundle/vim-foreplay/autoload/classpath.vim
 28: ~/.vim/bundle/vim-foreplay/autoload/nrepl/foreplay_connection.vim

Clojure 1.5 symbols

I noticed that some alpha versions of Clojure 1.5 symbols are recognized, but not the complete list of 1.5 RC1 symbols. For example test-> and test->> were renamed to cond-> and cond->>.

Here's the complete list of vars from core that match :added "1.5":

fn set-agent-send-executor!
fn set-agent-send-off-executor!
fn reduced
fn reduced?
macro test->
macro test->>
macro let->
macro when->
macro when->>
var *data-readers*

install instructions

could you give some install instructions in the readme? i installed this with vundle, and everything seems to be working fine

Respect word boundaries

For instance, if I defined a local variable with (let [some-stuff (what have you)] (do things with some-stuff)), the some within some-stuff becomes highlighted, suggesting that word boundaries are not being looked at for keyword matches.

Appending to lispwords in .vimrc breaks lispwords

Hey, thanks for your work on vim-clojure-static. Definitely a timesaver for me!

I've stripped down my .vimrc file to an approximately minimal example:

set nocompatible
execute pathogen#infect()
filetype plugin indent on
syntax on

When I open a .clj file in Vim, everything works as expected, and I can type :set lispwords? to get:

lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,
definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecor
d,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,e
xtend-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-binding
s,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-f
n,with-test

…which looks good to me.

However, when I add the following line to my .vimrc:

autocmd FileType clojure set lispwords+=log-wrap

…I can quit Vim, open up the same .clj file, and get lispwords equal to:

lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do
*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparame
ter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolis
t,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple
-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless
,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with
-output-to-string,with-package-iterator,define-condition,handler-bind,handler-ca
se,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-wa
rning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defcl
ass,defmethod,print-unreadable-object,log-wrap

As you can see, in this case, lispwords is its default value, plus log-wrap. As you can imagine, this means my Vim experience involves a lot of manual indentation.

Any idea what's going on here?

For what it's worth, I have Vim version 7.4, and I'm running on the latest version of this plugin.

Project status

Hi, @guns

Seems like this project has been quite inactive lately and there are several open PR's that would fix some minor problems.

I just created an clojure-vim Github organization which I hope will be home for some Vim Clojure plugins and where me and other Vim users can provide the plugins with active maintenance. What do you think about this?

There are at least two possibilities:

  • I fork or copy the repo to the org, and manually merge/copy interesting PRs and issues. If you want, you could link the the new repo here.
  • I'll invite you to the org and you can transfer the repo.

I don't have strong opinions and both should be as easy to implement.

The left paren character messes with indentation

This actually made me laugh when it happened:

(defn factor [s]
  (when (= \( (first s))
           (emitln (str "MOVE #" (get-number s) ",D0"))))

The emitln form is the body of the when call. I tried taking a stab at the indent file myself, but my familiarity with the Vim API is not up to snuff. Sorry. 😕

Indentation of docstrings

This has always bugged the crap out of me. With vim-clojure-static (and old vimclojure), docstrings with multiple lines get indented like this:

(defn to-booleany
  "Convert numbers and various representations of 'true' and 'false'
  to their actual true or false counterparts."
  [s]
...)

Whereas in Emacs, it gets indented like this:

(defn to-booleany
  "Convert numbers and various representations of 'true' and 'false'
   to their actual true or false counterparts."
...)

I recall bringing this up with Meikel at some point, but don't remember why it was never changed.

I just wanted to bring this up to get your thoughts on it, because I much prefer the way Emacs does things, and working with Emacs coworkers I'd really love it if it didn't get changed every time I =a( their code that I'm editing. It'd be nice if it were at least an option or something.

Suddenly, strange issues with indentation

If I take a line line this:

(re-seq #"[A-Z]" (clojure.string/upper-case c)))

and break up the two arguments, I get this:

(re-seq #"[A-Z]"
                  (clojure.string/upper-case c)))

I've noticed it with several other forms and it appears that arguments after newlines always want to start at the 20th column. I'm up-to-date with master, and I get the same result with both Clojure 1.4.0 and 1.5.1.

When spell check is enabled, should apply only to comments

Created on behalf of Nick Barkas:

I usually have spell checking enabled in vim, and it looks like vim will try to spell check the whole file (I'm using vim 7.3
on OS X). This doesn't look too nice if you have all kinds of keywords and such that aren't real words in your human
language of choice getting highlighted for being misspelled. I've attached a tiny patch to vimclojure's syntax
highlighting file that should fix this for users who have spell check on, so it will only apply to comments.

Edit: I'm too stupid to attach a patch. So here it is inline:

diff -r 22bbb523b401 vim/syntax/clojure.vim
--- a/vim/syntax/clojure.vim    Fri Sep 21 00:07:28 2012 +0200
+++ b/vim/syntax/clojure.vim    Sat Jan 05 00:32:37 2013 -0500
@@ -180,7 +180,7 @@
 syn cluster clojureTopCluster    contains=@clojureAtomCluster,clojureComment,clojureSexp,clojureAnonFn,clojureVector,clojureMap,clojureSet

 syn keyword clojureTodo contained FIXME XXX TODO FIXME: XXX: TODO:
-syn match   clojureComment contains=clojureTodo ";.*$"
+syn match   clojureComment contains=clojureTodo,@Spell ";.*$"

 syn match   clojureKeyword "\c:\{1,2}[a-z0-9?!\-_+*.=<>#$]\+\(/[a-z0-9?!\-_+*.=<>#$]\+\)\?"

Default indentation of list subforms

From an email, shared with permission:

On Fri 13 Dec 2013 at 04:46:33PM +0100, Michael Sappler wrote:

In my software team, some people use Emacs and some use Vim for
clojure development and the auto-indentation produces different
results. Basically I am asking if vim-clojure-static can be made to
behave a like clojure-mode of emacs.

The case is documented here: https://github.com/clojure-emacs/clojure-mode#indentation-options

vim-clojure-static does this:

(my-foo-fn
  a
  b
  c)

and emacs clojure-mode this:

(my-foo-fn
 a
 b
 c)

It appears to me that emacs is indenting incorrectly in this case. The
documentation you linked reads:

… "defun" indentation …

i. Known special forms (e.g. case, try, etc)

ii. Nearly all "core" macros that ship as part of Clojure itself

iii. Userland macros (and any other form?) that are locally
registered via put-clojure-indent, define-clojure-indent (helpers
for adding mappings to clojure-indent-function)

The difference between defun indentation and list indentation is that
subforms are indented two spaces to signify that the outer form is a
function call. Lists of things:

'(a
  b
  c)

are aligned to the opening paren to signify that it is data.

Since you are calling my-foo-fn in your example, the proper
indentation style is defun-indent. The documentation indicates that
you can add custom symbols to the set of defun-indented symbols via
put-clojure-indent and define-clojure-indent, so this is not a
shortcoming in clojure-emacs.

IMO, defaulting to defun-indent instead of list-indent for
paren-delimited compound forms is a sensible choice in Clojure as
PersistentLists are most often created with the list function due to
the inconvenience of unquoting forms.

This is not necessarily true in CL or Scheme, so the opposite default is
probably more suitable for those languages.

Now, in the context presented, you are proposing to change the default
indentation of newline-separated paren-delimited forms to list-indent.
I do not think this is a wise change for the reasons above, but I am
always open to being convinced otherwise.

cf. a similar issue regarding defun-indent for vectors:

#13

add indentation and coloring for specify

Specify is a macro available in clojurescript.
It works just like extend-protocol for coloring and indentation.

Here is an example

(specify (MyRecord. "John" )
    IHello
    (hello [self]
       (js/console.log (str "Hello " (:name self) "!"))))

Edit : hum sorry this was intended for clojure-mode.... Embarassing...

Indention of nested vectors

When working with hiccup I often end up with multiple nested vectors. Usually for each nesting level a space is added what makes sense if values would be contained. However I would like a increased indention by two spaces. Is that somehow possible currently or what do you think about that?

What is:

[:p
 |

What should be:

[:p
  |

Doc shortcut for vim-fireplace broken in vim-clojure-static for namespaced symbols

For example, if I (require [clojure.core.async :as async]), place the cursor over async/timeout and hit K, I either get :Doc async or :Doc timeout (depending on which character I'm over). I should be getting :Doc async/timeout, and used to observe this behavior before switching from vimclojure to vim-clojure-static. I'm guessing a word definition has changed?

Indentation for -> and ->>

If I type (->> entities and hit enter, I expect the cursor to be where the | is here:

(->> entities
  |

but it ends up aligned under the start of entities. Same for ->. Is there a way to get that behavior? That's what vimclojure did.

Setting completefunc interferes with neocomplcache

It appears that setting completefunc is interfering with the ability to use neocomplcache.

Steps to reproduce:
Open a new file and enter (def
screen shot 2013-09-24 at 10 08 35 pm
screen shot 2013-09-24 at 10 08 53 pm

Commenting out the following code in vim-clojure-static/ftplugin/clojure.vim appears to remove the error and allows neocomplcache to offer completion suggestions as desired.

for s:setting in ['omnifunc', 'completefunc']
    if exists('&' . s:setting) && empty(eval('&' . s:setting))
        execute 'setlocal ' . s:setting . '=clojurecomplete#Complete'
        let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<'
    endif
endfor

Semicolons inside strings are interpreted as comments

I just tried the following:

In my buffer I have
(defn test [] "some; string"
"another ; string"
nil)

I place my cursor over 'defn' and type 'cqq' to have the function evaluated, what I get in the command window is:
@(defn test [] "some "another nil)

Best wishes,

Dave.

Indenting after lonely parens/brackets

Sometimes, I want to write code that looks like this:

(foo bar [

  some
  long

  list
  of
  stuff

])

It's bad style for small cases, but much nicer for long lists, particularly with extra whitespace and whatnot.

Right now, if you press <cr> after a naked (, [, or {, you get something like this:

(foo bar [
          |

Where the | stands for the cursor. Worse, if you forcibly outdent, type some, then press <cr> again, you get this:

(foo bar [
  {:some "kinda" :thing "here"}
          |

Ideally, pressing return after naked braces would indent 2 spaces. Alternatively, the indenting should prefer to align with the previous line, not the most recent open-bracket.

clojure_fuzzy_indent_patterns not working?

Trying to add a pattern for 2-space indenting, and not having any success. I want to change this:

(dom/div #js {:className "myClass"}
         "Text")

to auto-indent like this:

(dom/div #js {:className "myClass"}
  "Text")

My .vimrc specifies:

let g:clojure_fuzzy_indent = 1
let g:clojure_fuzzy_indent_patterns = ['^dom']

...but indenting never changes. Incidentally, I am able to successfully add to :clojure_special_indent_words, and see indenting change, but this is not practical here as there are too many methods to add like that.

Is this my error, or a bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.