Skip to content

Handy nvim plugin that makes your work with delimiters faster.

Notifications You must be signed in to change notification settings

MyGitHubBlueberry/wise-delimiters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

Wise delimiters

Description

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

Installation

Don't forget to reopen your nvim :)

Packer

use 'MyGitHubBlueberry/wise-delimiters'

Lazy

{
    'MyGitHubBlueberry/wise-delimiters'
}

Plug

Plug  'MyGitHubBlueberry/wise-delimiters'

Setup

require("wise-delimiters").setup()

Use

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:

List

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

Add

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

Remove

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
Demonstration
DelimitersRemove.demonstration.mp4

About

Handy nvim plugin that makes your work with delimiters faster.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages