Created
July 18, 2011 18:20
-
-
Save choplin/1090222 to your computer and use it in GitHub Desktop.
using surround.vim custom mapping (surrounding with fold marker)
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
let g:surround_custom_mapping.vim= { | |
\'z': "\"{{{ \r \"}}}" | |
\ } |
I use this
let g:commentChar = {
\ 'vim': '"',
....
\ 'sh': '#',
\ 'python': '#'
\}
let coChar=g:commentChar[&ft]
let g:surround_{char2nr('z')}=coChar."{{{ \r ".coChar."}}}"
let g:surround_{char2nr('Z')}="\" \<++\> {{{ \r \"}}}"
this is the correct code
autocmd FileType * let b:comChar = g:commentChar[&ft] |
\ let b:surround_{char2nr('z')}=b:comChar."{{{ \r ".b:comChar."}}}" |
\ let b:surround_{char2nr('Z')}="\" \<++\> {{{ \r \"}}}" |
hi
this is an example of "vim-surround_custom_mapping" plugin, which enables you to write filytype based key mapping of surround.vim more shortly and descriptively.
https://github.com/t9md/vim-surround_custom_mapping
it's cool plugin. try it! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how I use this from vim ?
?