Commit Graph

213 Commits (053615b0415caae1159297718223f2a3b46a3827)

Author SHA1 Message Date
Arijit Basu 053615b041 Fix linting errors 2 years ago
Arijit Basu 01060ed025
Add $XPLR_INITIAL_PWD and 'gi' key binding
This will allow enable workspace like features, without using vroot.
2 years ago
Arijit Basu 71bd2e2776
Add more vroot options
- ToggleVroot
- UnsetVroot

Along with key bindings.
2 years ago
Arijit Basu 289556f452
Add builtin vroot mode
Also fix ResetVroot
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 bafe15e25e
Add more hooks 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 65eee2dc90
Use serde_yaml::with::singleton_map_recursive 2 years ago
Arijit Basu 1e820030a0 Implement subcommand -m / --pipe-msg-in 2 years ago
Arijit Basu fbe6b2be10 Improve parsing CLI arguments 2 years ago
Arijit Basu 91e3990df1 Rename messages 2 years ago
Jeremy Cantrell 2b5755aa8a An attempt at safer message passing. 2 years ago
Arijit Basu 89b3731b56
Fix serialization error 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 4e9c056a10 Custom input prompts for different modes without SetInputPrompt
Closes: https://github.com/sayanarijit/xplr/issues/502
2 years ago
Arijit Basu 096e520a2b Fix clippy err 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 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 e04b0964ae Use 89 chars line length 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 2179be473f Fix docs 2 years ago
Arijit Basu 8e1d16b751 Remove merge conflicts 2 years ago
Arijit Basu 37e660e0a6 Improve timestamp support 2 years ago
Shunsuke Mie 57c29d47c5 Support a column shows time of modification 2 years ago
Arijit Basu 5f598648a8 Make the prompt not null 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 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 171c93dbb1 Fix ansi colors
Also upgrade deps and do some cleanup.
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 ecc59b1d9d Option to configure wrapping on move
Closes: https://github.com/sayanarijit/xplr/issues/441
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 24bd6d9f00 Merge the pending changes from #429 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 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 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 f78d9e99fd
Remove debug statement and add tests 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