I personally prefer the vim-surround grammar. When using csff<function name> to change a function name for a language that does not use () for functions, e.g. Mathematica using [], my configuration is like:
augroup sandwich-ft-mma
autocmd BufRead,BufNewFile *.wl let b:sandwich_magicchar_f_patterns = [
\ {
\ 'header' : '\<\%(\h\k*\.\)*\h\k*',
\ 'bra' : '\[',
\ 'ket' : '\]',
\ 'footer' : '',
\ },
\ ]
augroup END
For the function below:
When my cursor is in the brackets, dsf can successfully delete the function to make it x_. However, when I tried to rename f to g using csffg, the result was:
It seems the [] brackets matched by bra and ket patterns were ignored in the final output, and the behavior of csff always assumes () are used for function calls. I wonder if it's better to respect the original surrounding characters.
I personally prefer the vim-surround grammar. When using
csff<function name>to change a function name for a language that does not use()for functions, e.g. Mathematica using[], my configuration is like:For the function below:
When my cursor is in the brackets,
dsfcan successfully delete the function to make itx_. However, when I tried to renameftogusingcsffg, the result was:It seems the
[]brackets matched bybraandketpatterns were ignored in the final output, and the behavior ofcsffalways assumes()are used for function calls. I wonder if it's better to respect the original surrounding characters.