Git Product home page Git Product logo

xplr's Introduction

▸[▓▓ xplr]

A hackable, minimal, fast TUI file explorer

Matrix

xplr.mp4

xplr is a terminal UI based file explorer that aims to increase our terminal productivity by being a flexible, interactive orchestrator for the ever growing awesome command-line utilities that work with the file-system.

To achieve its goal, xplr strives to be a fast, minimal and more importantly, hackable file explorer.

xplr is not meant to be a replacement for the standard shell commands or the GUI file managers. Rather, it aims to integrate them all and expose an intuitive, scriptable, keyboard controlled, real-time visual interface, also being an ideal candidate for further integration, enabling you to achieve insane terminal productivity.

Introductions & Reviews

Packaging

Package maintainers please refer to the RELEASE.md.

Backers

xplr's People

Contributors

aflyingpumpkin avatar boolpurist avatar deadjakk avatar dtomvan avatar duganchen avatar emsquid avatar felixonmars avatar giladwo avatar guilloteauq avatar har7an avatar hensg avatar igorepst avatar jaller94 avatar jmcantrell avatar jmechnich avatar junker avatar kianmeng avatar lalanikarim avatar lcook avatar matt-bsd avatar maximbaz avatar mikoloism avatar nekopsykose avatar noahmayr avatar orhun avatar sayanarijit avatar solitudesf avatar sux2mfgj avatar zainulabideen1122 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xplr's Issues

Block while exploring a dir

The explore operation, being lazy, sometimes causes other operations to misbehave. Possibly add state to the app and start blocking operations that must depend on the state.

read-only mode

Hi,
Sorry couldn't find any docs on this.
Is there a way to disable write access to the filesystem.
I am looking for a file explorer to quickly span shells in different directories.

Inter mode remapping

Another idea to consider: remapping a key from one mode to another. For example I found myself remapping e => :e (to bring editor to default mode), or gj => G (to support kakoune's gj as go to the end). Right now I basically have to copy-paste the entire definition.

Originally posted by @maximbaz in #146 (comment)

xplr v0.5.5 complains about incompatible configuration version

After building xplr v0.5.5, running it results in the message:

error: incompatible configuration version in /Users/caleb/Library/Application Support/xplr/config.yml
                You config version is : v0.5.5
                Required version is   : v0.5.5
                Visit https://github.com/sayanarijit/xplr/wiki/Upgrade-Guide

I had no config file at that location (the entire xplr folder did not exist), so I tried downloading the default/example config from https://github.com/sayanarijit/xplr/blob/main/src/config.yml and placing it there. However, I still receive the same result when trying to run xplr.

CPU Usage

The xlpr file manager results in intense CPU usage when the binary is executed.
How can I avoid this?
https://ibb.co/7j1Rm77

The version I am using is the xrpl-git from the aur.

[SOLVED] Compile error using "cargo install xplr"

I received the following error when using "cargo install xplr" on ubuntu. Any suggestions?

error: no rules expected the token `,`
   --> /home/vdoma/.cargo/registry/src/github.com-1ecc6299db9ec823/xplr-0.3.1/src/input.rs:373:29
    |
373 |                 | Self::Num9,
    |                             ^ no rules expected this token in macro call

error: aborting due to previous error

error: could not compile `xplr`.

Make xplr a library

When xplr becomes a library, we'll get to render it using different runners and frontends (e.g. zellij).

Cleanup, refactor & test

Now it's time to stabilize the project and do cleanup, refactor and write tests, as much as we can, to make sure further improvements, feature additions and optimizations don't break anything.

Add MacPorts install info

Can be added to the wiki, but on macOS, xplr can now be installed via MacPorts:

  1. Install MacPorts
  2. Run:
    sudo port selfupdate
    sudo port install xplr
    

Xplr Invalid Behavior

In Xplr, whenever a key is pressed that is not mapped, it brings Xplr into another mode where the I have to exit using esc and the relevant output is WARNING | Key map not found. Let's calm down, escape, and try again.

How can I override/void this behavior in the config; ignore invalid keystokes?

Sorry to bother you again today. 😅

overwrite config issue

Hey @sayanarijit, just wanted to follow-up on this, it generally works well but I found two cases to consider:

  1. It seems impossible to override prefix and suffix of *_ui options, unless I'm doing something wrong? (I simply want to add spaces on both sides, but any change doesn't seem to be reflected)
