Commit Graph

893 Commits (main)
 

Author SHA1 Message Date
Arijit Basu aa7a441751 Make mode visible in input/logs panel
Also, map ":q" to "quit" action.

Ref: https://github.com/sayanarijit/xplr/issues/158
3 years ago
Arijit Basu db669cdcbf Remove "remaps:"
Remaps has been removed to simplify key bindings. With Lua, it's now
possible to remap using basic assignments.

For e.g.

```Lua
xplr.config.modes.builtin.default.key_bindings.on_key["v"] = xplr.config.modes.builtin.default.key_bindings.on_key.space
```

Help menu will auto detect remapped keys and display after removing the
redundant mappings.

Ref: https://github.com/sayanarijit/xplr/discussions/183#discussioncomment-774159
3 years ago
Arijit Basu cb695fcaa7 Add colorful permissions
Ref: https://github.com/sayanarijit/xplr/issues/187
3 years ago
Arijit Basu 91838f88ce Fix symlink handling
- Broken symlink should display without error.
- Display the symlink destination.
- Fix deleting symlinks pointing to a directory.

Fixes: https://github.com/sayanarijit/xplr/issues/185
3 years ago
Arijit Basu b86be16ee3 Make structs public
Public structs enable automatec documentation.
xplr is not (yet) a library. Even it want to become one, making fields
private is probably not the right way.
3 years ago
Arijit Basu 74a0ecb922 Fix icons 3 years ago
Arijit Basu a80bf2d683 Final touches for v0.10.0 3 years ago
Arijit Basu b99fa927bf Get out of beta now 3 years ago
Arijit Basu bfdb7736b9 Simplify pipe reader
Make pipe readers and call lua behave in a similar way.
3 years ago
Arijit Basu 84a50a8fde Add CallLua and CallLuaSilently
This works:

```lua
xplr.fn.custom.ping = function(app)
  print("What's your name?")
  local name = io.read()
  os.execute('read -p "Hello ' .. name .. ', you are in ' .. app.pwd .. '"')
  return {
    { LogSuccess = "pong" },
  }
end
```

Then it can be called via `CallLua: custom.ping`.
3 years ago
Arijit Basu cdb3560e12 Read input pipe only once when commands execute
The initial idea was to enable other tools to control `xplr` via the
input pipe. However, so far I didn't feel the need to use this feature.
And even if there is any need, it's much better to implement ad-hoc
services instead of wasting cpu resources.
3 years ago
Arijit Basu 10e874afe7 Fall back to default config when custom config fails
When the custom `init.lua` is corrupt, xplr will fall back to default
configuration, logging the encountered error after load.
3 years ago
Arijit Basu f9d13e5e4c Fix initial directory sync issue 3 years ago
Arijit Basu 4da481bf5c Cleanup all the YAML overwriting logics 3 years ago
Arijit Basu 25a9d03237 Finish porting config.yml to init.lua 3 years ago
Arijit Basu da1d7742f7 Fully migrate to init.lua
This PR aims to fully migrate `config.yml` to `init.lua`

Also, use `builtin.foo_func` instead of `xplr.fn.builtin.foo_func`.
Similarly, use `custom.foo_func` instead of `xplr.fn.custom.foo_func`.

Closes: https://github.com/sayanarijit/xplr/issues/160
3 years ago
Arijit Basu 0a2f2aeda8 Fix version 3 years ago
Arijit Basu eb06342523 Update version 3 years ago
Arijit Basu e977aeb7d3 Fix MacOS error directory not empty
With this change, xplr will delete the pipe files when command execution
is over.
3 years ago
Arijit Basu 003e90a7d1 Improve history further 3 years ago
Arijit Basu 97aa2ff8b4 Fix initial focus 3 years ago
Arijit Basu 5b2aee3479 Improve history navigation
Make path history behave like jump list and allow jumping back and
forth in the same directory.
3 years ago
Arijit Basu 5c179a9b70 Add optional mouse handler
Mouse actions will be enabled on devices that support it.
Because sometimes, scrolling with mouse is the laziest way to navigate.
3 years ago
Arijit Basu d96e620120 Begin porting config.yml to init.lua
This commit begins porting of `config.yml` to `init.lua`.
As of now, it's not be possible to do the complete migration
because of how lua and yaml handles `null`/`nil` value.

