Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: redesign configuring kitty-scrollback.nvim #69

Closed
4 of 6 tasks
mikesmithgh opened this issue Nov 26, 2023 · 4 comments · Fixed by #118
Closed
4 of 6 tasks

feat: redesign configuring kitty-scrollback.nvim #69

mikesmithgh opened this issue Nov 26, 2023 · 4 comments · Fixed by #118
Assignees
Labels

Comments

@mikesmithgh
Copy link
Owner

mikesmithgh commented Nov 26, 2023

Important

If you have had any pain points configuring kitty-scrollback.nvim, please add a comment or suggestion.

Warning

Breaking change

  • Remove nvim defaults --clean --noplugin -n

    • By defaulting to no config, it is confusing to the user why their configurations are not picked up by kitty-scrollback.nvim. Current state: specify --no-nvim-args or --nvim-args <args> to read the kitty-scrollback.nvim configuration.
    • Remove --no-nvim-args since it no longer applies
      • Document the new behavior and detail how the user can continue using --clean --noplugin -n if desired. This is a breaking change and requires the user to configure if they want the existing functionality.
  • Different configuration options:

    -u <user-config>.lua
    --env NVIM_APPNAME=user-config
  • Revisit reserved config names, global, default, ksb_builtin_*, ksb_example_*

- Consider creating a symlink or copying the kitty_scrollback_nvim.py kitten to Kitty's configuration directory to avoid absolute path in action_alias kitty_scrollback_nvim. See #114
- Option: add to bootstrapping logic, try to do it in a generic way to support lazy/packer/pack/etc
- Option: Add to the :KittyScrollbackGenerateKittens command.
- Option: Create a wrapper kitten that resolves the path and calls kitty_scrollback_nvim.py
-Investigate: user uses environment variable or kitty --config could change path of kitty config directory?

@PlexSheep
Copy link

Surprisingly, I've found that just using --nvim-args SOMETHING does a really good job for me! Where as --no-nvim-args takes more than 10 seconds to load and then pushes me into my dashboard with weird red lines, This loads a window that looks like default nvim but with plugins and my custom shortcuts. I use lazy to load plugins, but I can even use things like leap in there. Since leap is declared as not lazy, I assume this just loads all my non lazy plugins, which I think is a fine compromise for a usecase like this.

font_family      FiraCode Nerd Font
font_size 15.0
disable_ligatures never
scrollback_pager nvim -c 'setlocal number|Man!' -c "autocmd VimEnter * normal G" -
enable_audio_bell no
visual_bell_duration 0.01
visual_bell_color yellow
window_alert_on_bell yes
bell_on_tab "🔔 "
tab_bar_edge top
tab_bar_style powerline
tab_powerline_style slanted
tab_title_template "{index} {fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}"
foreground #dddddd
background #111111
shell zsh
editor nvim
allow_remote_control socket-only
listen_on unix:///tmp/kitty.sock
env KITTY_TERM=TRUE
shell_integration enabled

# kitty-scrollback.nvim Kitten alias
action_alias kitty_scrollback_nvim kitten /home/plex/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py --nvim-args kitty

# Browse scrollback buffer in nvim
map kitty_mod+h kitty_scrollback_nvim
# Browse output of the last shell command in nvim
map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
# Show clicked command output in nvim
mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output

map alt+e        next_tab
map alt+q     previous_tab

I personally would be happier, if this plugin would work a little more like firenvim (which I'm using to write this) in that it just loads the nvim gui into the program, but I can only assume that integrating neovim as a gui into another gui must be really complicated.

@mikesmithgh
Copy link
Owner Author

@PlexSheep

--no-nvim-args takes more than 10 seconds to load and then pushes me into my dashboard with weird red lines

That sounds like a bug. Could you create an issue for this with a screenshot and info on what plugin you are using for the dashboard? Most likely kitty-scrollback.nvim is having an issue because it expects an empty buffer.

--nvim-args kitty

This is actually passing kitty to nvim. Which opens a file named kitty. Most likely, the file does not exist and kitty-scrollback.nvim just uses that as the empty buffer and overwrites it.

Right now, I am planning to remove --no-nvim-args and have kitty-scrollback.nvim use the user's nvim configuration. But, I'll still leave --nvim-args if the user wants to pass arguments to change the behavior (e.g., the current default is --clean --noplugins -n).

personally would be happier, if this plugin would work a little more like firenvim

I have not used firenvim but it does look nice. Right now, kitty-scrollback.nvim loads the scrollback buffer into nvim. I'm not sure how the other approach would differ that you mentioned.

Thanks for the feedback!

@PlexSheep
Copy link

That sounds like a bug. Could you create an issue for this with a screenshot and info on what plugin you are using for the dashboard? Most likely kitty-scrollback.nvim is having an issue because it expects an empty buffer.

See here

This is actually passing kitty to nvim. Which opens a file named kitty. Most likely, the file does not exist and kitty-scrollback.nvim just uses that as the empty buffer and overwrites it.

That could explain it! Perhaps, would it be a good idea to pass some file name or path by default to bypass dashboards and other stuff that happens when nvim is called without arguments?

I have not used firenvim but it does look nice. Right now, kitty-scrollback.nvim loads the scrollback buffer into nvim. I'm not sure how the other approach would differ that you mentioned.

I'm not sure about the technicalities, but from my understanding, the "host" provides a gui window inside it's own gui, which is "inhabited" by a neovim. This would be pretty out of scope for this plugin, as it would probably require changes in kitty itself. So just ignore me :)

