I am using the AutoClose plugin for vim and I was trying to add my own custom feature which will close my <%
with %>
but right now when it is closing my cursor is being placed in the middle of the %
and >
therefore I have to go back with the arrow keys. Does anyone know how to fix this? Right now I have this line in the autoclose.vim
file:
let s:charsToClose = {"<% ": " %>", "<%= ": " %>"}
I am using the AutoClose plugin by Thiago Alves found here: http://www.vim.org/scripts/script.php?script_id=2009
This is a bit rough but it works here.
After adding your pairs to
let s:charsToClose = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'","<% ": " %>", "<%= ": " %>"}
Change line 75 from:
let l:result .= s:charsToClose[a:char] . "\<Left>"
to:
if len(a:char) > 1
let l:result .= s:charsToClose[a:char] . "\<Left>\<Left>\<left>"
else
let l:result .= s:charsToClose[a:char] . "\<Left>"
endif
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.