how to stop extra line after paren?

67 views
Skip to first unread message

Paul Lam

unread,
Aug 14, 2012, 10:39:13 AM8/14/12
to vimcl...@googlegroups.com
Hi, I'm a new vim user. How do I stop the following behaviour?

(def a (b c)|) 
<press enter>
(def a (b c)
  |
)

I'd like to have
(def a (b c)
  |)

It's the same with surround.vim, it's padding extra space before and after the paren.

Meikel Brandmeyer

unread,
Aug 14, 2012, 5:07:57 PM8/14/12
to vimcl...@googlegroups.com
Hi,
This is behaviour is not induced by VimClojure. In fact I get here the second behaviour. Did you install something else? eg. paredit?

Kind regards
Meikel

signature.asc

Dave Ray

unread,
Aug 14, 2012, 5:11:42 PM8/14/12
to vimcl...@googlegroups.com
As Meikel suggests, it looks like you have paredit.vim installed. The
behavior you're seeing is it's "electric return" feature. As you type
closing parens, the extra line-feeds will be removed. It takes some
getting used to, but I kind of like it.

You can turn off this behavior either by removing paredit.vim, or just
disabling it in vimrc:

let g:paredit_mode = 0

Cheers,

Dave

Paul Lam

unread,
Aug 15, 2012, 4:31:40 AM8/15/12
to vimcl...@googlegroups.com
thanks guys! It's indeed paredit's electric return. I turned it off and the closing parens are no longer hanging

let g:paredit_electric_return = 0
Reply all
Reply to author
Forward
0 new messages