Last active
July 12, 2024 20:57
-
-
Save lukepighetti/8e4a13db5bdcd68a7d83eee19051ab14 to your computer and use it in GitHub Desktop.
Helix – tree file picker... TODAY?!?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[keys.normal] | |
C-f = [":new", ":insert-output lf-pick", ":theme default", "select_all", "split_selection_on_newline", "goto_file", "goto_last_modified_file", ":buffer-close!", ":theme tokyonight_storm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# touch ~/.local/bin/lf-pick | |
# chmod +x ~/.local/bin/lf-pick | |
function lfp(){ | |
local TEMP=$(mktemp) | |
lf -selection-path=$TEMP | |
cat $TEMP | |
} | |
lfp |
lfp(){ local TEMP=$(mktemp) lf -selection-path=$TEMP cat $TEMP } lfpworked for me
Yep, thanks, worked for me too on linux
Hei!
I really missed the functionality of open lf in the current directory. With helix itself seems impossibile to get the file path of the current buffer, but this guy is using wezterm to do that: https://quantonganh.com/2023/08/19/turn-helix-into-ide.md
Here what is working for me:
#!/bin/bash
function lfp(){
status_line=$(wezterm cli get-text | rg -e "(?:NOR\s+|NORMAL|INS\s+|INSERT|SEL\s+|SELECT)\s+[\x{2800}-\x{28FF}]*\s+(\S*)\s[^│]* (\d+):*.*" -o --replace '$1 $2')
filename=$(echo $status_line | awk '{ print $1}')
local TEMP=$(mktemp)
lf -selection-path=$TEMP $filename
cat $TEMP
}
lfp
Is there a way to set the current working directory with this as well?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agree.. though
I noticed helix running slow in WSL.
If you benchmark the disks WSL create for you (
lsblk
,sudo gnome-disks
ordd
equivalent) you'll notice /sda inside WSL is 1000x times slower than your regular disk (some Mbps vs Gbps). 😵💫WSL is virtualized and won't compare to native performance ever.
All programs inside WSL run slow as hell: e.g. chrome, webstorm, neovim, etc.
Some inconveniences i personally find in wsl:
Alternatives
The only benefit i see with wsl is the networking setup that works out of the box in windows (if you need vpn).
Still looking for a better workflow, maybe hyper-v with garuda, though require network setup for vpn access.