Vim-Slimv:按下回车键时括号括起来的位置 [英] Vim - slimv : close-parenthesis position upon pressing enter

查看:84
本文介绍了Vim-Slimv:按下回车键时括号括起来的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个Vim用户,试图学习常见的Lisp。我在Windows上运行gvim。我正在尝试遵循此处给出的slimv教程:



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!

解决方案

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:

这篇关于Vim-Slimv:按下回车键时括号括起来的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