vim切换字母大小写
vim tips

vim tips

流浪 posted @ 2007年8月10日 19:33 in Vim tips with tags vim 括号补全 , 5019 阅读

在北京实习时用过eclipse,对它的括号自动补全印像很深刻,当时觉得这东西太智能了。用了VIM后,寻找了一下相关脚本,网上有很多,但不尽人意。在水木的VI版找到了下面这个配置感觉比较好。记下来,以免下次配置丢失再去翻那几百页的贴子。

:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>

function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
Avatar_small
galeki 说:
2007年8月11日 07:31

已经把它们加到我的.vimrc中去了~

Avatar_small
流浪 说:
2007年8月12日 01:11
引用来自:galeki @ 2007年08月10日 11:31PM

已经把它们加到我的.vimrc中去了~

这代码以前可以用的.现在好像和我的某些插件有冲突...  

Avatar_small
galeki 说:
2007年8月14日 09:34

呵呵,我现在一个插件都没有用过,有什么好的插件吗?

Avatar_small
流浪 说:
2007年8月15日 01:05

我装的都是乱七八糟的,实用性的不很多。VIM不像emacs装了插件才能很好的工作。我感觉不装己经很强了。 我常用的两个是 calendar.vim, taglist.vim

Avatar_small
galeki 说:
2007年8月16日 00:48

嘿嘿,我去搜搜~

Avatar_small
lyanry 说:
2007年8月21日 09:24

代码出错了,少了 ESC 和 CR 键

Avatar_small
流浪 说:
2007年8月21日 19:36
引用来自:lyanry @ 2007年08月21日 01:24AM

代码出错了,少了 ESC 和 CR 键

果然。我发现这代码只能在gvim里用,vim里根本不起作用。  

Avatar_small
kelloggs family rewa 说:
2022年8月21日 22:39

Kellogg's Family Rewards 2021 :These free Kellogg's Family Rewards codes will help you fill your mailbox with free stuff that you use your points to redeem. This includes free gift cards, toys A LITTLE MORE OF WHAT YOU LOVE. kelloggs family rewards codes 2021 NEW Rice Krispies Treats® Homestyle Original and Chocolate bars are 50% bigger than our 22g Original bar 2021.

Avatar_small
Uttarakhand Board Qu 说:
2022年9月16日 18:41

Uttarakhand Board of School Education Board and various private intuitional subject experts of the state have designed and suggested UK Board 5th Class Model Paper 2023 Pdf with Mock Test Practice Questions for all languages of the course. Uttarakhand Board Question Paper Class 5 Term1 & Term 2 Exam Revision Question Bank with answers are suggested to the state board elementarily level primary school All Languages and Subjects of the Course for SCERT & NCERT Syllabus Hindi Medium, English Medium and Urdu Medium Students Studding in Government & Private Schools of the State.

Avatar_small
HDFC Credit Card Sta 说:
2022年11月15日 02:33

Credit cards are a significant payment card used by the cardholder to help to pay bills for goods and services. Today credit card is standard among many Indian citizens who opt to use the card from various merchant payments. HDFC Credit Card Status The HDFC Bank offers customers an easy and quick way of applying for a credit card. HDFC customers can apply online using the HDFC website or visit the bank for the offline process.

Avatar_small
wordle game 说:
2022年11月15日 21:57

This is an excellent article. This is, in my opinion, one of the best posts ever written. Your work is excellent and inspiring. Thank you very much.

Avatar_small
SBI life online prem 说:
2023年1月26日 23:22

SBI Life Insurance was founded in 2001 with an joint venture of BNP Paribas card and State Bank of India. It was SBI who got the insurance as a boost in India and since then everyone started to move towards the Insurance plans. SBI life online premium payment SBI Life Insurance and gets their future secure with predefine thinking. Insurance may considered an option in human life as to ensure their families stay safe on their back or won’t suffer during any case of emergency.

Avatar_small
comment jouer a robl 说:
2023年7月18日 18:49

Roblox est un réseau social construit sur Internet qui interagit avec l’industrie du jeu, les achats en ligne et les sites de médias sociaux. Ce type de plate-forme est idéal pour de nombreux types de jeux. comment jouer a roblox sans telecharger Les utilisateurs se réfèrent généralement à Roblox comme le meilleur univers de jeu virtuel. Sur Roblox, les joueurs peuvent participer et créer des concours, ainsi que se connecter avec d’autres joueurs via Internet.

Avatar_small
SCERT Odisha 5th Cl 说:
2023年7月19日 21:21

Odisha Board 5th Syllabus work to Promote the Advancement of Education in General, With the help of Syllabus, Students can easily make out what Topics to Focus on more, as it Provides the marks Distribution of each unit. They can Prepare their Study plan by Focusing on the Topics that carry more weight age.Here, we bring you the SCERT Odisha 5th new Syllabus 2024, We have Collected and SCERT Odisha 5th Class Syllabus 2024 Aggregated the Syllabus, so that Students can easily Access and Study them. The Language used in the Odisha Board Primary Syllabus 2024 are Simple and lucid. It tries to enhance the Visual Appeal and also to explain more complex concepts with the help of illustrations in the Syllabus.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter