Compare commits

...

3 Commits

Author SHA1 Message Date
70e991e51c
ajout correspondance utf8 2025-05-29 20:22:58 +02:00
Clément Joly
4eda76f40c doc: add installation instructions
This was requested in #5
2024-04-16 13:57:39 +02:00
Clément Joly
40226016a3
doc: update Readme.md 2024-03-11 11:37:37 +00:00
3 changed files with 50 additions and 22 deletions

View File

@ -13,9 +13,6 @@ tags:
- Bepo
- Lisp
- Fennel
#images:
#- /telescope-repo-nvim/opengraph.png
#- /telescope-repo-nvim/opengraph.webp
---
{{< github_badge >}}
@ -27,7 +24,7 @@ end_insert -->
# ⌨️ bepo.nvim
<!-- end_remove -->
![Neovim version](https://img.shields.io/badge/Neovim-0.5-57A143?style=flat&logo=neovim) [![](https://img.shields.io/badge/powered%20by-riss-lightgrey)](https://cj.rs/riss) ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/cljoly/bepo.nvim?color=darkgreen&sort=semver)
![Neovim version](https://img.shields.io/badge/Neovim-0.5-57A143?style=flat&logo=neovim) [![](https://img.shields.io/badge/powered%20by-riss-lightgrey)](https://cj.rs/riss) ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/cljoly/bepo.nvim?color=darkgreen&sort=semver) ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fd.cj.rs%2Fnvim%2Fbepo.json&cacheSeconds=90000)
<!-- insert
{{< rawhtml >}}
@ -39,13 +36,32 @@ Mappings for the [bepo][] layout in Lua, inspired by [vim-bepo][vb]
It aims to be faster (takes only 0.4ms at startup on my machine, while [vim-bepo][vb] requires 1.6ms) and more customizable (see `:help bepo.nvim-cherry-pick`)
## Example Use
## Installation
You should call the extension early in your config, so that you can erase mappings later (or with later extensions) more easily.
Add the plugin `cljoly/bepo.nvim` to your package manager.
If you dont have a package manager yet, I use [paq.nvim][paq].
You can give it a try :).
Look at the [installation instructions][paq_install] and then add the following to your config:
```lua
require "paq" {
"cljoly/bepo.nvim",
-- ... other packages
}
```
Then restart neovim and run `PaqInstall`. That will install the bepo.nvim plugin.
## Usage
Once the plugin is installed, you can add a call to set up the bepo mappings to your config:
``` lua
require("bepo").setup()
```
You should call the extension early in your `init.lua`, so that you can erase mappings later (or with other extensions) more easily.
## Advanced Usage
You can also apply only some mapping groups:
``` lua
@ -57,10 +73,6 @@ require("bepo").window()
See [the help file][help] for more details and the mappings installed.
[vb]: https://github.com/michamos/vim-bepo
[help]: https://github.com/cljoly/bepo.nvim/blob/main/doc/bepo-nvim.txt
[bepo]: https://bepo.fr/
## Reporting bugs
Thanks for considering reporting a bug!
@ -76,3 +88,9 @@ nvim --clean -u test/mock_setup.lua
```
If you cant reproduce the bug in that “clean” nvim instance, it suggests that the bug comes from an interaction of the plugin with your user configuration. Please feel free to open an issue, mentioning that.
[bepo]: https://bepo.fr/
[help]: https://github.com/cljoly/bepo.nvim/blob/main/doc/bepo-nvim.txt
[paq]: https://github.com/savq/paq-nvim
[paq_install]: https://github.com/savq/paq-nvim?tab=readme-ov-file#installation
[vb]: https://github.com/michamos/vim-bepo

10
doc/tags Normal file
View File

@ -0,0 +1,10 @@
!_TAG_FILE_ENCODING utf-8 //
bepo.nvim bepo-nvim.txt /*bepo.nvim*
bepo.nvim-always-free bepo-nvim.txt /*bepo.nvim-always-free*
bepo.nvim-cherry-pick bepo-nvim.txt /*bepo.nvim-cherry-pick*
bepo.nvim-easy_access bepo-nvim.txt /*bepo.nvim-easy_access*
bepo.nvim-movement bepo-nvim.txt /*bepo.nvim-movement*
bepo.nvim-setup bepo-nvim.txt /*bepo.nvim-setup*
bepo.nvim-tabs bepo-nvim.txt /*bepo.nvim-tabs*
bepo.nvim-usage bepo-nvim.txt /*bepo.nvim-usage*
bepo.nvim-window bepo-nvim.txt /*bepo.nvim-window*

24
lua/bepo.lua generated
View File

@ -41,24 +41,24 @@ local function mapping_movement()
end
local function mapping_tabs()
map_normal("gb", "gT")
map_normal("g\195\169", "gt")
map_normal("g\195\169", "gt") -- \195\169 = gé
map_normal("gB", ":execute \"silent! tabfirst\"<CR>")
map_normal("g\195\137", ":execute \"silent! tablast\"<CR>")
map_normal("g\195\137", ":execute \"silent! tablast\"<CR>") -- \195\137 = gÉ
return map_normal("gT", "<C-]>")
end
local function mapping_easy_access()
map_normal("\194\171", "<")
map_visual("\194\171", "<gv")
map_normal("\194\187", ">")
map_visual("\194\187", ">gv")
map_normal("\194\171", "<") -- \194\171 = «
map_visual("\194\171", "<gv") -- \194\171 = «
map_normal("\194\187", ">") -- \194\187 = »
map_visual("\194\187", ">gv") -- \194\187 = »
map_all("g,", "g;")
map_all("g;", "g,")
map_all("\195\169", "w")
map_all("\195\137", "W")
map_text_object("a\195\169", "aw")
map_text_object("a\195\137", "aW")
map_text_object("i\195\169", "iw")
return map_text_object("i\195\137", "iW")
map_all("\195\169", "w") -- \195\169 = é
map_all("\195\137", "W") -- \195\137 = É
map_text_object("a\195\169", "aw") -- \195\169 = é
map_text_object("a\195\137", "aW") -- \195\137 = É
map_text_object("i\195\169", "iw") -- \195\169 = é
return map_text_object("i\195\137", "iW") -- \195\137 = É
end
local function mapping_window()
map_normal("w", "<C-w>")