Skip to content

Commit

Permalink
Merge pull request NixOS#3 from nagy135/feat/specify_custom_pairs
Browse files Browse the repository at this point in the history
Feat/specify custom pairs
  • Loading branch information
nat-418 authored Oct 13, 2022
2 parents 62c398b + 201b0fe commit 25e3b11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ require('boole').setup({
mappings = {
increment = '<C-a>',
decrement = '<C-x>'
}
},
-- Key value pairs of additional replacements
-- increment: (key => value)
-- decrement: (value => key)
pair_additions = {
["False"] = "True",
["True"] = "False"
},
})
```
6 changes: 6 additions & 0 deletions lua/boole.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ M.setup = function(options)

if options == nil then return 1 end

if options.pair_additions ~= nil then
for key,val in pairs(options.pair_additions) do
generate_hashmaps(key, val)
end
end

if options.mappings.increment ~= nil then
vim.keymap.set(
{ 'n', 'v' },
Expand Down

0 comments on commit 25e3b11

Please sign in to comment.