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

Introduce configuration option to disable adding spaces #378

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

Conversation

maze88
Copy link

@maze88 maze88 commented Jun 17, 2023

Although I'm familiar with the possibility of using closing brackets (as was added to the FAQ) to prevent adding spaces - I personally have no use cases that require such spaces, and reaching further (to the closing bracket) is less comfortable - thus I'd like the option to disable this feature entirely.

For this I have added a configuration option to disable/disclude such spaces like so:

let g:surround_insert_space = 0

(the default value will remain 1, so as not to break existing/expected behavior)

It's safe to assume that for such a common issue (#366, #363, #314, #303, #240, #205, #108, #27
...), at least some of these other users could benefit from such a feature.

@maze88
Copy link
Author

maze88 commented Jun 17, 2023

P.S.
This is my first contribution to any VimScript project, I am warmly open to any feedback.
I reviewed the Pathogen contribution guide referenced in the project's readme.

@rkochar
Copy link

rkochar commented Jan 6, 2024

Would you consider adding a toggle? i.e. add whitespace on closing bracket instead of opening? Thanks!

@maze88
Copy link
Author

maze88 commented Jan 7, 2024

Would you consider adding a toggle? i.e. add whitespace on closing bracket instead of opening? Thanks!

I'm not sure exactly what you mean; the toggle I suggested is as a global setting

@rkochar
Copy link

rkochar commented Jan 8, 2024

@maze88 my understanding is that your setting will enable disable whitespace being added with brackets. My suggestion (in addition to your flag) is that users can choose if whitespace is added in opening or closing brackets (toggle from opening bracket currently to closing bracket).

@maze88
Copy link
Author

maze88 commented Jan 8, 2024

@maze88 my understanding is that your setting will enable disable whitespace being added with brackets. My suggestion (in addition to your flag) is that users can choose if whitespace is added in opening or closing brackets (toggle from opening bracket currently to closing bracket).

Ahh, now I understood...
Interesting concept - but I wouldn't be able to implement it with my minimal VimScript knowledge.

Perhaps create a separate fork and PR, to offer it?

@cnlzxin
Copy link

cnlzxin commented May 19, 2024

@rkochar I had the same need, so I added two new options by referring to these codes in this PR.

let g:surround_insert_space_left = 1        " left: opening brackets
let g:surround_insert_space_right = 0       " right: closing brackets

here #387

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