So, we will need to completely deprecate `config.yml` in order to do the
complete migration.
3 years ago
Arijit Basu 074e0d1250 Replace handlebars with Lua
Replace handlebars with Lua functions by introduction Lua function API.
3 years ago
Arijit Basu 85696ded7a
Hide demo to speed to page load 3 years ago
Arijit Basu 79855dba15 Fix CallSilently
Closes: https://github.com/sayanarijit/xplr/issues/163
3 years ago
Arijit Basu 6cc863e6d4 Add send+anyhow support for mlua
Ref: https://github.com/khvzak/mlua/issues/48
3 years ago
Arijit Basu f744553a0a Add support for native lua bindings
Ref: https://github.com/sayanarijit/xplr/discussions/146#discussioncomment-741580
3 years ago
Arijit Basu 98687515d7
Use editor to open the focus path 3 years ago
Arijit Basu 7eabd3fb7d Fix selecting broken symlink 3 years ago
Arijit Basu 8e98da5004 Add support for un-mapping keys.
Use `remaps: {key: null}` to un-map a key.

Also,
- `gx` will now open only the file under focus.
- `:sx` will open the selected files.

And other minor improvements.

Discussion: https://github.com/sayanarijit/xplr/discussions/146
3 years ago
Arijit Basu 57a0a49aae Hide logs also when calling subprocess 3 years ago
Arijit Basu c5b461f795 Increase the input poll timeout
The input poll timeout needs to stay low, else xplr will panic when you
spawn a subshell and start typing immediately.

From the `top` command, it didn't show any noticeable overhead.
3 years ago
Arijit Basu d944828d2f Minor improvements in some operations 3 years ago
Arijit Basu 96f3640fc0 Rename `reckless` to `recover`
Also, improve the warning message.
3 years ago
Arijit Basu ae8a391064 Introduce `PopMode`
This change requires manual `Refresh` after mode switches.
Also, fix the rename operation.
3 years ago
Arijit Basu 7588620c8f Hind logs when switching to input mode
Ref: https://github.com/sayanarijit/xplr/pull/143#issuecomment-840069000
3 years ago
Arijit Basu 65fa408fea Stay in filter mode after applying filters
Also stay in create mode after creating files and directories.
3 years ago
Arijit Basu c68bd96253 Add reckless mode
Pressing an invalid key will take you to the "reckless" mode. All you
need to do is calm down, escape that mode, and try again.

Closes: https://github.com/sayanarijit/xplr/issues/142
3 years ago
Arijit Basu efec86c616 Clear selection after copy 3 years ago
Arijit Basu e0f8207900 Improve key bindings
Stay in the current mode when key input is not recognised. It's better
to do nothing than doing something wrong, at least when dealing with
important files and folders.
3 years ago
Arijit Basu c8dba61d4b Further optimize performance and CPU usage
- Optimize by avoiding cloning the whole app in each iteration of the main
loop.
- Increase the input poll timeout from 1 to 200. This works because the
poll will not apply to key hold.
- Do not read input pipe if it hasn't been modified.
3 years ago
Arijit Basu e7ec27e359
Add commtit activity badge
Pretty active!
3 years ago
Arijit Basu 11a5ca168f
Update CONTRIBUTING.md 3 years ago
Arijit Basu 161b5fb1fe
Update CONTRIBUTING.md 3 years ago
Arijit Basu 67df321cd9
Update CONTRIBUTING.md 3 years ago
Arijit Basu 7f1d29f558
Create CONTRIBUTING.md 3 years ago
Arijit Basu 82b975c5f0 Fix some sync issues
Handle out messages immediately instead or scheduling in messages.
3 years ago
Arijit Basu cd5bf81646 Optimize performance
```
Benchmarking focus next item: Collecting 100 samples in estimated 5.1972 s (126k itera                                                                                      focus next item         time:   [41.216 us 41.346 us 41.494 us]
                        change: [-28.669% -28.110% -27.551%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

Benchmarking focus previous item: Collecting 100 samples in estimated 5.0576 s (116k i                                                                                      focus previous item     time:   [43.589 us 43.754 us 43.927 us]
                        change: [-29.506% -28.748% -28.039%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

Benchmarking focus first item: Collecting 100 samples in estimated 5.1765 s (116k iter                                                                                      focus first item        time:   [44.071 us 44.340 us 44.634 us]
                        change: [-26.739% -26.314% -25.885%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe

Benchmarking focus last item: Collecting 100 samples in estimated 5.1522 s (116k itera                                                                                      focus last item         time:   [43.950 us 44.214 us 44.541 us]
                        change: [-27.571% -26.953% -26.337%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe

Benchmarking leave and enter directory: Collecting 100 samples in estimated 5.4863 s (                                                                                      leave and enter directory
                        time:   [96.645 us 96.915 us 97.234 us]
                        change: [-28.720% -27.224% -25.666%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
```
3 years ago