general:
  default_ui:
    prefix: "   "
    suffix: " "
  focus_ui:
    prefix: "▸[ "
    suffix: " ]"
    style:
      fg: Cyan
  selection_ui:
    prefix: " { "
    suffix: " }"
  1. It's probably impossible to override arrays, so e.g. I wanted to remove the third column "index", but I guess the only option for me would be to override entire header.cols and row.cols. I don't have a good alternative right away, so just curious if you have some good ideas 🤔

Originally posted by @maximbaz in #47 (comment)

Find/create a yml to lua table conversion tool

With v0.10.0 we will be releasing the most incompatible change yet.

Users will need to convert config.yml to init.lua.

Also, we need to update all the existing hacks, themes and other docs.

It will be much easier if there is a script that reads an yaml file into lua table, and prints it. It should support 2 modes: nested and flat.

The nested mode will print the table as-is similar to how the json to lua converters work. The flat mode will flatten the table using . as the separator.

This way users can decide when to use flat data and when to nest it.

Better symlink support

@maximbaz:

would be nice to be able to show in the UI the destination of the symlink, and potentially also whether symlink leads to a directory or to a file (i.e. can be entered by pressing l).

Define basic utility Lua functions in `xplr.fn.builtin`

Neovim exposes many utility functions via vim.fn API. For e.g. vim.fn.system(), vim.fn.shellescape() etc. It'd be great if xplr exposes such predefined utility functions via xplr.fn.builtin.

It will make writing/porting the hacks easier, and probably, provide a base for a great plugin ecosystem.

Ability to preserve filter and operate on filtered results

This is a feature that I think was very cool in nnn: apply a filter first, and then work on a "scoped" results.

For example, suppose I enter ~/Downloads directory with a gazillion of files, and I want to regain some space by removing large video files. I would hit / and type .mp4, and at this point I only see video files. Now I would like to work on this filtered list, e.g. go through them with j/k, select some with Space, then delete the selection. If I leave the folder and come back, of course I should be able to see full folder again, filter should be forgotten.

Currently, after filtering with .mp4 filter I can go up and down with arrow keys, not with j/k, but filter is still active, so I cannot really select files and delete them. And if I press Enter, then filter will be cancelled.

To be clear, I like the current Enter behavior, it jumps to the search result and I find that useful. But we could maybe have a different shortcut to exit filter mode, similar to Enter, but one that would preserve the filtered results.

What do you think?

Should selection be a set, to prevent duplicates?

  • Pressing Ctrl+a multiple times adds the same time multiple times
  • After selecting a few files with space, and then selecting with Ctrl+a will also add duplicates

If we keep selection in a "set" structure, it should automatically take care of duplicates. Question is, is it a good idea, or will this break some scenarios?

Improve the key bindings further (add `reckless` mode)

I like the key binding changes introduced in e0f8207 so much that I'm now considering an even stricter behavior, where an invalid key press will take you to a mode where the only keys you can use will be esc to escape the mode and ctrl-c to quit the app. This will save you from yourself when you're going too fast, recklessly.

Comments? @maximbaz

Window drawing glitch in i3 after opening LibreOffice

I tried opening a file in a folder using the 'go to' action and then pressing x to open with gui. With a txt file it decided to open with LibreOffice and my window manager (i3) automatically resizes the terminal and LibreOffice. When I close LibreOffice then the terminal with xplr resizes to the original size but some of the ui drawing is missing:

gscreenshot_2021-04-27-145500

The frames seem to be gone. That was where LibreOffice was open. If I open something else and then close that then the frames are drawn properly again.

Simple UI xplr like ranger

First Thanks for develop
Please make default UI simple like python/ranger and for TUI it's use config or something like xplr -s --simple as simple ui
simple ui -> xplr without selection,help section and maybe remove borders!
at the end, sorry for my bad English :)

Using Case Statement with Mimetypes

Hello,

I am experiencing difficulties implementing a simple bash script due to my lack of experience.

