<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.vifm.info/index.php?action=history&amp;feed=atom&amp;title=Sort_dotfiles%2Fdotdirs_separately_from_other_files%2Fdirectories</id>
	<title>Sort dotfiles/dotdirs separately from other files/directories - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.vifm.info/index.php?action=history&amp;feed=atom&amp;title=Sort_dotfiles%2Fdotdirs_separately_from_other_files%2Fdirectories"/>
	<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Sort_dotfiles/dotdirs_separately_from_other_files/directories&amp;action=history"/>
	<updated>2026-07-15T09:01:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.vifm.info/index.php?title=Sort_dotfiles/dotdirs_separately_from_other_files/directories&amp;diff=8062&amp;oldid=prev</id>
		<title>Fugue at 17:48, 12 August 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Sort_dotfiles/dotdirs_separately_from_other_files/directories&amp;diff=8062&amp;oldid=prev"/>
		<updated>2025-08-12T17:48:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:48, 12 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot; &gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We then set the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option. Vifm will first sort the files according to the two groups generated by &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt;, then sort directories above files, then sort alphabetically.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We then set the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option. Vifm will first sort the files according to the two groups generated by &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt;, then sort directories above files, then sort alphabetically.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ultimately, we get the following order - directories, files, dotdirs, dotfiles. By changing the sort order of any of the options (changing &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option), the ordering can be varied while keeping the grouping.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ultimately, we get the following order - directories, files, dotdirs, dotfiles. By changing the sort order of any of the options (changing &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option), the ordering can be varied while keeping the grouping&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. For example, &amp;lt;source lang=&amp;quot;vim&amp;quot;&amp;gt;set sort=-groups,+dir,+name&amp;lt;/source&amp;gt; will present as dotdirs, dotfiles, directories, files&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fugue</name></author>
	</entry>
	<entry>
		<id>https://wiki.vifm.info/index.php?title=Sort_dotfiles/dotdirs_separately_from_other_files/directories&amp;diff=2665&amp;oldid=prev</id>
		<title>Noodlebrains: Created page with &quot;By (ab)using the &lt;code&gt;sortgroups&lt;/code&gt; option, you can split all the listed files into two groups - one containing items with a &lt;code&gt;.&lt;/code&gt; prefix, and one containing all...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Sort_dotfiles/dotdirs_separately_from_other_files/directories&amp;diff=2665&amp;oldid=prev"/>
		<updated>2023-12-09T18:36:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;By (ab)using the &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt; option, you can split all the listed files into two groups - one containing items with a &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; prefix, and one containing all...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;By (ab)using the &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt; option, you can split all the listed files into two groups - one containing items with a &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; prefix, and one containing all the other items.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vim&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot; Show dotfiles/dotdirs in the first place&lt;br /&gt;
set dotfiles&lt;br /&gt;
&lt;br /&gt;
set sortgroups='(|\.).*'&lt;br /&gt;
&lt;br /&gt;
set sort=+groups,+dir,+name&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explanation ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt; option is used to select parts of each filename via regex group matches, and use those parts as sorting keys. &lt;br /&gt;
&lt;br /&gt;
In the regex &amp;lt;code&amp;gt;(|\.).*&amp;lt;/code&amp;gt;, the group &amp;lt;code&amp;gt;(|\.)&amp;lt;/code&amp;gt; matches either an empty string, or the literal &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; character; the &amp;lt;code&amp;gt;.*&amp;lt;/code&amp;gt; part matches the rest of the filename. So our group match is either an empty string, or a single &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; character; the filenames are then sorted into two groups based on which one it is. &lt;br /&gt;
&lt;br /&gt;
We then set the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option. Vifm will first sort the files according to the two groups generated by &amp;lt;code&amp;gt;sortgroups&amp;lt;/code&amp;gt;, then sort directories above files, then sort alphabetically.&lt;br /&gt;
&lt;br /&gt;
Ultimately, we get the following order - directories, files, dotdirs, dotfiles. By changing the sort order of any of the options (changing &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;sort&amp;lt;/code&amp;gt; option), the ordering can be varied while keeping the grouping.&lt;/div&gt;</summary>
		<author><name>Noodlebrains</name></author>
	</entry>
</feed>