@mikesmithgh mikesmithgh self-assigned this Jan 24, 2024
@mikesmithgh mikesmithgh linked a pull request Jan 27, 2024 that will close this issue
14 tasks
mikesmithgh added a commit that referenced this issue Jan 29, 2024
closes #69

BREAKING CHANGE: kitty-scrollback.nvim loads your Neovim configuration by default. Previous versions of kitty-scrollback.nvim, did not load any configurations or plugins by default.

  - Previously, kitty-scrollback.nvim did not open Neovim with your Neovim configuration by default. This has changed to loading your Neovim 
  configuration by default, with the ability to opt out. If you prefer to continue not loading your Neovim configuration, then follow the
  steps at [No Configuration](#no-configuration).
  - If you previously used the flag `--no-nvim-args`, then delete it from your configuration because it no longer has any effect. The flag 
  `--nvim-args` remains unchanged and can still be used.
  - `ksb_example` configurations have been removed and can no longer be referenced by name. If you were previously referencing an example configuration
  by name, then you can manually copy it from [./tests/example.lua](./tests/example.lua) into your kitty-scrollback.nvim configuration. See 
  [Plugin Configuration](#plugin-configuration) for detailed instructions on configuration kitty-scrollback.nvim. 
  - The command `KittyScrollbackGenerateKittens` and api `generate_kittens` no longer have an option to generate `ksb_example` configurations.
    - The command `KittyScrollbackGenerateKittens` no longer accepts the bang `!` modifier
    - The api `generate_kittens` signature removed the `all` parameter
  - The reserved `global` configuration name has been removed and global options are now configured by the first element of the options table without a key.
  See [Global Configuration](#global-configuration) for more details.
  - The undocumented reserved `default` configuration name has been removed. kitty-scrollback.nvim defaults to `ksb_builtin_get_text_all` if no configuration is provided.
mikesmithgh pushed a commit that referenced this issue Jan 29, 2024
# [4.0.0](v3.2.1...v4.0.0) (2024-01-29)

* feat!: redesign kitty-scrollback.nvim configuration (#118) ([97fea1b](97fea1b)), closes [#118](#118) [#69](#69)

### BREAKING CHANGES

* kitty-scrollback.nvim loads your Neovim configuration by default. Previous versions of kitty-scrollback.nvim, did not load any configurations or plugins by default.

  - Previously, kitty-scrollback.nvim did not open Neovim with your Neovim configuration by default. This has changed to loading your Neovim
  configuration by default, with the ability to opt out. If you prefer to continue not loading your Neovim configuration, then follow the
  steps at [No Configuration](#no-configuration).
  - If you previously used the flag `--no-nvim-args`, then delete it from your configuration because it no longer has any effect. The flag
  `--nvim-args` remains unchanged and can still be used.
  - `ksb_example` configurations have been removed and can no longer be referenced by name. If you were previously referencing an example configuration
  by name, then you can manually copy it from [./tests/example.lua](./tests/example.lua) into your kitty-scrollback.nvim configuration. See
  [Plugin Configuration](#plugin-configuration) for detailed instructions on configuration kitty-scrollback.nvim.
  - The command `KittyScrollbackGenerateKittens` and api `generate_kittens` no longer have an option to generate `ksb_example` configurations.
    - The command `KittyScrollbackGenerateKittens` no longer accepts the bang `!` modifier
    - The api `generate_kittens` signature removed the `all` parameter
  - The reserved `global` configuration name has been removed and global options are now configured by the first element of the options table without a key.
  See [Global Configuration](#global-configuration) for more details.
  - The undocumented reserved `default` configuration name has been removed. kitty-scrollback.nvim defaults to `ksb_builtin_get_text_all` if no configuration is provided.
@mikesmithgh
Copy link
Owner Author

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants