Skip to content

Commit e2537f9

Browse files
committed
docs: update documentation
1 parent a1bdd5c commit e2537f9

File tree

4 files changed

+32
-34
lines changed

4 files changed

+32
-34
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ add more mappings by providing keys to the config.
2222

2323
## Requirements
2424

25-
At the moment it works on the development release of Neovim, and will be
26-
officially supporting [Neovim 0.7.0](https://github.com/neovim/neovim/releases/tag/v0.7.0).
25+
This plugin supports [Neovim 0.7.0](https://github.com/neovim/neovim/releases/tag/v0.7.0).
2726

2827
This plugin depends are the following libraries. Please make sure to add them
2928
as dependencies in your package manager:
@@ -38,7 +37,7 @@ Use your favourite package manager to install this library. Packer example:
3837
```lua
3938
use({
4039
"arsham/archer.nvim",
41-
requires = { "arsham/arshlib.nvim", "tpope/vim-repeat", "norvalli/nvim.lua" },
40+
requires = { "arsham/arshlib.nvim", "norvalli/nvim.lua" },
4241
config = function() require("archer").config({}) end,
4342
})
4443
```

lua/archer/health.lua

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
local M = {}
22
local health = require("health")
33

4-
M.check = function()
5-
health.report_start("Listish Health Check")
6-
if not pcall(require, "arshlib") then
7-
health.report_error("arshlib.nvim was not found", {
8-
'Please install "arsham/arshlib.nvim"',
9-
})
10-
else
11-
health.report_ok("arshlib.nvim is installed")
12-
end
4+
local libs = {
5+
arshlib = "arsham/arshlib.nvim",
6+
nvim = "norcalli/nvim.lua",
7+
}
138

14-
if not pcall(require, "nvim") then
15-
health.report_error("nvim.lua was not found", {
16-
'Please install "norcalli/nvim.lua"',
17-
})
18-
else
19-
health.report_ok("nvim.lua is installed")
9+
M.check = function()
10+
health.report_start("Archer Health Check")
11+
for name, package in pairs(libs) do
12+
if not pcall(require, name) then
13+
health.report_error(package .. " was not found", {
14+
'Please install "' .. package .. '"',
15+
})
16+
else
17+
health.report_ok(package .. " is installed")
18+
end
2019
end
2120
end
2221

lua/archer/mappings.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ local function setup_space_mappings(opts) --{{{
8686
vim.keymap.set("n", opts.above, function()
8787
vim.opt.opfunc = "v:lua.empty_line_above"
8888
return "g@l"
89-
end, { noremap = true, silent = true, expr = true, desc = desc })
89+
end, { silent = true, expr = true, desc = desc })
9090
end --}}}
9191

9292
if opts.below then --{{{
9393
local desc = "insert [count]empty line(s) below current line"
9494
vim.keymap.set("n", opts.below, function()
9595
vim.opt.opfunc = "v:lua.empty_line_below"
9696
return "g@l"
97-
end, { noremap = true, silent = true, expr = true, desc = desc })
97+
end, { silent = true, expr = true, desc = desc })
9898
end --}}}
9999
end --}}}
100100

