5

I'm using clojure in MacVim with slimv.vim.

But when I start to write some clojure code my indent does not look good. It looks like this:

(def a
    (println "hello") 
     )

It makes me a little confused. I want to invalid auto insert parentheses. Do you have any idea?

Thanks in advance.

Conner
  • 30,144
  • 8
  • 52
  • 73
nobinobiru
  • 792
  • 12
  • 28

2 Answers2

11

Arthur already described ,(. Besides that you can turn off paredit globally in your .vimrc (let g:paredit_mode=0).

But if what you don't like is 'electric return' (i.e. there's an extra newline inserted before the closing paren), then you can disable it via let g:paredit_electric_return=0. Electric returns are gathered if you press ) at the end of the line. So if you press ) after (println "hello") then the next closing paren will jump up producing: (println "hello")).

Tamas Kovacs
  • 1,495
  • 7
  • 9
  • Fine! Even then I recommend that you give 'electric returns' a try. It makes linewise editing easier, you can just swap lines and you don't have to worry about the extra parens. Then at the end the closing parens in separate line(s) are just gathered, they don't remain in separate line(s). See [this](http://img8.imageshack.us/img8/9479/openparen.gif) for a demo. – Tamas Kovacs Jul 21 '12 at 07:58
1

it sounds like perhaps you are asking "how do I turn off paredit mode in slimv?"

this tutorial covers how to use paredit: http://kovisoft.bitbucket.org/tutorial.html

you can disable paredit mode by typing ,(

ps: paredit is really worth learning, though it can be frustrating while getting used to it

Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284