xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit e867f938dfc809febfa137cde184a41c1a5582af

Change :sp[lit] and :vs[plit] to expand macros
Thanks to agguser.

Closes https://github.com/vifm/vifm/issues/1093
Author: xaizek
Author date (UTC): 2026-09-02 08:54
Committer name: xaizek
Committer date (UTC): 2026-09-02 08:54
Parent(s): 269a84d85e3ed9688d7a14b44a29ed7387df2d40
Signing key: 99DC5E4DB05F6BE2
Tree: a0ae6c176953d8c5588c9400838e729bf49692b2
File Lines added Lines deleted
ChangeLog 3 0
data/man/vifm.1 2 0
data/vim/doc/app/vifm-app.txt 2 2
src/cmd_handlers.c 2 2
tests/commands/misc.c 12 0
File ChangeLog changed (mode: 100644) (index 9edccdbf9..4a604497b)
18 18 Changed :filter to :filt[er]. :filt and :filte are now guaranteed to Changed :filter to :filt[er]. :filt and :filte are now guaranteed to
19 19 invoke :filter. Thanks to filterfalse. invoke :filter. Thanks to filterfalse.
20 20
21 Changed :sp[lit] and :vs[plit] to expand macros in their parameter.
22 Thanks to agguser.
23
21 24 Added <help> :*map argument that enables providing description for the Added <help> :*map argument that enables providing description for the
22 25 mapping with the same curly braces syntax as used by :file[x]type. mapping with the same curly braces syntax as used by :file[x]type.
23 26
File data/man/vifm.1 changed (mode: 100644) (index e42a17888..0a9854eca)
... ... toggle horizontal window splitting.
3123 3123 .BI ":sp[lit] path" .BI ":sp[lit] path"
3124 3124 splits the window horizontally to show both file directories. Also changes splits the window horizontally to show both file directories. Also changes
3125 3125 other pane to path (absolute or relative to current directory of active pane). other pane to path (absolute or relative to current directory of active pane).
3126 Macros are expanded.
3126 3127 .TP .TP
3127 3128 .BI " :stop" .BI " :stop"
3128 3129 .TP .TP
 
... ... toggle window vertical splitting.
3361 3362 .BI ":vs[plit] path" .BI ":vs[plit] path"
3362 3363 split the window vertically to show both file directories. And changes other split the window vertically to show both file directories. And changes other
3363 3364 pane to path (absolute or relative to current directory of active pane). pane to path (absolute or relative to current directory of active pane).
3365 Macros are expanded.
3364 3366 .TP .TP
3365 3367 .BI " :wincmd" .BI " :wincmd"
3366 3368 .TP .TP
File data/vim/doc/app/vifm-app.txt changed (mode: 100644) (index 3de1b8253..0985d7c98)
... ... yet supported) and might be changed in future releases, or get an alias.
2647 2647 :sp[lit] path :sp[lit] path
2648 2648 split window horizontally to show both file directories. Also changes split window horizontally to show both file directories. Also changes
2649 2649 other pane to the path (absolute or relative to current directory of other pane to the path (absolute or relative to current directory of
2650 active pane).
2650 active pane). Macros are expanded.
2651 2651
2652 2652 *vifm-:stop* *vifm-:st* *vifm-:stop* *vifm-:st*
2653 2653 :st[op] :st[op]
 
... ... yet supported) and might be changed in future releases, or get an alias.
2823 2823 :vs[plit] path :vs[plit] path
2824 2824 split the window vertically to show both file directories. Also changes split the window vertically to show both file directories. Also changes
2825 2825 other pane to the path (absolute or relative to current directory of active other pane to the path (absolute or relative to current directory of active
2826 pane).
2826 pane). Macros are expanded.
2827 2827
2828 2828 :[count]winc[md] {arg} *vifm-:wincmd* *vifm-:winc* :[count]winc[md] {arg} *vifm-:wincmd* *vifm-:winc*
2829 2829 same as running Ctrl-W [count] {arg}. same as running Ctrl-W [count] {arg}.
File src/cmd_handlers.c changed (mode: 100644) (index b1eef7dcb..2c9dfdc21)
... ... const cmd_add_t cmds_list[] = {
856 856 .handler = &source_cmd, .min_args = 1, .max_args = 1, }, .handler = &source_cmd, .min_args = 1, .max_args = 1, },
857 857 { .name = "split", .abbr = "sp", .id = COM_SPLIT, { .name = "split", .abbr = "sp", .id = COM_SPLIT,
858 858 .descr = "horizontal split layout", .descr = "horizontal split layout",
859 .flags = HAS_EMARK | HAS_COMMENT,
859 .flags = HAS_EMARK | HAS_COMMENT | HAS_MACROS_FOR_CMD,
860 860 .handler = &split_cmd, .min_args = 0, .max_args = 1, }, .handler = &split_cmd, .min_args = 0, .max_args = 1, },
861 861 { .name = "stop", .abbr = "st", .id = -1, { .name = "stop", .abbr = "st", .id = -1,
862 862 .descr = "suspend the process (same as pressing Ctrl-Z)", .descr = "suspend the process (same as pressing Ctrl-Z)",
 
... ... const cmd_add_t cmds_list[] = {
960 960 #endif #endif
961 961 { .name = "vsplit", .abbr = "vs", .id = COM_VSPLIT, { .name = "vsplit", .abbr = "vs", .id = COM_VSPLIT,
962 962 .descr = "vertical split layout", .descr = "vertical split layout",
963 .flags = HAS_EMARK | HAS_COMMENT,
963 .flags = HAS_EMARK | HAS_COMMENT | HAS_MACROS_FOR_CMD,
964 964 .handler = &vsplit_cmd, .min_args = 0, .max_args = 1, }, .handler = &vsplit_cmd, .min_args = 0, .max_args = 1, },
965 965 { .name = "vunmap", .abbr = "vu", .id = -1, { .name = "vunmap", .abbr = "vu", .id = -1,
966 966 .descr = "unmap user keys in visual mode", .descr = "unmap user keys in visual mode",
File tests/commands/misc.c changed (mode: 100644) (index 257c28bb6..c7e9461e8)
... ... TEST(split)
773 773 assert_int_equal(VSPLIT, curr_stats.split); assert_int_equal(VSPLIT, curr_stats.split);
774 774 assert_int_equal(2, curr_stats.number_of_windows); assert_int_equal(2, curr_stats.number_of_windows);
775 775 assert_string_ends_with("/read", rwin.curr_dir); assert_string_ends_with("/read", rwin.curr_dir);
776
777 /* macros */
778
779 assert_success(cmds_dispatch1("split %D:t:s/ad$/name/", &lwin, CIT_COMMAND));
780 assert_int_equal(HSPLIT, curr_stats.split);
781 assert_int_equal(2, curr_stats.number_of_windows);
782 assert_string_ends_with("/rename", rwin.curr_dir);
783
784 assert_success(cmds_dispatch1("vsplit %D:t:s/name$/ad/", &lwin, CIT_COMMAND));
785 assert_int_equal(VSPLIT, curr_stats.split);
786 assert_int_equal(2, curr_stats.number_of_windows);
787 assert_string_ends_with("/read", rwin.curr_dir);
776 788 } }
777 789
778 790 static void static void
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master