@@ -116,13 +116,13 @@ local function setup_ending(opts) --{{{
116116
-- Adding {{{
117117
local key1 = string.format("<%s-%s>", opts.modifier, tuple.add)
118118
local desc = string.format("Add %s at the end of line", n)
119-
local opt = { noremap = true, desc = desc }
119+
local opt = { desc = desc }
120120

121121
vim.keymap.set("n", key1, function()
122122
last_key = tuple.add
123123
vim.opt.opfunc = "v:lua.add_to_line_end"
124124
return "g@l"
125-
end, { noremap = true, expr = true, desc = desc })
125+
end, { expr = true, desc = desc })
126126

127127
vim.keymap.set("i", key1, function()
128128
change_line_ends(tuple.add, false)
@@ -141,7 +141,7 @@ local function setup_ending(opts) --{{{
141141
last_key = tuple.add
142142
vim.opt.opfunc = "v:lua.remove_from_line_end"
143143
return "g@l"
144-
end, { noremap = true, expr = true, desc = desc })
144+
end, { expr = true, desc = desc })
145145

146146
vim.keymap.set("i", key2, function()
147147
change_line_ends(tuple.add, true)
@@ -164,11 +164,11 @@ local function augment_vim(opts)
164164
if opts.jumplist and opts.jumplist > 1 then
165165
vim.keymap.set("n", "k",
166166
string.format([[(v:count > %s ? "m'" . v:count : '') . 'k']], opts.jumplist),
167-
{ noremap = true, expr = true, desc = "numbered motions in the jumplist" }
167+
{ expr = true, desc = "numbered motions in the jumplist" }
168168
)
169169
vim.keymap.set("n", "j",
170170
string.format([[(v:count > %s ? "m'" . v:count : '') . 'j']], opts.jumplist),
171-
{ noremap = true, expr = true, desc = "numbered motions in the jumplist" }
171+
{ expr = true, desc = "numbered motions in the jumplist" }
172172
)
173173
end
174174
-- stylua: ignore end
@@ -191,7 +191,7 @@ local function config(opts) --{{{
191191
end
192192

193193
if opts.brackets then --{{{
194-
local opt = { noremap = true, desc = "Insert a pair of brackets and go into insert mode" }
194+
local opt = { desc = "Insert a pair of brackets and go into insert mode" }
195195
vim.keymap.set("i", opts.brackets, "<Esc>A {<CR>}<Esc>O", opt)
196196
vim.keymap.set("n", opts.brackets, "A {<CR>}<Esc>O", opt)
197197
end --}}}

lua/archer/textobj.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ local function config(opts)
4646
if opts.next_obj.a_next then
4747
local key = opts.next_obj.a_next
4848
local motion = key:sub(1, 1)
49-
local opt = { noremap = true, desc = "around next pairs" }
49+
local opt = { desc = "around next pairs" }
5050
vim.keymap.set("x", key, function() next_obj(motion) end, opt)
5151
vim.keymap.set("o", key, function() next_obj(motion) end, opt)
5252
end
5353

5454
if opts.next_obj.i_next then
5555
local key = opts.next_obj.i_next
5656
local motion = key:sub(1, 1)
57-
local opt = { noremap = true, desc = "in next pairs" }
57+
local opt = { desc = "in next pairs" }
5858
vim.keymap.set("x", key, function() next_obj(motion) end, opt)
5959
vim.keymap.set("o", key, function() next_obj(motion) end, opt)
6060
end
@@ -67,11 +67,11 @@ local function config(opts)
6767
table.insert(chars, ch)
6868
end
6969
for _, ch in ipairs(chars) do
70-
local opt = { noremap = true, desc = "in pairs of " .. ch }
70+
local opt = { desc = "in pairs of " .. ch }
7171
vim.keymap.set("x", "i" .. ch, function() quick.normal("xt", "T" .. ch .. "ot" .. ch) end, opt)
7272
vim.keymap.set("o", "i" .. ch, function() quick.normal("x", "vi" .. ch) end, opt)
7373

74-
opt = { noremap = true, desc = "around pairs of " .. ch }
74+
opt = { desc = "around pairs of " .. ch }
7575
vim.keymap.set("x", "a" .. ch, function() quick.normal("xt", "F" .. ch .. "of" .. ch) end, opt)
7676
vim.keymap.set("o", "a" .. ch, function() quick.normal("x", "va" .. ch) end, opt)
7777
end
@@ -80,13 +80,13 @@ local function config(opts)
8080
-- Line support {{{
8181
if opts.line then
8282
if opts.line.i_line then
83-
local opt = { noremap = true, desc = "in current line" }
83+
local opt = { desc = "in current line" }
8484
vim.keymap.set("x", "il", function() quick.normal("xt", "g_o^") end, opt)
8585
vim.keymap.set("o", "il", function() quick.normal("x", "vil") end, opt)
8686
end
8787

8888
if opts.line.a_line then
89-
local opt = { noremap = true, desc = "around current line" }
89+
local opt = { desc = "around current line" }
9090
vim.keymap.set("x", "al", function() quick.normal("xt", "$o0") end, opt)
9191
vim.keymap.set("o", "al", function() quick.normal("x", "val") end, opt)
9292
end
@@ -96,11 +96,11 @@ local function config(opts)
9696
if opts.backtick then
9797
local b = opts.backtick
9898

99-
local opt = { noremap = true, silent = true, desc = "in backticks" }
99+
local opt = { silent = true, desc = "in backticks" }
100100
vim.keymap.set("v", "i" .. b, function() in_backticks(false) end, opt)
101101
vim.keymap.set("o", "i" .. b, function() quick.normal("x", "vi" .. b) end, opt)
102102

103-
opt = { noremap = true, silent = true, desc = "around backticks" }
103+
opt = { silent = true, desc = "around backticks" }
104104
vim.keymap.set("v", "a" .. b, function() in_backticks(true) end, opt)
105105
vim.keymap.set("o", "a" .. b, function() quick.normal("x", "va" .. b) end, opt)
106106
end --}}}

0 commit comments

Comments
 (0)