-
-
Save tyru/713406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nnoremap <silent> ) :<C-u>call search("\\((\\|\\[\\|{\\|<\\|縲圭\|縲蚕\)\\zs")<CR> | |
| nnoremap <silent> ( :<C-u>call search("\\((\\|\\[\\|{\\|<\\|縲圭\|縲蚕\)\\zs", 'b')<CR> |
Author
添削きたー。感謝です。
~/.vimrc 中に書く場合は、orのバックスラッシュは4つですね。クウォートややこしいです (-.-;
Author
いや、2つでいいです。
.vimrcでも~/.vim/plugin/searchOpenParen.vimでも変わりません。
ただ、シングルクオートだと、バックスラッシュをエスケープせずにいけます。
シングルクオートの中でシングルクオートを表すには
echo 'foo''bar'
と2つ「'」を重ねます。
微妙に他の言語と違っててややこしいですね...
文字化けたので元のパターンを持ってくると、
シングルクオートで書きなおすと
search('\((\|\[\|{\|<\|「\|『\)\zs')
search('\((\|\[\|{\|<\|「\|『\)\zs', 'b')
こんな感じです。
自分は正規表現書くときはシングルクオート使ってます。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
なんかgist.vimで読み込んだ時点で文字化けてた。ふーむ。