bulletmark / edir

Program to rename, remove, and copy files and directories using your editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: make filenames more aligned for block-visual mode

ppwwyyxx opened this issue · comments

When batch-editing file names I often rely on the "block visual" mode in vim. This is useful when I need to add/remove/edit common prefix to file names.
However, a problem with both vidir and edir is that line numbers can have different width, e.g.:

2023-06-29_08-20

This causes filenames across lines to not left-aligned.

Here are some ideas that make them more aligned:

  • Add an option (or maybe even default) to pad the line numbers (by space or zeros) such that all numbers have the same number of characters, therefore all filenames are left-aligned.
  • Add an option to choose whether to left-align or right-align the filenames. (right-align can be useful if I need to add/remove/edit common suffix). Alignment can be implemented by space paddings.

I also use block visual mode in vim all the time and don't see this problem because edir writes a tab after the number. Have you configured your vim in a non-standard way to filter tabs?

I guess I have been around long enough to realize that attempting to rely on any consistent approach to how users deal with TAB chars will always be futile. So commit c1e881f enhances edir to format the line number with a consistent width, without TABS at all. This is new release 2.20.

Yeah, now I notice that set ts=4 fix the alignment for me. Thanks for your commit!