- BashExec: |
case $(file --mime-type -b $(cat "${XPLR_PIPE_RESULT_OUT:?}") ) in
video/*) mpv $(cat "${XPLR_PIPE_RESULT_OUT:?}")
< "${XPLR_PIPE_RESULT_OUT:?}") ;;
esac

-PopMode
-Refresh

This did not work on my computer either,
- BashExec: |
case $(file --mime-type -b $(cat "${XPLR_PIPE_RESULT_OUT:?}") ) in
video/*) (while IFS= read -r line; do
mpv "${line:?}"
done < "${XPLR_PIPE_RESULT_OUT:?}") ;;

The other cases are effective though,

text/*) (while IFS= read -r line; do
nvim "${line:?}"
done < "${XPLR_PIPE_RESULT_OUT:?}") ;;

What am I doing incorrectly?

I greatly appreciate your assistance with my inexperience with scripting. 😀

Format when disabling icons

Tiny question, I would have sent a PR but got stuck a little, thought it will be faster to ask 🙂

I want to try to completely disable icons (which is easy, I just set icon: ""), but then there is an extra space, like so:
[ filename]

To remove it, I could just join these two lines to be on a same line, and it helps:

xplr/src/config.yml

Lines 64 to 65 in f582f49

{{{tree}}}{{{prefix}}}{{{meta.icon}}}
{{{relativePath}}}{{#if isDir}}/{{/if}}{{{suffix}}}

But to make it better I thought we can improve this default value, to something like {{{if icon-is-not-empty}}} {{{/if}}} but I don't know how to do that 😄

Curiously grepping for isSymlink (wanted to use as an example) finds nothing... feels like magic 😅

Jump list

History of $PWD is good, but history of jumps would be better.

Push the path to jump history whenever the focus jumps from one location to another.

Also, update the behavior of FocusPath, so that when we send FocusPath: /path xplr will focus on /path. And when we send FocusPath: /path/, xplr will cd into /path. This allows jumping inside empty directories without any if - else.

Auto disown when opening in gui

Upon opening an application in gui the current terminal window is still linked to the gui. Meaning that I cannot close it without it closing the GUI. I am also locked out of the current xplr session. Meaning I cannot browse other files after opening a single file. Upon closing the GUI application the GUI for xplr becomes messed up. (view attached image.)
image

Non-zero error code upon regularly exit

Hi,
just a small thing that I saw when playing around with it. When I exit xplr, it returns a non-zero error code, and writes Error: terminated into stderr. Guessing this is just a bug, because it would actually mess with scripting and piping, if you want to only continue the script if the error code is zero.

So, to summarise:

Expected behavior:
Expected the error code for a regular exit (hitting q, ctrl-c, or esc) to be 0.

Actual behavior:
Error code is non-zero.

Additional info:
Fresh Arch-Linux
Freshly built the app from source through the AUR xplr-git package

Improve config upgrade experience

Hello, I think upgrade experience is suboptimal and we can definitely make it easier / smoother in some ways. I just wanted to throw some ideas in, feedback welcome 🙂

v0.3.8 -> v0.3.12
Just update the version in your config file.

This kind of upgrade sounds like it shouldn't require human intervention at all. Can we make xplr itself bump the version? Or make config version independent on xplr version, such that config version is 1, 2, 3, ..., bumped only when needed, and xplr knows for example that v0.3.8 requires config version of 12 ?

xplr | yq ".config" -y | tee ~/.config/xplr/config.yml

I must say this is very cool idea, but maybe we can also provide a default config to make it a bit easier - you can do it in the repo (e.g. kak-lsp project keeps kak-lsp.toml in the repo and uses it like so) or if you don't think it's a good idea, we can also just generate the config file directly in the AUR pkg, and place it e.g. in /usr/share/xplr/examples/config.yml (cc @orhun).

v0.3.7 -> v0.3.8
...
Else, do the following:

Can we have this changelog not only in wiki, but also in the code / package somehow? Just imagining, I updated xplr, then disconnected from internet, and then I run xplr and uh-oh I must upgrade config but I dont know how without looking at the wiki!

Maybe a simple changelog file that we could also package?

And finally, maybe we can simplify config upgrade for Arch users even more if we leverage pacdiff? In that case honestly I might not even need to look in changelog, if only the lines changed that I didnt edit myself.

This would mean we would need to support reading config not only from ~/.config/xplr/config.yml but also from /etc/xplr/config.yml (which is used only if there is no config in the user dir), and then in PKGBUILD we place the config here instead of in examples folder and mark it with backup= field (cc @orhun). It would require keeping config in /etc dir, so not sure if you like this, but I'm just brainstorming 🙂

Optimize scrolling UI

$ cd "$(mktemp -d)"
$ for i in `seq 0 1000`; do echo $i > $i; done
$ xplr

I expect xplr to show as much files as it could possibly fit, but in fact there is a lot of empty unused space:

image

If I begin to scroll down, it's not using more space:

image

If I resize terminal such that there is less vertical space, xplr even adjusts on the fly - but if I resize back, at some point it just stops using extra space, resulting in the pictures above.

It would be nice to always use all the available space 🙂

Furthermore, once you scroll down (like on the second picture above - so I'm on 946), and then I begin to scroll up again, I expect the cursor to go up but I expect 946 to still be in the view, i.e. view should not be scrolled at this point - like try scrolling up and down in vim in a long document, cursor goes up but screen scrolling should only begin when cursor reaches the top of the screen. Does this make sense? And what do you think in general? 🙂

Sign releases with PGP key

Hey!

I've seen you sign one of the recent commits using your PGP key, that means you must be using PGP 😛

What do you think about signing releases? Instead of providing hashsums (or in addition, if you want).

PGP signatures will not only help ensuring that downloaded archive is not corrupted, but will also verify authenticity and in general reduce attack vector when your app is being built by other people and distributed via distro packages.

For packaging we'd need a signature for sources tarball (.tar.gz) that Github automatically provides for you on every release, signatures for other attachments would be appreciated as well 🙂

Here's what I would suggest to do:

  1. For transparency, put in README your key ID, something like below would be enough (it's my key in the example below):
Releases are signed with the following PGP key: `8053EB88879A68CB4873D32B011FDC52DA839335`
  1. Publish your key to http://keys.gnupg.net/

  2. The sources tarball is reproducible and can be recreated using the following git command:

git archive -o xplr-<version>.tar.gz --format tar.gz --prefix "xplr-<version>/" "<tag>"

So for example, to get a signature you'd run this (mind where v before version is used and where is not):

git archive -o xplr-0.7.2.tar.gz --format tar.gz --prefix "xplr-0.7.2/" "v0.7.2"
gpg --detach-sign xplr-0.7.2.tar.gz
rm xplr-0.7.2.tar.gz

Let me know if you need any help! 🙂

Vim Command Mode support

being able to use vim command is useful!
i know there is key binds : )
but with command we can use it for many things
for example
:help
:delete
:rename
:colorscheme -> set ui color!
Etc...

Suggestion: size support (column, sorting)

What are your thoughts on adding support for file sizes? To have a column with file size, to be able to sort by them?

ncdu integration as you've shown in wiki is nice, and maybe it's enough, I was just thinking about it, and (a) for me personally, a size column would probably be more interesting than mime or index, and (b) some operations like system cleaning although possible to do in ncdu, might be more pleasant to do in xplr.

bonus points: directory sizes, something that even exa doesn't support 🙂

CD to directory instead of just exiting with directory printed

I personally think there should at least be a config option to cd to a directory instead of just exiting, printing the directory. While i do not know much rust, I believe this could be achieved with std::process::Command, which should allow directory management.

Issues with Ctrl+L mapping

Don't know if it's a simple bug, or something hard and we might have to find another binding, but Ctrl+L seems to interfere with terminal's "clear screen" functionality and it breaks UI entirely...

Here's me opening xplr, pressing s and then Ctrl+L:

record_1618826566

Behavior of Backspace key

Currently Backspace is not very intuitive:

  1. You open search with / and start typing, you make a typo, press Backspace and uh-oh everything is gone
  2. You open filter with f and start typing, make a typo, press Backspace, and not only all your filters are gone, but even default "hide hidden files" is gone too

What if we leave Backspace with "usual" behavior of removing one char to the left, and instead find a new binding for "clear everything"? Similar to "Ctrl+R" for reset, maybe "Ctrl+L" (like clear in terminal) or "Ctrl+U" (like in some shells, clear a line)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.