Commit Graph

556 Commits (main)

Author SHA1 Message Date
Arijit Basu 94154c56df
Consistent help text 2 years ago
Arijit Basu 5c4dec05ed
Don't restrict saving location outside vroot 2 years ago
Arijit Basu 289556f452
Add builtin vroot mode
Also fix ResetVroot
2 years ago
Arijit Basu eba9de5a44
Improve vroot indicator 2 years ago
Arijit Basu e3a5f3c044 Add messages SetVroot and ResetVroot 2 years ago
Arijit Basu a62b72bf2a Add support for --vroot
--vroot helps isolating navigation of an xplr session inside a specific
directory. However, interaction still requires passing full paths
(`/tmp/vroot`). Shell scripts and Lua functions can still access files
outside the virtual root.

This PR also fixes unwanted dot (.) and extra slash (//) issues in paths.
2 years ago
Arijit Basu 00ffd077aa
Upgarde version 2 years ago
Arijit Basu bafe15e25e
Add more hooks 2 years ago
Arijit Basu fc798aad97 Update version 2 years ago
Arijit Basu deb28fa14a Add initial support for hooks
A new optional section of the configuration defined using the lua return
statement, which can be used to define append only things, such as hooks
and callbacks, specific to each config file.

Example

```lua
version = "0.0.0"

return {
  -- Adds messages to pass when xplr loads (similar to `--on-load`)
  on_load = {
    { LogInfo = "Hello xplr user," },
    { LogSuccess = "Configuration successfully loaded!" },
  }
}
```
2 years ago
Arijit Basu 723dd6ec2c Even better error messages 2 years ago
Arijit Basu 4a34780eb4
Improve errors messages `-m` and `-M` 2 years ago
Arijit Basu b05e702536
Actually validate the passed message 2 years ago
Arijit Basu baa8759d68
Minor performance improvement 2 years ago
Arijit Basu 52c8e05a1e
Fix clippy error 2 years ago
Arijit Basu 65eee2dc90
Use serde_yaml::with::singleton_map_recursive 2 years ago
Arijit Basu 77852b435f
Error on missing *-msg-in arguments 2 years ago
Arijit Basu 060544a2b8
Minor fixes 2 years ago
Arijit Basu f8b16a7ddd Rebase main 2 years ago
Arijit Basu 85c4253782 Upgrade version 2 years ago
Arijit Basu 1d829c36e6 Implement -M, --print-msg-in
To help with creating safe arguments for --on-load.

e.g.

```
xplr --on-load $(xplr -M 'ChangeDirectory: %q' "${HOME:?}")
```
2 years ago
Arijit Basu 7c730557f2 Shell escape SRC and TARGET for logging 2 years ago
Arijit Basu 93e9b2b2ae There's no end of arguments for -m 2 years ago
Arijit Basu 3fb174cdc0 Allow using -m outside of xplr shell for debugging
Also validate the message before passing.
2 years ago
Arijit Basu 111a648818 Shell escape file paths in logs 2 years ago
Arijit Basu 1e820030a0 Implement subcommand -m / --pipe-msg-in 2 years ago
Arijit Basu bffe1d43ec Escape newline in selection list 2 years ago
Arijit Basu fbe6b2be10 Improve parsing CLI arguments 2 years ago
Arijit Basu 88fe71779b Add best practices section 2 years ago
Arijit Basu 91e3990df1 Rename messages 2 years ago
Arijit Basu 7b8f38df5b Update is_readonly 2 years ago
Jeremy Cantrell 2b5755aa8a An attempt at safer message passing. 2 years ago
Arijit Basu 895d55ca23
Minor improvement 2 years ago
Arijit Basu 1d20039fae
Improve log rendering 2 years ago
Arijit Basu c93202b649
Minor improvements 2 years ago
Arijit Basu 89b3731b56
Fix serialization error 2 years ago
Arijit Basu bd478ff64b Update serde_yaml to 0.9 2 years ago
Arijit Basu 57483bef41 Use fuzzy search instead of regex search
Ref: https://github.com/sayanarijit/xplr/issues/496
2 years ago
Arijit Basu 93bd53bbcb Add quick scrolling
Not ideal, but better than nothing.

Closes: https://github.com/sayanarijit/xplr/issues/509
2 years ago
Arijit Basu 58c572d77a Fix directory explore scheduling
Fixes https://github.com/sayanarijit/xplr/issues/503
2 years ago
Arijit Basu f2713d9549
Fix support for readline keys 2 years ago
Arijit Basu d579832c69 Update version 2 years ago
Arijit Basu 4e9c056a10 Custom input prompts for different modes without SetInputPrompt
Closes: https://github.com/sayanarijit/xplr/issues/502
2 years ago
Arijit Basu b4ba56aa72 Fix regex deserialization
Fixes https://github.com/sayanarijit/xplr/issues/503
2 years ago
Arijit Basu 096e520a2b Fix clippy err 2 years ago
Arijit Basu f10fad958d Upgrade deps 2 years ago
Arijit Basu 9f9a6f9d73 Parse file UID and GID
Closes https://github.com/sayanarijit/xplr/pull/494
2 years ago
Arijit Basu d8ff70bcaa
Fix typo 2 years ago
Arijit Basu c42c4dc69d
Fix doc 2 years ago
Arijit Basu 95f1f45375
Reduce the selection pane height 2 years ago
Arijit Basu bf354352d5 Upgrade version 2 years ago
Arijit Basu bea0f277bc Add global key bindings that can be overwritten.
- Use `xplr.config.general.global_key_bindings` to define a set of
  key bindings that are available by default in every mode. e.g `esc`
  and `ctrl-c`.
- Remove boilerplate config from `init.lua`.
- Update docs.
2 years ago
Arijit Basu 4c4d3843e9
Avoid using unnecessary prompts
Problem with long paths.
2 years ago
Arijit Basu a2f246f61e
Improve the "duplicate as" prompt 2 years ago
Arijit Basu 27394dd177
Tab completion for "duplicate_as" mode 2 years ago
Arijit Basu 88416d862e
Minor improvement 2 years ago
Arijit Basu 5370cc2e8c Go to path and native auto completion on tab
- BREAKING: Rename mode `create directory` and `create file` to
  `create_directory` and `create_file`.
- Add key binding `gp` to go to a given path from input.
- Add function `fn.builtin.try_complete_path` to auto complete the path
  in input buffer.
- Use `tab` to auto complete path in `rename`, `create_file`,
  `create_directory` and `go_to_path` modes.
- Show different prompts in different modes.

And some cleanup.
2 years ago
Arijit Basu e5576e2990 Fix typo 2 years ago
Arijit Basu e04b0964ae Use 89 chars line length 2 years ago
Arijit Basu 21b8c3e807 Make clippy happy 2 years ago
Arijit Basu 744b68197d Some optimizations 2 years ago
Arijit Basu 02b631bf83 Strict NO_COLOR compliance and some cleanups 2 years ago
Arijit Basu 61d3b1635e Use NO_COLOR to disable OSC 7 2 years ago
Arijit Basu d35a4c58cb Write OSC 7 escaped codes on a the tui backend 2 years ago
Arijit Basu 47f7d51e46 Cleanups 2 years ago
Arijit Basu de856b7870 Implement Write 2 years ago
Arijit Basu 2f9992bf8b OSC 7 fixes
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2 years ago
Arijit Basu 3c8f6e1b08 Experiment with OSC 7
Ref: https://github.com/wez/wezterm/issues/2054
2 years ago
Arijit Basu 07b2374616
Make the table a little compact 2 years ago
Arijit Basu e655c245c5 Optimize regex search further
No need to compile both regex and iregex.
2 years ago
Arijit Basu f324e976da Compile regex only when required 2 years ago
Arijit Basu 95248ae6d1 Cleanup 2 years ago
Arijit Basu e2cf313ee2 Optimize regex search
Compile regex once and reuse it.
2 years ago
Arijit Basu cb2851875c
Fix mime_essence doc - again 2 years ago
Arijit Basu dc8cb30eb3
Fix mime_essence docs 2 years ago
Arijit Basu cf052d2691
Fix doc 2 years ago
Arijit Basu 6f626d1ba0
Clarify metadata API 2 years ago
Arijit Basu 3da8140bb1
Fix printing unicode 2 years ago
Arijit Basu e006152066 Upgrade version 2 years ago
Arijit Basu 2179be473f Fix docs 2 years ago
Arijit Basu cc5b996db9 Add remove last filter 2 years ago
Arijit Basu d9465f1a57 Display in the table 2 years ago
Arijit Basu 8e1d16b751 Remove merge conflicts 2 years ago
Arijit Basu 37e660e0a6 Improve timestamp support 2 years ago
Shunsuke Mie 626a48cf88 Update init.lua to show a last modification column 2 years ago
Shunsuke Mie 57c29d47c5 Support a column shows time of modification 2 years ago
Arijit Basu 09002d0e65 Add support for null characters as separator
- Use `--read0 -` to read `\0` separated paths from stdin.
- Use `--write0` to write `\0` separated paths to stdout.
- Use `-0` or `--null` to combine `--read0` and `--write0`.
2 years ago
Arijit Basu 86f56cc051 Fix search navigation 2 years ago
Arijit Basu 5f598648a8 Make the prompt not null 2 years ago
Arijit Basu d2390285fb Fix doc 2 years ago
Arijit Basu 1de737cefa Add regex support and dynamic input prompt
- Add new regex filters
  - `RelativePathDoesMatchRegex`
  - `RelativePathDoesNotMatchRegex`
  - `IRelativePathDoesMatchRegex`
  - `IRelativePathDoesNotMatchRegex`
  - `AbsolutePathDoesMatchRegex`
  - `AbsolutePathDoesNotMatchRegex`
  - `IAbsolutePathDoesMatchRegex`
  - `IAbsolutePathDoesNotMatchRegex`
- Search mode now defaults to regex
- Added new message `SetInputPrompt` to set the input prompt
  dynamically.
2 years ago
Arijit Basu 3cfed5aa6f
Improve docs 2 years ago
Arijit Basu 0d12762c1d
Upgrade tui-input to 0.4.0 2 years ago
Arijit Basu a66d5e05d5
Upgrade to tui-input 0.3 2 years ago
Arijit Basu 2bd4346156 Improve CLI help menu 2 years ago
Arijit Basu 6d9d324a7d
Upgrade version 2 years ago
Arijit Basu 171c93dbb1 Fix ansi colors
Also upgrade deps and do some cleanup.
2 years ago
Arijit Basu 6c775d72dc
Bold directories 2 years ago
Arijit Basu f6364b5403 Try a new UI 2 years ago
Arijit Basu 9673eba89c Upgrade version
- Upgrade rust to 1.58.1
- Upgrade rust edition to 2021
- Upgrade xplr packages
2 years ago
Arijit Basu 583f685627
Minor line gap 2 years ago
Arijit Basu aca6127166
Minor fixes 2 years ago
Arijit Basu 0472bc3e66 Auto generate docs 2 years ago
Arijit Basu dfb4854f01
Set cursor position based on prompt 2 years ago
Arijit Basu bfd403c894 Upgrade version 2 years ago
Arijit Basu 3d81a49cec Auto generate messages docs
- Huge refactor.
- Run `python docs/script/generate.py` to generate `docs/en/src/messages.md`.
2 years ago
Arijit Basu 67eca1ecdf
More doc fixes 2 years ago
Arijit Basu 8385b92661
Minor doc improvements 2 years ago
Arijit Basu ca211bb073 Auto generate some API docs from init.lua
This is the beginning of the xplr documentation revolution.

Closes: https://github.com/sayanarijit/xplr/issues/445
2 years ago
Arijit Basu ecc59b1d9d Option to configure wrapping on move
Closes: https://github.com/sayanarijit/xplr/issues/441
2 years ago
Arijit Basu 618ade53ec Document init.lua
Ref: https://github.com/sayanarijit/xplr/issues/445
2 years ago
Arijit Basu 721ffd0216 Support custom `border_type` and `border_style`
This adds support for defining custom border types and border styles.

Example:

```
xplr.config.general.panel_ui.default.border_type = "Thick"
xplr.config.general.panel_ui.default.border_style.fg = "Black"
xplr.config.general.panel_ui.default.border_style.bg = "Gray"
```

Closes: https://github.com/sayanarijit/xplr/issues/448
2 years ago
Arijit Basu 087f3b0d52 Version 0.17.2 2 years ago
Arijit Basu bb65870ee0 CLI for a better "cd on quit"
Use `--print-pwd-as-result` to print the last working directory instead
of the focused or selected nodes, when you quit using the `PrintResultAndQuit`
message (i.e. by pressing `enter`).

This helps with implementing the "cd on quit" functionality using a plain shell
alias.

Example:

```
alias xcd='cd "$(xplr --print-pwd-as-result)"'
```

With this alias set, you can navigate directories using xplr by entering
`xcd` command, and when you quit by pressing enter, you will enter the
directory.

You can of course, quit with plain `Quit` (i.e. by pressing `esc`) to
gracefully cancel "cd on quit".
2 years ago
Arijit Basu e6ea983a8a Add "duplicate as"
Closes https://github.com/sayanarijit/xplr/issues/434
2 years ago
Arijit Basu e2c3251736
Fix focus when creating files in non-$PWD location 2 years ago
Arijit Basu 4ff11c2ef4 Upgrade version 2 years ago
Arijit Basu 24bd6d9f00 Merge the pending changes from #429 2 years ago
Arijit Basu 729b51d674 Create parent directories before creating the file 2 years ago
Tom van Dijk 17f3893198
Debug mode
Features:
- Display debug menu on configuration error
- Configure wether xplr should show the debug menu
    (through `debug_on_error`)
- Open logs in editor
- Redirect people to the issues page on Github.
2 years ago
Arijit Basu cdd60eef4c
Format init.lua consistently 2 years ago
Arijit Basu c89d5a45f1
Fix NixOS tests 2 years ago
Arijit Basu 3142cdd3ec Upgrade version 2 years ago
Arijit Basu 7b9e4deff5 Support passing argument to `LuaEval` and `LuaEvalSilently`
If the argument of `LuaEval` evaluates to a function, xplr will try to
pass Lua Context to it.

Example:

```lua
{ LuaEval = [[function(app) return { { LogInfo = app.pwd } } end]] }
```

Closes: https://github.com/sayanarijit/xplr/issues/394
2 years ago
Arijit Basu 8f5e5491f2 Optimize change directory performance
This PR breaks the custom layout renderer API by deprecating the
following heavyweight fields in the Lua Context passed to the renderer
functions.

The following fields are being deprecated:

- app.directory_buffer
- app.history
- app.last_modes

However, there's no change in the Lua Context passed to the functions
called via `CallLua*` messages.

Closes: https://github.com/sayanarijit/xplr/issues/418
2 years ago
Arijit Basu b7d86ae1ec Serialize None to nil
Fixes: https://github.com/sayanarijit/xplr/issues/417
3 years ago
Tom van Dijk b1ac4944ab `help_hide_remaps` -> `hide_remaps_in_help_menu` 3 years ago
Tom van Dijk 263eb5943a Introduce `general.help_hide_remaps` config entry. 3 years ago
Arijit Basu def98de9b3 Upgrade version 3 years ago
Arijit Basu 5b710070a3 Optimize more 3 years ago
Arijit Basu 41c387542f Fix auto jumping on cursor when visiting large dir 3 years ago
Arijit Basu 7c7351c2e8 Optimize optimization hack 3 years ago
Arijit Basu 5211e4fa40 Fix Lua API performance by caching
Fixes: https://github.com/sayanarijit/xplr/issues/412
3 years ago
Arijit Basu 132b528a5d
Remove trailing `.` in the CLI help menu 3 years ago
Arijit Basu d2c5f49835 Fix CD (try again) 3 years ago
Arijit Basu 296d93a81a Fix linux gnu bin release 3 years ago
Arijit Basu 605b2bc391 Fix CD for musl 3 years ago
Arijit Basu 9d088239ea Upgrade to 0.16.0 3 years ago
Arijit Basu 24637449a3
Improve CLI help 3 years ago
Arijit Basu f78d9e99fd
Remove debug statement and add tests 3 years ago
Arijit Basu 8e00b3e658
Add scroll for the input buffer 3 years ago
Arijit Basu b0c91a954e
Improve update_input_buffer 3 years ago
Arijit Basu 074217f21e Fix issue with input buffer 3 years ago
Arijit Basu 48ab6eac21 Add on_function key handler
This adds `on_function` handler to handle F1-F12 keys.

This also fixes issues with previously added handlers and adds a
checklist for future additions.
3 years ago
Arijit Basu 6a3b26cc18 Add support for LuaEval(Silently) messages
This PR adds support for quickly executing arbitrary lua functions,
without needing to define a function.

Example:

```lua
xplr.config.modes.builtin.default.key_bindings.on_key["#"] = {
  help = "test",
  messages = {
    { LuaEvalSilently = [[return { { LogInfo = "foo" } }]] },
    { LuaEval = [[return { { LogInfo = io.read() } }]] },
  },
}
```

Partly closes: https://github.com/sayanarijit/xplr/issues/394
3 years ago
Arijit Basu 165d992b75 Fix logs UI
Fixes: https://github.com/sayanarijit/xplr/issues/396
3 years ago
Arijit Basu 05c2f7aa68 Support more control over input buffer
This PR adds a new message: `UpdateInputBuffer: InputOperation`

This makes it possible to perform cursor based input operations without
needing input from the keyboard.
3 years ago
Arijit Basu b45a553a0c Add more keyboard input handlers
This PR adds 3 more keyboard input handlers:

- on_alphanumeric
- on_character
- on_navigation

Also updates documentation.
3 years ago
Arijit Basu ca6cefb1c1 Use tui-input to handle input buffer
New message: `UpdateInputBufferFromKey` to replace most
`BufferInputFromKey` usage.

This adds more functionalities to the input buffer and reduces
boilerplate code.

This commit also deprecates `config.general.cursor` as the cursor will
be set by the terminal from now.

Repo: https://github.com/sayanarijit/tui-input
3 years ago
Shunsuke Mie f5131b08ab Change to use `PWD` env vairable to get current dir
Fixes 285.
3 years ago