I managed to put together a crude implementation of netrw that actually works pretty well. The code is crude at the moment too, so there may be bugs.
Often I find myself working on a file within a folder and I'd like to see the other files available within that same folder. In standard Helix you would have to launch the file picker and search for the folder name (possibly even more specific if there's similarly named folders), which hopefully we can all argee is much slower than having this information presented to you in a neat buffer.
Press - to open Netrw. If pressed at a scratch pad, the working directory will be lauched that Helix was launched from. If pressed while a file is focused,
it will open at the directory of that file.
You'll notice that NORMAL mode becomes NETRW mode and you see files and folders. You can navigate just like any other buffer, but keys that would change text
or enter different modes have been disabled.
Press enter to open. If the line under your cursor is a directory, netrw will open that directory and you will remain within netrw. If it's a file, that file will be opened and the netrw
buffer will close.
I'd like to figure out how to color the directories so that they stand out more. I'd also like to place symbols in front of them like a folder or the icon for whatever language the file is. The super long term goal would be to be able to edit the buffer and have it edit the actual file system like oil.nvim does. I fear that Helix is not currently equipped for such asks... from what I can tell it's not very flexible from how the devs designed it and I don't know enough about the project to build something like that from scratch.
- Implement VIM motions as closely as possible
- Reuse Helix's already implemented functions as much as possible
- Integrate lazygit into Helix somehow (very long term goal)
- Integrate an oil.nvim style file browser (very long term goal)
-
vw/Wb/Be/E
-
vi(select inside textobject) andva(select around textobject)w/Wp- treesitter objects
ffor functiontfor typeafor argumentcfor commentTfor test
- pairs
{([- etc
NOTE: The pairs matching first looks for any surrounding pair and if not found, will search for the next one forward
-
vtandvf- i.e.
vt"orvT"to select until"forward or backwards - i.e.
vf"orvF"to select to"forward or backwards - using a count like
3vf"
- i.e.
-
Venters visual line mode
-
dddeletes entire line- accepts counts like
3ddto delete 3 lines
- accepts counts like
-
Dto delete from cursor to end of line -
dw/Wb/Be/E
-
di(select inside textobject) andda(select around textobject)-
w/W -
p -
treesitter objects
ffor functiontfor typeafor argumentcfor commentTfor test
-
pairs
{([- etc
NOTE: The pairs matching first looks for any surrounding pair and if not found, will search for the next one forward
-
-
dtanddf- i.e.
dt"ordT"to delete until"forward or backwards - i.e.
df"ordF"to delete to"forward or backwards - using a count like
3df"
- i.e.
-
Cto change from cursor to end of line -
cw/Wb/Be/E
-
ci(select inside textobject) andca(select around textobject)-
w/W -
p -
treesitter objects
ffor functiontfor typeafor argumentcfor commentTfor test
-
pairs
{([- etc
NOTE: The pairs matching first looks for any surrounding pair and if not found, will search for the next one forward
-
-
ctandcf- i.e.
ct"orcT"to change until"forward or backwards - i.e.
cf"orcF"to change to"forward or backwards - using a count like
3cf"
- i.e.
-
yyyanks entire line- accepts counts like
3yyto yank 3 lines
- accepts counts like
-
yw/Wb/Be/E
-
yi(select inside textobject) andya(select around textobject)-
w/W -
p -
treesitter objects
ffor functiontfor typeafor argumentcfor commentTfor test
-
pairs
{([- etc
NOTE: The pairs matching first looks for any surrounding pair and if not found, will search for the next one forward
-
-
ytandyf- i.e.
yt"oryT"to yank until"forward or backwards - i.e.
yf"oryF"to yank to"forward or backwards - using a count like
3yf"
- i.e.
- Normal and Insert modes no longer selects as you go (removes Helix default behavior)
- Helix shows available options for keys as you press them
w/W,e/E, andb/Ball go to the correct spot of wordtandf- i.e.
t"orT"to move until"forward or backwards - i.e.
f"orF"to move to"forward or backwards - using a count like
3f"
- i.e.
Sto change entire line$to go to end of line^to go to first non-whitespace of line0to go to beginning of line%to go to matching pair beneath cursor
- Enter Visual mode by pressing
vvbecause I haven't figured out how to set a timer to default to Visual mode if nothing is pressed immediately afterv - Currently there is no Visual Block mode because I think Visual mode combined with multicursor does the same thing
- Helix seems to add an additional block that the cursor can be moved to at the end of every line
- When using
ddoryycommands, the cursor position is not kept - Motions like
ciporcifdo not search for next occurence of paragraph or function - Motions with pairs like
ci{do not work with a count - Comments
- Implement
gccto comment in Normal mode - Implement
gcto comment in Visual mode - Implement
gbto block comment in Visual mode
- Implement
- Probably lots of motions with counts that don't work
- Refactor evil functions to match Helix architecture (i.e.
_implfunctions) - Refactor tests for new motions and behavior (very long term goal)
Contributing guidelines can be found here.
I reserve the right to reject any suggestions or PRs for this fork.

