From 3587b4b3adaf534be8591cda933bf6d8a210b2a7 Mon Sep 17 00:00:00 2001 From: monaqa Date: Sat, 30 Aug 2025 16:14:52 +0900 Subject: [PATCH 1/5] refactor: rewrite plugin/dial.vim into dial.lua --- plugin/{dial.vim => dial.lua} | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) rename plugin/{dial.vim => dial.lua} (57%) diff --git a/plugin/dial.vim b/plugin/dial.lua similarity index 57% rename from plugin/dial.vim rename to plugin/dial.lua index 7cfed5a..c1c80e8 100644 --- a/plugin/dial.vim +++ b/plugin/dial.lua @@ -1,9 +1,10 @@ -if exists('g:loaded_dial') | finish | endif " prevent loading file twice +if vim.fn.exists "g:loaded_dial" then + return +end -let s:save_cpo = &cpo " save user coptions -set cpo&vim " reset them to defaults +local cpo = vim.o.cpoptions +vim.cmd [[set cpo&vim]] -lua << EOF vim.keymap.set("n", "(dial-increment)", require("dial.map").inc_normal()) vim.keymap.set("n", "(dial-decrement)", require("dial.map").dec_normal()) vim.keymap.set("n", "g(dial-increment)", require("dial.map").inc_gnormal()) @@ -12,12 +13,6 @@ vim.keymap.set("v", "(dial-increment)", require("dial.map").inc_visual() . vim.keymap.set("v", "(dial-decrement)", require("dial.map").dec_visual() .. "gv") vim.keymap.set("v", "g(dial-increment)", require("dial.map").inc_gvisual() .. "gv") vim.keymap.set("v", "g(dial-decrement)", require("dial.map").dec_gvisual() .. "gv") -EOF -command! -range -nargs=? DialIncrement lua require"dial.command".command("increment", {from = , to = }, {}) -command! -range -nargs=? DialDecrement lua require"dial.command".command("decrement", {from = , to = }, {}) - -let &cpo = s:save_cpo " and restore after -unlet s:save_cpo - -let g:loaded_dial = 1 +vim.o.cpoptions = cpo +vim.g.loaded_dial = 1 From 21f1b0df166657c239f97e282387e1567218b28c Mon Sep 17 00:00:00 2001 From: monaqa Date: Sat, 30 Aug 2025 16:16:39 +0900 Subject: [PATCH 2/5] fix!: remove g-prefixed mapping and rename Plug mapping Fixes #113. This mapping matters in SELECT mode. --- plugin/dial.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/dial.lua b/plugin/dial.lua index c1c80e8..8428c98 100644 --- a/plugin/dial.lua +++ b/plugin/dial.lua @@ -7,12 +7,12 @@ vim.cmd [[set cpo&vim]] vim.keymap.set("n", "(dial-increment)", require("dial.map").inc_normal()) vim.keymap.set("n", "(dial-decrement)", require("dial.map").dec_normal()) -vim.keymap.set("n", "g(dial-increment)", require("dial.map").inc_gnormal()) -vim.keymap.set("n", "g(dial-decrement)", require("dial.map").dec_gnormal()) +vim.keymap.set("n", "(dial-g-increment)", require("dial.map").inc_gnormal()) +vim.keymap.set("n", "(dial-g-decrement)", require("dial.map").dec_gnormal()) vim.keymap.set("v", "(dial-increment)", require("dial.map").inc_visual() .. "gv") vim.keymap.set("v", "(dial-decrement)", require("dial.map").dec_visual() .. "gv") -vim.keymap.set("v", "g(dial-increment)", require("dial.map").inc_gvisual() .. "gv") -vim.keymap.set("v", "g(dial-decrement)", require("dial.map").dec_gvisual() .. "gv") +vim.keymap.set("v", "(dial-g-increment)", require("dial.map").inc_gvisual() .. "gv") +vim.keymap.set("v", "(dial-g-decrement)", require("dial.map").dec_gvisual() .. "gv") vim.o.cpoptions = cpo vim.g.loaded_dial = 1 From 27227f9709ed4f8c573a2768f4053c6a830ac1cb Mon Sep 17 00:00:00 2001 From: monaqa Date: Sat, 30 Aug 2025 16:24:56 +0900 Subject: [PATCH 3/5] docs: update docs related to mappings --- README.md | 18 ++++++++---------- README_ja.md | 2 -- doc/dial.jax | 30 +++++++++++++++--------------- doc/dial.txt | 38 +++++++++++++++++++------------------- 4 files changed, 42 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 5642f5d..164d5fe 100644 --- a/README.md +++ b/README.md @@ -48,18 +48,16 @@ This plugin does not provide or override any default key-mappings. To use this plugin, you need to assign the plugin key-mapping to the key you like, as shown below: ```vim -nmap (dial-increment) -nmap (dial-decrement) -nmap g g(dial-increment) -nmap g g(dial-decrement) -vmap (dial-increment) -vmap (dial-decrement) -vmap g g(dial-increment) -vmap g g(dial-decrement) +nnoremap (dial-increment) +nnoremap (dial-decrement) +nnoremap g (dial-g-increment) +nnoremap g (dial-g-decrement) +xnoremap (dial-increment) +xnoremap (dial-decrement) +xnoremap g (dial-g-increment) +xnoremap g (dial-g-decrement) ``` -Note: When you use "g(dial-increment)" or "g(dial-decrement)" on the right side, `remap` option must be enabled. - Or you can configure it with Lua as follows: ```lua diff --git a/README_ja.md b/README_ja.md index 9380923..1974374 100644 --- a/README_ja.md +++ b/README_ja.md @@ -61,8 +61,6 @@ vmap g g(dial-increment) vmap g g(dial-decrement) ``` -注意: `g(dial-increment)` や `g(dial-decrement)` を右辺で用いる場合は remap を有効にする必要があります。 - または Lua 上で以下のように設定することもできます。 ```lua diff --git a/doc/dial.jax b/doc/dial.jax index 5746187..5f94054 100644 --- a/doc/dial.jax +++ b/doc/dial.jax @@ -95,14 +95,14 @@ USAGE *dial-usage* |dial.nvim|自身はキーマップの設定および上書きを行わないため、プラグインを動作 させるために以下の設定を追加する必要があります。 > - nmap (dial-increment) - nmap (dial-decrement) - nmap g g(dial-increment) - nmap g g(dial-decrement) - vmap (dial-increment) - vmap (dial-decrement) - vmap g g(dial-increment) - vmap g g(dial-decrement) + nnoremap (dial-increment) + nnoremap (dial-decrement) + nnoremap g (dial-g-increment) + nnoremap g (dial-g-decrement) + xnoremap (dial-increment) + xnoremap (dial-decrement) + xnoremap g (dial-g-increment) + xnoremap g (dial-g-decrement) < もしくは Lua 上で以下のように設定することもできます。 @@ -1381,13 +1381,13 @@ ADDITIVE DOT REPEATING *dial-additive-dot-repeating* Vim の便利な機能の1つに、VISUAL モードにおける g があります (|v_g_CTRL-A| 参照)。これは加数を行ごとに1ずつ増やすことができる機能であり、 番号付きの箇条書きなどを生成する際に重宝します。もちろん |dial.nvim| でも同等 -の機能を備えています (|v_g(dial-increment)|)。この機能は便利ながら、増加 +の機能を備えています (|v_(dial-g-increment)|)。この機能は便利ながら、増加 対象が離れた場所にあると使いづらいという制限がありました。 これを解決するため、|dial.nvim| ではノーマルモードの g に相当する機能を提 供しています。これを有効にするには、以下の設定を書いておく必要があります: > - nmap g g(dial-increment) - nmap g g(dial-decrement) + nmap g (dial-g-increment) + nmap g (dial-g-decrement) < もしくは Lua 上で以下のように設定することもできます。 > @@ -1475,7 +1475,7 @@ MAPPING *dial-mapping* {VISUAL}["x](dial-decrement) *v_(dial-decrement)* VISUAL モードにおける CTRL-X に相当する機能を提供します。 -{VISUAL}["x]g(dial-increment) *v_g(dial-increment)* +{VISUAL}["x](dial-g-increment) *v_(dial-g-increment)* VISUAL モードにおける |v_g_CTRL-A| に相当する機能を提供します。 使用方法は|v_(dial-increment)| と似ているものの、上から数えてn行目に @@ -1497,14 +1497,14 @@ MAPPING *dial-mapping* < のように、1週間ごとの日付が得られます(日付の被加数が有効のときに限る)。 -{VISUAL}["x]g(dial-decrement) *v_g(dial-decrement)* +{VISUAL}["x](dial-g-decrement) *v_(dial-g-decrement)* VISUAL モードにおける |v_g_CTRL-X| に相当する機能を提供します。 -["x]g(dial-increment) *g(dial-increment)* +["x](dial-g-increment) *(dial-g-increment)* 基本的に |(dial-increment)| と同じですが、ドットリピートを実行したと きの挙動が異なります。 |dial-additive-dot-repeating| 参照。 -["x]g(dial-decrement) *g(dial-decrement)* +["x](dial-g-decrement) *(dial-g-decrement)* 基本的に |(dial-decrement)| と同じですが、ドットリピートを実行したと きの挙動が異なります。 |dial-additive-dot-repeating| 参照。 diff --git a/doc/dial.txt b/doc/dial.txt index 0aa2e32..c3f31e9 100644 --- a/doc/dial.txt +++ b/doc/dial.txt @@ -98,14 +98,14 @@ Since this plugin does not replace the default key-mapping, you need to add the following description to the configuration file after installing the plugin. > - nmap (dial-increment) - nmap (dial-decrement) - nmap g g(dial-increment) - nmap g g(dial-decrement) - vmap (dial-increment) - vmap (dial-decrement) - vmap g g(dial-increment) - vmap g g(dial-decrement) + nnoremap (dial-increment) + nnoremap (dial-decrement) + nnoremap g (dial-g-increment) + nnoremap g (dial-g-decrement) + xnoremap (dial-increment) + xnoremap (dial-decrement) + xnoremap g (dial-g-increment) + xnoremap g (dial-g-decrement) < Alternatively, you can configure with Lua as follows: @@ -122,16 +122,16 @@ Alternatively, you can configure with Lua as follows: vim.keymap.set("n", "g", function() require("dial.map").manipulate("decrement", "gnormal") end) - vim.keymap.set("v", "", function() + vim.keymap.set("x", "", function() require("dial.map").manipulate("increment", "visual") end) - vim.keymap.set("v", "", function() + vim.keymap.set("x", "", function() require("dial.map").manipulate("decrement", "visual") end) - vim.keymap.set("v", "g", function() + vim.keymap.set("x", "g", function() require("dial.map").manipulate("increment", "gvisual") end) - vim.keymap.set("v", "g", function() + vim.keymap.set("x", "g", function() require("dial.map").manipulate("decrement", "gvisual") end) < @@ -1434,14 +1434,14 @@ ADDITIVE DOT REPEATING *dial-additive-dot-repeating* One convenient feature of Vim is g in VISUAL mode (see |v_g_CTRL-A|). This allows you to increase the addend by one per line, which is useful for generating numbered list, etc. Of course, |dial.nvim| provides the same -functionality (|v_g(dial-increment)|). However, this feature had the +functionality (|v_(dial-g-increment)|). However, this feature had the limitation that it was difficult to use when the increase targets were located far away. To solve this, |dial.nvim| provides the equivalent of g in normal mode. To enable it, the following configuration must be written: . > - nmap g g(dial-increment) - nmap g g(dial-decrement) + nmap g (dial-g-increment) + nmap g (dial-g-decrement) Alternatively, you can configure with Lua as follows: > @@ -1533,7 +1533,7 @@ MAPPING *dial-mapping* {VISUAL}["x](dial-decrement) *v_(dial-decrement)* An alternative to the existing CTRL-X command in VISUAL mode. -{VISUAL}["x]g(dial-increment) *v_g(dial-increment)* +{VISUAL}["x](dial-g-increment) *v_(dial-g-increment)* An alternative to the existing |v_g_CTRL-A| command in VISUAL mode. Its usage is similar to |v_(dial-increment)|, but the number of addends on line n, counting from the top, is increased by n * [count]. It @@ -1555,14 +1555,14 @@ MAPPING *dial-mapping* 10/03 < -{VISUAL}["x]g(dial-decrement) *v_g(dial-decrement)* +{VISUAL}["x](dial-g-decrement) *v_(dial-g-decrement)* An alternative to the existing |v_g_CTRL-X| command in VISUAL mode. -["x]g(dial-increment) *g(dial-increment)* +["x](dial-g-increment) *(dial-g-increment)* Almost the same as |(dial-increment)|, but but the behavior differs during dot repeating. See |dial-additive-dot-repeating|. -["x]g(dial-decrement) *g(dial-decrement)* +["x](dial-g-decrement) *(dial-g-decrement)* Almost the same as |(dial-decrement)|, but but the behavior differs during dot repeating. See |dial-additive-dot-repeating|. From ec80eb5943fe3d249816f0cb84d2c07e9f1ee432 Mon Sep 17 00:00:00 2001 From: monaqa Date: Sat, 30 Aug 2025 16:35:38 +0900 Subject: [PATCH 4/5] docs!: drop supported version Neovim (< 0.11.0) --- README.md | 2 +- README_ja.md | 3 +-- doc/dial.jax | 2 +- doc/dial.txt | 3 +-- lua/dial/util.lua | 7 ++----- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 164d5fe..36304b5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Extended increment/decrement plugin for [Neovim](https://github.com/neovim/neovi ## Installation -`dial.nvim` requires Neovim `>=0.5.0` (`>=0.6.1` is recommended). +`dial.nvim` requires Neovim `>=0.11.0`. You can install `dial.nvim` by following the instructions of your favorite package manager. ## Usage diff --git a/README_ja.md b/README_ja.md index 1974374..1a9c67f 100644 --- a/README_ja.md +++ b/README_ja.md @@ -41,8 +41,7 @@ ## インストール -本プラグインには Neovim 0.5.0 以上が必要です(Neovim 0.6.1 以降を推奨)。 - +本プラグインには Neovim 0.11.0 以上が必要です。 好きなパッケージマネージャの指示に従うことでインストールできます。 ## 使用方法 diff --git a/doc/dial.jax b/doc/dial.jax index 5f94054..e195ddf 100644 --- a/doc/dial.jax +++ b/doc/dial.jax @@ -39,7 +39,7 @@ Interface |dial-interface| ============================================================================== REQUIREMENTS *dial-requirements* -* Neovim 0.6.1 or later(0.5.0 以降なら動くと考えられますが保証はしません) +* Neovim 0.11.0 or later ============================================================================== INTRODUCTION *dial-introduction* diff --git a/doc/dial.txt b/doc/dial.txt index c3f31e9..d69654a 100644 --- a/doc/dial.txt +++ b/doc/dial.txt @@ -40,8 +40,7 @@ Interface |dial-interface| ============================================================================== REQUIREMENTS *dial-requirements* -* Neovim 0.6.1 or later - (0.5.0 or later will probably work, but not guaranteed) +* Neovim 0.11.0 or later ============================================================================== INTRODUCTION *dial-introduction* diff --git a/lua/dial/util.lua b/lua/dial/util.lua index 0acd16d..33fa81c 100644 --- a/lua/dial/util.lua +++ b/lua/dial/util.lua @@ -1,9 +1,6 @@ -- utils local M = {} --- NOTE: Needed until compatibility with Neovim 0.9 is dropped -local islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist - ---@generic T ---@param cond boolean ---@param branch_true T @@ -41,7 +38,7 @@ end ---@param arg1 string | function ---@param arg2? string function M.validate_list(name, list, arg1, arg2) - if not islist(list) then + if not vim.islist(list) then error(("%s is not list."):format(name)) end @@ -163,7 +160,7 @@ end -- util.try_get_keys({foo = "bar", hoge = "fuga", teka = "pika"}, ["teka", "foo"]) -- -> ["pika", "bar"] function M.try_get_keys(tbl, keylst) - if not islist(keylst) then + if not vim.islist(keylst) then return nil, "the 2nd argument is not list." end From de4a41fcf9bfadc803c893ec90940c8a921dcffc Mon Sep 17 00:00:00 2001 From: monaqa Date: Sat, 30 Aug 2025 16:52:13 +0900 Subject: [PATCH 5/5] docs: update & fix README --- README.md | 49 ++++++++++++++++++--------------------- README_ja.md | 65 ++++++++++++++++++++++++---------------------------- 2 files changed, 52 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 36304b5..6954733 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,5 @@ # dial.nvim -**NOTICE: This plugin is work-in-progress yet. User interface is subject to change without notice.** - -## FOR USERS OF THE PREVIOUS VERSION (v0.2.0) - -This plugin was released v0.3.0 on 2022/02/20 and is no longer compatible with the old interface. -If you have configured the settings for previous versions, please refer to [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) and reconfigure them. - ## Abstract Extended increment/decrement plugin for [Neovim](https://github.com/neovim/neovim). Written in Lua. @@ -17,6 +10,7 @@ Extended increment/decrement plugin for [Neovim](https://github.com/neovim/neovi * Increment/decrement based on various type of rules * n-ary (`2 <= n <= 36`) integers + * decimal Fractions * date and time * constants (an ordered set of specific strings, such as a keyword or operator) * `true` ⇄ `false` @@ -73,16 +67,16 @@ end) vim.keymap.set("n", "g", function() require("dial.map").manipulate("decrement", "gnormal") end) -vim.keymap.set("v", "", function() +vim.keymap.set("x", "", function() require("dial.map").manipulate("increment", "visual") end) -vim.keymap.set("v", "", function() +vim.keymap.set("x", "", function() require("dial.map").manipulate("decrement", "visual") end) -vim.keymap.set("v", "g", function() +vim.keymap.set("x", "g", function() require("dial.map").manipulate("increment", "gvisual") end) -vim.keymap.set("v", "g", function() +vim.keymap.set("x", "g", function() require("dial.map").manipulate("decrement", "gvisual") end) ``` @@ -131,15 +125,14 @@ nmap a "=mygroup(dial-increment) Alternatively, you can set the same mapping without expression register: ```lua -vim.keymap.set("n", "a", require("dial.map").inc_normal("mygroup"), {noremap = true}) +vim.keymap.set("n", "a", require("dial.map").inc_normal("mygroup")) ``` When you don't specify any group name in the way described above, the addends in the `default` group is used instead. ### Example Configuration -```vim -lua << EOF +```lua local augend = require("dial.augend") require("dial.config").augends:register_group{ default = { @@ -147,12 +140,7 @@ require("dial.config").augends:register_group{ augend.integer.alias.hex, augend.date.alias["%Y/%m/%d"], }, - typescript = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.constant.new{ elements = {"let", "const"} }, - }, - visual = { + only_in_visual = { augend.integer.alias.decimal, augend.integer.alias.hex, augend.date.alias["%Y/%m/%d"], @@ -161,14 +149,21 @@ require("dial.config").augends:register_group{ }, } --- change augends in VISUAL mode -vim.keymap.set("v", "", require("dial.map").inc_visual("visual"), {noremap = true}) -vim.keymap.set("v", "", require("dial.map").dec_visual("visual"), {noremap = true}) -EOF +-- Use `only_in_visual` group only in VISUAL / +vim.keymap.set("x", "", function() + require("dial.map").manipulate("increment", "visual", "only_in_visual") +end) +vim.keymap.set("x", "", function() + require("dial.map").manipulate("decrement", "visual", "only_in_visual") +end) -" enable only for specific FileType -autocmd FileType typescript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").inc_normal("typescript"), {noremap = true}) -autocmd FileType typescript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").dec_normal("typescript"), {noremap = true}) +require("dial.config").augends:on_filetype { + typescript = { + augend.integer.alias.decimal, + augend.integer.alias.hex, + augend.constant.new{ elements = {"let", "const"} }, + }, +} ``` ## List of Augends diff --git a/README_ja.md b/README_ja.md index 1a9c67f..29174b8 100644 --- a/README_ja.md +++ b/README_ja.md @@ -1,12 +1,5 @@ # dial.nvim -**NOTICE: 本プラグインはまだ開発段階であり、事前告知なくインターフェースが変更となることがあります。** - -## 旧バージョン (v0.2.0) を使っていた人へ - -2022/02/20 に v0.3.0 がリリースされ、既存のインターフェースとの互換性がなくなりました。 -以前のバージョン向けの設定を行っていた方は、[TROUBLESHOOTING.md](./TROUBLESHOOTING_ja.md) を参考に再設定を行ってください。 - ## 概要 [Neovim](https://github.com/neovim/neovim) の数値増減機能を拡張する Lua 製プラグイン。 @@ -18,6 +11,7 @@ * 数値をはじめとする様々なものの増減 * n 進数 (`2 <= n <= 36`) の整数 + * 小数 * 日付・時刻 * キーワードや演算子など、所定文字列のトグル * `true` ⇄ `false` @@ -50,14 +44,14 @@ 本プラグインを有効にするには、いずれかのキーに以下のような割り当てを行う必要があります。 ```vim -nmap (dial-increment) -nmap (dial-decrement) -nmap g g(dial-increment) -nmap g g(dial-decrement) -vmap (dial-increment) -vmap (dial-decrement) -vmap g g(dial-increment) -vmap g g(dial-decrement) +nnoremap (dial-increment) +nnoremap (dial-decrement) +nnoremap g (dial-g-increment) +nnoremap g (dial-g-decrement) +xnoremap (dial-increment) +xnoremap (dial-decrement) +xnoremap g (dial-g-increment) +xnoremap g (dial-g-decrement) ``` または Lua 上で以下のように設定することもできます。 @@ -75,16 +69,16 @@ end) vim.keymap.set("n", "g", function() require("dial.map").manipulate("decrement", "gnormal") end) -vim.keymap.set("v", "", function() +vim.keymap.set("x", "", function() require("dial.map").manipulate("increment", "visual") end) -vim.keymap.set("v", "", function() +vim.keymap.set("x", "", function() require("dial.map").manipulate("decrement", "visual") end) -vim.keymap.set("v", "g", function() +vim.keymap.set("x", "g", function() require("dial.map").manipulate("increment", "gvisual") end) -vim.keymap.set("v", "g", function() +vim.keymap.set("x", "g", function() require("dial.map").manipulate("decrement", "gvisual") end) ``` @@ -132,15 +126,14 @@ nmap a "=mygroup(dial-increment) また、 Lua 上で以下のように記述すれば expression register を使わずにマッピングを設定できます。 ```lua -vim.keymap.set("n", "a", require("dial.map").inc_normal("mygroup"), {noremap = true}) +vim.keymap.set("n", "a", require("dial.map").inc_normal("mygroup")) ``` expression register などでグループ名を指定しなかった場合、`default` グループにある被加数がかわりに用いられます。 ### 設定例 -```vim -lua << EOF +```lua local augend = require("dial.augend") require("dial.config").augends:register_group{ default = { @@ -148,12 +141,7 @@ require("dial.config").augends:register_group{ augend.integer.alias.hex, augend.date.alias["%Y/%m/%d"], }, - typescript = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.constant.new{ elements = {"let", "const"} }, - }, - visual = { + only_in_visual = { augend.integer.alias.decimal, augend.integer.alias.hex, augend.date.alias["%Y/%m/%d"], @@ -162,14 +150,21 @@ require("dial.config").augends:register_group{ }, } --- VISUAL モードでの被加数を変更する -vim.keymap.set("v", "", require("dial.map").inc_visual("visual"), {noremap = true}) -vim.keymap.set("v", "", require("dial.map").dec_visual("visual"), {noremap = true}) -EOF +-- Use `only_in_visual` group only in VISUAL / +vim.keymap.set("x", "", function() + require("dial.map").manipulate("increment", "visual", "only_in_visual") +end) +vim.keymap.set("x", "", function() + require("dial.map").manipulate("decrement", "visual", "only_in_visual") +end) -" 特定のファイルタイプでのみ有効にする -autocmd FileType typescript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").inc_normal("typescript"), {noremap = true}) -autocmd FileType typescript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").dec_normal("typescript"), {noremap = true}) +require("dial.config").augends:on_filetype { + typescript = { + augend.integer.alias.decimal, + augend.integer.alias.hex, + augend.constant.new{ elements = {"let", "const"} }, + }, +} ``` ## 被加数の種類と一覧