Skip to content

Introduce configuration option to disable adding spaces#378

Open
maze88 wants to merge 1 commit into
tpope:masterfrom
maze88:master
Open

Introduce configuration option to disable adding spaces#378
maze88 wants to merge 1 commit into
tpope:masterfrom
maze88:master

Conversation

@maze88

@maze88 maze88 commented Jun 17, 2023

Copy link
Copy Markdown

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

maze88 commented Jun 17, 2023

Copy link
Copy Markdown
Author

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

rkochar commented Jan 6, 2024

Copy link
Copy Markdown

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

@maze88

maze88 commented Jan 7, 2024

Copy link
Copy Markdown
Author

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

rkochar commented Jan 8, 2024

Copy link
Copy Markdown

@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

maze88 commented Jan 8, 2024

Copy link
Copy Markdown
Author

@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

cnlzxin commented May 19, 2024

Copy link
Copy Markdown

@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