The Power of a Well-Designed Filesystem
Consider this scenario: You're knee-deep in code, searching for that elusive configuration file or the latest draft of your project proposal. A well-designed filesystem transforms this frantic search into a seamless journey. By strategically organizing our files, we reduce cognitive load and find essential resources swiftly. Whether it's a code snippet, a digital document, or a dataset, efficient filesystem design ensures that we locate what we need with ease.
Tools vs. Production: A Clear Boundary
Our digital toolkit comprises various instruments: text editors, terminal shells, compilers, and more. However, these tools should never mingle with the raw materials—the actual production files. Picture a well-organized workshop: each tool has its designated spot, separates from the partially assembled machinery. Similarly, our filesystem should maintain a clear separation between tools and creative work.
The Toolbox
At the core of my filesystem lies the workspace. This directory resides at the user's level, and hosts a set of specialized subdirectories:
- bin: Here's where binary executables reside. Whether it's a custom script or a compiled utility (e.g fzf, rg, fd), the bin directory keeps them accessible.
- apps: The apps folder contains various software applications and tools that serve specific purposes. These applications are not standalone files but rather complete programs or suites. Examples include text editors like Lite-XL, and programming language runtimes like Node.
- gitrepos: This folder houses a collection of cloned GitHub repositories that can be utilized for a range of tasks. These repositories may include codebases for push requests, experimental projects, or other development-related activities.
- pyvenv: Python virtual environments are essential for isolating dependencies. The pyvenv folder neatly houses my virtual environments.
Ongoing Projects
These directories follow a consistent naming pattern, incorporating the ISO 8601 year (e.g., work2024). These directories serve as containers for project-related files, tasks, and documentation specific to each year. By adopting this naming convention, you enable easy annotation and organization within a Hybrid Productivity system, allowing you to track project progress and locate relevant information efficiently.
Lite XL Text Editor
This featherweight editor defies complexity. Its extension system, powered by Lua scripts, invites customization without overwhelming you. Unlike Vim/Neovim, Lite XL's configuration is straightforward. In an afternoon, you can transform it into your personalized writing tool.
When you open Lite XL starting from the root folder, as shown in the video below, the left pane immediately presents the entire filesystem structure. This intuitive layout allows me to effortlessly navigate through my project files, finding what I need without unnecessary clicks or searches.
Lite XL provides an option to zoom in on both the code editor and the file tree for better readability.
Setting Up the External Terminal Plugin in Lite-XL
When configuring Lite-XL, you can take advantage of the External Terminal plugin to enhance your workflow. This plugin allows you to create a keyboard shortcut that opens a NuShell terminal directly from within Lite-XL.
On Windows, Lite-XL defaults to the standard CMD shell. So, there's no need to involve PowerShell unnecessarily, as shown in the video above. In plugin's configuration settings, specify the executable for the terminal as:
C:\Path\to\nu.exe
Configuring NuShell's $env.Editor
To ensure that NuShell uses Lite-XL as the default editor, you need to set the environment variable $env.Editor to point to the Lite-XL executable (C:\Path\to\lite-xl.exe).
You can accomplish this by running the following command in NuShell:
config env
and add the following line:
$env.Editor = C:\Path\to\lite-xl.exe
Downloading the PowerShell Syntax Highlighter for Lite-Xl
Since a dedicated syntax highlighter plugin for NuShell code doesn't yet exist, you can cleverly leverage the PowerShell highlighter for now. The reason behind this is that NuShell shares many similarities with PowerShell, making the syntax highlighter applicable.
Download the PowerShell syntax highlighter for Lite-Xl from the GitHub repository lite-xl-plugins. Specifically, you just need to fetch the language_powershell.lua file. Place this file in the:
~/.config/lite-xl/plugins
directory and make sure to add the .nu extension to the array of supported file types.
Setting Up an Alias in NuShell
Lastly, It's useful to create an alias in NuShell that makes opening lite-xl even more convenient. Open NuShell's configuration file with:
config nu
and add the following line:
alias edit = C:\Path\to\lite-xl\lite-xl.exe
Now, whenever you type edit, NuShell will open Lite-XL.