diff --git a/README.md b/README.md index e99e2529..99d62025 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,6 @@ Following are the **default** config for the [`setup()`](#setup). If you want to basic = true, ---Extra mapping; `gco`, `gcO`, `gcA` extra = true, - ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` - extended = false, }, ---Function to call before (un)comment pre_hook = nil, @@ -159,30 +157,6 @@ These mappings are enabled by default. (config: `mappings.extra`) `gcA` - Insert comment to end of the current line and enters INSERT mode ``` - - -#### Extended mappings - -These mappings are disabled by default. (config: `mappings.extended`) - -- NORMAL mode - -```help -`g>[count]{motion}` - (Op-pending) Comments the region using linewise comment -`g>c` - Comments the current line using linewise comment -`g>b` - Comments the current line using blockwise comment -`g<[count]{motion}` - (Op-pending) Uncomments the region using linewise comment -`g` - Comments the region using single line -`g<` - Unomments the region using single line -``` - ##### Examples ```help diff --git a/lua/Comment/api.lua b/lua/Comment/api.lua index 2236c0af..446f1062 100644 --- a/lua/Comment/api.lua +++ b/lua/Comment/api.lua @@ -289,9 +289,12 @@ function api.setup(config) K('n', cfg.extra.eol, api.locked('insert.linewise.eol'), { desc = 'Comment insert end of line' }) end - -- Extended Mappings if cfg.mappings.extended then - -- NORMAL mode extended + vim.notify_once( + [=[[Comment] `extendend` mappings are deprecated and will be removed on 07 Nov 2022. Please refer to https://github.com/numToStr/Comment.nvim/wiki/Extended-Keybindings on how define them manually.]=], + vim.log.levels.WARN + ) + K('n', 'g>', api.call('comment.linewise', 'g@'), { expr = true, desc = 'Comment region linewise' }) K('n', 'g>c', api.call('comment.linewise.current', 'g@$'), { expr = true, desc = 'Comment current line' }) K('n', 'g>b', api.call('comment.blockwise.current', 'g@$'), { expr = true, desc = 'Comment current block' }) @@ -310,7 +313,6 @@ function api.setup(config) { expr = true, desc = 'Uncomment current block' } ) - -- VISUAL mode extended K( 'x', 'g>', diff --git a/lua/Comment/config.lua b/lua/Comment/config.lua index 2098a956..b15cc73a 100644 --- a/lua/Comment/config.lua +++ b/lua/Comment/config.lua @@ -26,7 +26,6 @@ --- mappings = { --- basic = true, --- extra = true, ---- extended = false, --- }, --- pre_hook = nil, --- post_hook = nil, @@ -72,10 +71,6 @@ ---Enable extra mapping; `gco`, `gcO` and `gcA` ---(default: 'true') ---@field extra boolean ----Enable extended mapping; `g>`, `g{motion}` and `g<{motion}` ----(default: 'false') ----@field extended boolean ---LHS of toggle mappings in NORMAL ---@class Toggler @@ -106,7 +101,6 @@ local Config = { mappings = { basic = true, extra = true, - extended = false, }, toggler = { line = 'gcc',