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

[Feature Request]: Multicursor and preserving replacement feature #126

Open
johmsalas opened this issue Dec 18, 2023 Discussed in #125 · 9 comments
Open

[Feature Request]: Multicursor and preserving replacement feature #126

johmsalas opened this issue Dec 18, 2023 Discussed in #125 · 9 comments
Assignees

Comments

@johmsalas
Copy link
Owner

Discussed in #125

Originally posted by johmsalas December 18, 2023
Inspired by microsoft/vscode#106502
There is a plugin for vscode https://marketplace.visualstudio.com/items?itemName=Cardinal90.multi-cursor-case-preserve

Compared to the existing VsCode solution, if this feature is implemented in text-case.nvim it can use all the supported Text Cases in the plugin.

Replacement considerations

  • When ctrl+d (customizable keybinding) is pressed it will highlight the next occurrence, even if the text case is different as long as the base is the same
  • Support for visual mode. It will use the selected text as the base for the considered text variations
  • Support for normal mode. It will compute the current word. Taking into account the current word could have characters like _, -, . or /
  • Multiline support adds extra complexity, I don't think there is a common use case for this

Multicursor considerations

  • It would include custom multicursor selection because regular multicursor plugins/implementations are decoupled from text cases, they do not select different text cases (it becomes unsupported when the text cases are in snake, pascal, ...)
  • The multicursor would only support few operations. So far the only known operation is Change Preserving Case. No delete, change, etc... regular keybindings won't work on the selected cursors.
  • Once the locations are selected using ctrl+d. There are 2 ways of triggering the Change Preserving Case
    • Pressing c. This is the natural way, but requires to register a keymap on the letter c on visual mode. This could be disruptive to the original c keybinding. Perhaps indications using Hydra?
    • A custom keybinding, ie gax. Unnatural developer experience

Created a draft to outline the code design: #124
Will update this desc when there are more conclusions to keep track of them

@johmsalas johmsalas changed the title Feature: Multicursor and preserving replacement feature [Feature Request]: Multicursor and preserving replacement feature Dec 18, 2023
@johmsalas johmsalas self-assigned this Dec 18, 2023
@johmsalas johmsalas added this to the Release next milestone Dec 18, 2023
@tonmoy998
Copy link

sorry to ask ! How did you have a graph like background in neovim?

@johmsalas
Copy link
Owner Author

How did you have a graph like background in neovim

@tonmoy998 Do you have a picture or link to that background? Not sure I understand the question

@tonmoy998
Copy link

tonmoy998 commented Dec 21, 2023

I am asking about the neovim background.I have a clean dark background where you have background like graph

screenshot-2023-12-21_10-10-57

@tonmoy998
Copy link

Is it terminal background or Neovim ? 🤔🤔

@johmsalas
Copy link
Owner Author

johmsalas commented Dec 21, 2023

@tonmoy998 Unfortunately, it must be due to the file compression when the image was uploaded. In my current setup, the terminal (iterm2+tmux) has reduced opacity (see the wallpaper is visible behind the words on the right panel), yet Neovim is 100% opaque and I didn't put more time to solve it, perhaps the theme background?

image

@tonmoy998
Copy link

Ok.Thank you

@tonmoy998
Copy link

Cool! Fixed it ;)
screenshot-2023-12-21_23-32-25

@johmsalas
Copy link
Owner Author

@tonmoy998 would you mind sharing the solution?

@tonmoy998
Copy link

tonmoy998 commented Dec 21, 2023

@johmsalas Nothing special.I made kitty background to an image.And made neovim transparent with this https://github.com/xiyaowong/transparent.nvim.

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

2 participants