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

[Suggestion]: porting extra functionalities #11

Open
AlejandroSuero opened this issue Sep 5, 2024 · 7 comments
Open

[Suggestion]: porting extra functionalities #11

AlejandroSuero opened this issue Sep 5, 2024 · 7 comments

Comments

@AlejandroSuero
Copy link
Contributor

I made freeze-code.nvim not knowing there was an official plugin from charm-and-friends and I have some extra functionality that may be interested to port, if you are interested of course.

Functionalities:

  • :checkhealth command
  • Downloading freeze if not installed (via go install or native download from github releases and unzipping.
  • Ability to copy image after the screenshot is created (natively or via a third party tool like gclip).
  • Use freeze on selected text or just a line.

Developer side*:

  • Addition of selene or luacheck, can be also included in CI (I prefer selene because it is being maintained and have a more human approach for rules).
  • Adding types to improve lsp.
@meowgorithm
Copy link
Contributor

I think that sounds cool! Ultimately, that's a question for @isabelroses, the maintainer. Whatcha think, Isabel?

@AlejandroSuero
Copy link
Contributor Author

AlejandroSuero commented Sep 5, 2024

@meowgorithm @isabelroses one thing that I forgot to mention it's that apart from copying the image being a feature that once implemented with charmbracelet/freeze#97, it could be added the functionality of opening the image once is written.

I leave a quick demo here showcasing it:

opening_image_after_creation.mp4

Note

As you can see, selecting the line you want and then using, in my case, <leader>fz freeze freeze gets executed and when it's finished, it opens the image.

The :checkhealth command, displays the following:

==============================================================================
freeze-code: require("freeze-code.health").check()

Checking for external dependencies ~
- OK Freeze: found! version: `(unknown)`
- OK GoLang: found! version: `go version go1.23.0 darwin/arm64`
- OK cURL: found! version: `curl 8.7.1 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0`
- OK tar: found! version: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 `
- OK Osascript: found! version: `(unknown)`
- OK xclip: found! version: `(unknown)`
- OK gclip: found! version: `(unknown)`
- OK open: found! version: `(unknown)`

==================================================================================== ~

Note

The requirements may vary depending on the OS, for example:

In Windows it won't use xclip or tar, so this ones won't show up, the same goes for osascript, being needed only by MacOS.

@isabelroses
Copy link
Member

  • :checkhealth command
  • Addition of selene or luacheck, can be also included in CI (I prefer selene because it is being maintained and have a more human approach for rules).
  • Adding types to improve lsp.

These seems like a great ideas to implement!

  • Downloading freeze if not installed (via go install or native download from github releases and unzipping.

I don't think this is worth implementing. The idea seems nice but not worth the effort.

  • Ability to copy image after the screenshot is created (natively or via a third party tool like gclip).

As you already mentioned with your other comment, it maybe better to wait on charmbracelet/freeze#97.

  • Use freeze on selected text or just a line.

This is already a feature :)

@AlejandroSuero
Copy link
Contributor Author

@isabelroses Do you want the open command?

Also, in mine I have an option dir to save the files in an specific location, defaulted to the current pwd. This is because for my use case I have a directory for screenshots and screen-recordings, but if you think is not a necessary addition I understand.

@isabelroses
Copy link
Member

@isabelroses Do you want the open command?

What does that do?

Also, in mine I have an option dir to save the files in an specific location, defaulted to the current pwd. This is because for my use case I have a directory for screenshots and screen-recordings, but if you think is not a necessary addition I understand.

You can use the output option for this with this plugin.

@isabelroses
Copy link
Member

Did my best attempt at adding some of those features.

@AlejandroSuero
Copy link
Contributor Author

The open command it will open the image created after writing it on disk.

opening_image_after_creation.mp4

Comes in handy to check the image instead of going to the terminal or explorer and finding it, specially in the cases where you have it in another directory. Also at least in MacOS, in the preview you can copy it so it saves the action.

This can be pass through an option or, for example, checking the arguments passed when using vim.cmd.Freeze or :Freeze, if passed open=true, it will open it. The ladder could be better so it doesn't open every time and just when using a keymap like <leader><leader>sc instead of <leader>sc for the current behaviour.

AlejandroSuero added a commit to AlejandroSuero/freeze.nvim that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@meowgorithm @isabelroses @AlejandroSuero and others