From plain text to the code editor
Opening a file is not one single task. Sometimes you only need to read it; sometimes you need one sentence changed; sometimes you need a code-aware surface. Choosing the smallest suitable tool keeps work calm.
Read before you edit
This inspect-first rhythm is especially useful on remote hosting, where every unnecessary write is a write you did not have to risk.
install echo edit code statecho project/notes/ideas.txtread project/notes/ideas.txt`edit` for text, `code` for source
Do not choose .lil script benefit from the code-oriented view.
edit project/notes/ideas.txtedit project/notes/todo.txt -ncode project/index.php -ncode project/index.php -phpPrefer small, verifiable changes
After creating or editing a file, inspect it again.
The same principle scales to programming: change one coherent thing, verify it, then continue. Terminal work rewards observable steps.
stat project/index.phpecho project/index.phpThe active file shortens the next command
The core remembers the last opened file for commands that support the active-file convention. $ means “the active file”, so after opening project/index.php you can use
Treat $ as convenience, not magic. If there is any doubt about which file is active, name the path explicitly. Shortcuts are valuable only while they remain obvious.
code project/index.phpstat $Source editing and structured editing solve different problems
You can open an INI or JSON file in
But when the real task is “change this logical key to this value”, a format-specific command can be much clearer. The next part is about that boundary: editing data by meaning instead of navigating brackets and separators.
code project/config/app.ini -inihelp iniKeep your editor routine reusable
A small preparation script can install the editors you prefer, create standard files and open the project in a known state. You do not need to automate the creative editing itself; automate the boring setup around it.
That distinction is useful everywhere: scripts should remove repetition, not remove your understanding of what is being changed.
Keep this as a script
Save this as editor-ready.lil. It makes sure the basic reading and editing tools exist, prepares a note and a PHP file, and leaves you with a predictable starting point.
#lil
@install echo edit code stat
cd lil-playground
edit project/notes/todo.txt -n
code project/index.php -n
stat project/index.php