File tree Expand file tree Collapse file tree 2 files changed +38
-3
lines changed Expand file tree Collapse file tree 2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,35 @@ Compatible with Vimwiki - [issue #19](https://github.com/jiangmiao/auto-pairs/is
242
242
243
243
Description: When works with vimwiki `<CR>` will output `<SNR>xx_CR()`
244
244
Reason: vimwiki uses `<expr>` on mapping `<CR>` that auto-pairs cannot expanding.
245
- Solution: add `let g:AutoPairsMapCR = 0` to .vimrc to disable `<CR>` mapping.
245
+ Solution A: Add
246
+
247
+ " Copy from vimwiki.vim s:CR function for CR remapping
248
+ function! VimwikiCR()
249
+ let res = vimwiki#lst#kbd_cr()
250
+ if res == "\<CR>" && g:vimwiki_table_mappings
251
+ let res = vimwiki#tbl#kbd_cr()
252
+ endif
253
+ return res
254
+ endfunction
255
+ autocmd filetype vimwiki inoremap <buffer> <silent> <CR> <C-R>=VimwikiCR()<CR><C-R>=AutoPairsReturn()<CR>
256
+
257
+ to .vimrc, it will make vimwiki and auto-pairs 'Return' feature works together.
258
+
259
+ Solution B: add `let g:AutoPairsMapCR = 0` to .vimrc to disable `<CR>` mapping.
260
+
261
+ Compatible with viki - [ issue #25 ] ( https://github.com/jiangmiao/auto-pairs/issues/25 )
262
+
263
+ Description: When works with viki ` <CR> ` will output viki#ExprMarkInexistentInElement('ParagraphVisible','<CR >')
264
+ Reason: viki uses ` <expr> ` on mapping ` <CR> ` that auto-pairs cannot expanding.
265
+ Solution A: Add
266
+
267
+ autocmd filetype viki inoremap <buffer > <silent > <CR > <C-R >=viki#ExprMarkInexistentInElement('ParagraphVisible',"\n")<CR ><C-R >=AutoPairsReturn()<CR >`
268
+
269
+ to .vimrc, it will make viki and auto-pairs works together.
270
+
271
+ Solution B: add ` let g:AutoPairsMapCR = 0 ` to .vimrc to disable ` <CR> ` mapping.
272
+
273
+ Remarks: Solution A need NOT add ` let g:AutoPairsMapCR = 0 ` to .vimrc, if Solution A still cannot work, then have to use Solution B to disable auto-pairs ` <CR> ` .
246
274
247
275
Breaks '.' - [ issue #3 ] ( https://github.com/jiangmiao/auto-pairs/issues/3 )
248
276
Original file line number Diff line number Diff line change 1
1
" Insert or delete brackets, parens, quotes in pairs.
2
2
" Maintainer: JiangMiao <jiangfriend@gmail.com>
3
3
" Contributor: camthompson
4
- " Last Change: 2012-10-17
5
- " Version: 1.2.6
4
+ " Last Change: 2012-11-02
5
+ " Version: 1.2.7
6
6
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
7
7
" Repository: https://github.com/jiangmiao/auto-pairs
8
8
@@ -281,6 +281,13 @@ function! AutoPairsReturn()
281
281
" Use \<DEL> is a bit wierd. the character before cursor need to be deleted.
282
282
let cmd = " \<C-O> zz\<ESC> cl"
283
283
end
284
+
285
+ " If equalprg has been set, then avoid call =
286
+ " https://github.com/jiangmiao/auto-pairs/issues/24
287
+ if &equalprg != ' '
288
+ return " \<ESC> O" .cmd
289
+ endif
290
+
284
291
" conflict with javascript and coffee
285
292
" javascript need indent new line
286
293
" coffeescript forbid indent new line
You can’t perform that action at this time.
0 commit comments