tpope/vim-surround — Issue #37: z for folding for any &ft
Author: juanpabloaj
Created: 2011-10-26 02:42:00+00:00
State: open

I try add this to my vimrc

let g:commentChar = {
\ 'vim': '"',
\ 'c': '//',
...
\ 'cpp': '//',
\ 'sh': '#',
\ 'python': '#'
\}
let comChar = g:commentChar[&ft]
let g:surround_{char2nr('z')}=comChar."{{{ \r ".comChar."}}}"
let g:surround_{char2nr('Z')}="\" \<++\> {{{ \r \"}}}"

but I get this error message

Error detected while processing ~/.vimrc:
line 290:
E713: Cannot use empty key for Dictionary
E15: Invalid expression: g:commentChar[&ft]
line 291:
E121: Undefined variable: comChar
E15: Invalid expression: comChar."{{{ \r ".comChar."}}}"