Vim - slimv : close-parenthesis position upon pressing enter

柔情痞子 提交于 2019-12-24 14:19:04

问题


I'm a vim user trying to learn common lisp. I run gvim on windows. I am trying to follow the slimv tutorial given here: http://kovisoft.bitbucket.org/tutorial.html

My question:suppose you type the following and press enter after :morse (the vertical bar denotes the cursor position)

(defpackage :morse|)

I get the following result (again the vertical bar '|' denotes the cursor position):

(defpackage :morse
  |
    )

Whereas I want the following result:

(defpackage :morse
  |)

so that I can continue to type to get the following:

(defpackage :morse
  (:use :common-lisp))

What should I do to get the result I want?

Many thanks in advance!


回答1:


Got it - the answer apparently lies in :help g:paredit_electric_return. I.e., insert the following in your _vimrc file:

let g:paredit_electric_return=1

Also see this feature in action:



来源:https://stackoverflow.com/questions/17239700/vim-slimv-close-parenthesis-position-upon-pressing-enter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!