[vim/vim] Make :center work on visual selections (Issue #16295)

9 views
Skip to first unread message

My Arcana

unread,
Dec 24, 2024, 1:16:15 PM12/24/24
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
Yes it's very hard to center text selections in vim at the moment

Describe the solution you'd like

                       w  h sa sb sl sr ....
             width |  |  1  0  0  0 -1 -1  0  0 |
            height |  |  0  1 -1 -1  0  0  0  0 |
       space_above |  |  0  0  0  0  0  0  0  0 |
       space_below |  |  0  0  0  0  0  0  0  0 |
        space_left |  |  0  0  0  0  0  0  0  0 |  
       space_right |  |  0  0  0  0  0  0  0  0 |
               ... |  |  0  0  0  0  0  0  0  0 |

CTRL-V selecting the first column and entering the command :'<,'>center should center the column not the lines

Describe alternatives you've considered

  • Writing my own centering function in Vim
  • writing my own script to center lines and putting it in my path

Neither of these solutions are trivial sadly. I think basic text manipulation like this should be part of Vim in the first place.

Vim provides :center, it just doesn't center anything except lines, even if you've made a visual selection.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16295@github.com>

Christian Brabandt

unread,
Dec 25, 2024, 5:04:14 AM12/25/24
to vim/vim, Subscribed

Closed #16295 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/16295/issue_event/15760950917@github.com>

Christian Brabandt

unread,
Dec 25, 2024, 5:04:16 AM12/25/24
to vim/vim, Subscribed

ex commands always work linewise. There is already an issue for, to make it work column wise using e.g. `< marker value. But so far, this does not exist. It's part of the todo list and there is an issue about it already (sorry don't find it currently), so I am closing this as duplicate


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16295/2561766462@github.com>

Christian Brabandt

unread,
Dec 25, 2024, 5:05:57 AM12/25/24
to vim/vim, Subscribed

Here it is: #3292


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16295/2561767401@github.com>

Reply all
Reply to author
Forward
0 new messages