The content of this repository is about the configuration,scripts and custom commands of Ranger
in the WSL
environment
You can run WindowsOS Applications in your WSL-Ranger
- ๐
editor
: use your windows sublime text /notepad.exe
as your default editor forRanger
- ๐
player
: use your windows browser to open Audio/Video/PDF (or use others app VLC ...) - ๐
compress/extract
: I just provideRar.exe/unRar.exe
code forWinRar.exe
- ...
- If WindowsOS App provides a command line to start, then you can integrate them into WSL-Ranger
You need to have the following:
- ๐ฅ Python3.6 +
my WSL
path format is default, so the prefix
is :๐
/mnt/
# eg:
# /mnt/c
# /mnt/d
# /mnt/e
# ...
all my scripts follow above path format prefix
๐
๐ฅIf you had changed your default location of
WSL
, eg: not/mnt/
๐ฅyou need to change these scripts by yourself, replace to your own path format
๐Python3.6+
ri_script/wsl_2_path.py
ri_script/wsl_2_abspath.py
(Just for bulkrename and Rar)ri_script/wsl_2_url.py
(For browser)
the contents of scripts are very simple.
but the main idea is:Which applications
need to be converted towhich path format
.
eg: you can run chrome.exe
to open Video/Audio/PDF
and more files
- but you cant't open them with absolute path
- you must switch:
/mnt/{}/xxx
tofile:///{}:/xxx
- for details, you can try:
ri_script/wsl_2_url.py
-
bulkrename: change editor in
rc.conf
=>mime ^text, label editor =
- changed: default editor is
subl.exe
you can set your editor ๐
- changed: default editor is
-
fzf_select
- refer from ranger-wiki:
- changed: some code and add my fzf remap/config
-
fzf_mark
- I add the fzf_mark, you can also see fzf_mark
-
extract_here & compress
- refer from archlinux-wiki
- changed: replace
atool
in ArchLinux toWinRAR.exe
in Windows for WSL
you can see the type of files name suffix
and associated WindowsOS Applications
you can see above ๐ commands.py
remap in rc.conf
end of
rc.conf
=>source ~/rc_remap.conf
is for AutoWalk ๐
you can AutoWalk to bulk add remap for Ranger for paths in your filesystem
In ranger, you can open .ipynb
on JupyterLab directly;
But it depends on PM2;
add below in your rifle.conf
:
ext ipynb = python3 ~/ri_script/jlab_ranger.py $1
Note: you need to adjust the paths of the script:
ri_script/jlab_ranger.py
to yourhome_dir
Maybe some configure didn't work with wsl.exe --exec
, you can try ๐
put source application configure into /etc/profile
Q: Why
/etc/profile
rather than~/.zshrc
?
A: Decoupling makesbash
faster thanzsh
for launching (Ranger just needsfzf configure
)
echo '[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh' >> /etc/profile
then put below code into your windows app manager (Lnk ...)
wsl.exe --exec /bin/zsh -c "source /etc/profile && ranger /mnt/d/test"