I find it really annoying and unfair that neovim treats quotes and braces like single characters. This plugin changes this completely. Wise delimiters plugin makes sure that you use your delimeters with full comfort. Here is what it provides:
- Closing of your quotes and braces now automated
- Exiting of delimiters using Tab in insert mode
- Deleting both matching delimiters with one backspace press (if you place you cursor right between them)
- Customization of your delimiters: add and remove whatever delimiters you like
- Comfortable nvim command functions, so you can make changes quickly
This idea is not new, you might be familiar with such concept from other code editrors (we don't talk about them). If you didn't get it or you just want to see how it works, watch the demo below:
Demonstration
With.plugin.mp4
Without.plugin.mp4
Don't forget to reopen your nvim :)
use 'MyGitHubBlueberry/wise-delimiters'
{
'MyGitHubBlueberry/wise-delimiters'
}
Plug 'MyGitHubBlueberry/wise-delimiters'
require("wise-delimiters").setup()
After you called setup function, everything is already done for you, but if you want to customize which delimiters you are using, or remind yourself which you already have, you can use following nvim commands in nvim's command mode:
This commands reminds you which delimiters you are using. Just execute following line and you will see them under your lua line.
:DelimitersList
If you didn't change anything yet, after this command execution you will see this:
Here are your delimiters: {-} "-" '-' <-> [-] (-)
Delimiters showing up one by one, connected to ther pairs by hyphens.
Demonstration
DelimitersList.demonstration.mp4
This command accepts two arguments: opening and closing delimeters. It allows you to add any delimiter pare, you desire. Exept of those, you already have.
:DelimitersAdd <opening_delimiter> <closing_delimiter>
For some reason you want to add a and b as your delimiters. You can do this by executing following:
:DelimitersAdd a b
Now a and b added to your delimiter list as opening and closing delimiters respectively.
Demonstration
DelimitersAdd.demonstration.mp4
This function accepts one argument - opening delimiter. It removes delimiter pare tided-up to it.
:DelimitersRemove <opening_delimiter>
Lest assume you added those a and b from previous example section. We can remove them now with following command:
:DelimitersRemove a