Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using {}, [] and <> for function surround #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miseran
Copy link

@miseran miseran commented Mar 27, 2015

With this patch, if a function name ends in the character "[", "{" or "<", that is used as the delimiter instead of "(".

The main use case for me is in LaTeX, where functions use the "{" delimiters. For example, ysiwf\textbf{<CR> to make a word bold. I think this may be useful in other situations as well, for example array indexing.

@tommcdo
Copy link
Contributor

tommcdo commented Mar 28, 2015

👍 Nicely done!

@Hotschke
Copy link

👍

Currently I have defined let b:surround_{char2nr("c")} = "\\\1command: \1{\r}".
Since dot-repeating of ysgnctextbf<CR> does not work , it's possible to use ysgnf\textbf{ and dot repeat it.

If the function name ends in "{", "[" or "<", use that as a delimiter
instead of "(".
@miseran miseran force-pushed the generalized-function branch from 3181a65 to 3ff5c2c Compare July 7, 2017 16:11
halostatue added a commit to halostatue/vim9-surround that referenced this pull request Aug 6, 2024
Variation on tpope#166 that works on lisp-function format,
too (C-F).
halostatue added a commit to halostatue/vim9-surround that referenced this pull request Aug 8, 2024
Variation on tpope#166 that works on lisp-function format,
too (C-F).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants