Skip to content

feat(keymap): added <Plug> mappings #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ Give your right-pinky a workout and install `cursor-text-objects.nvim` today!
```lua
{
"ColinKennedy/cursor-text-objects.nvim",
config = function()
local down_description = "Operate from your current cursor to the end of some text-object."
local up_description = "Operate from the start of some text-object to your current cursor."

vim.keymap.set("o", "[", "<Plug>(cursor-text-objects-up)", { desc = up_description })
vim.keymap.set("o", "]", "<Plug>(cursor-text-objects-down)", { desc = down_description })
vim.keymap.set("x", "[", "<Plug>(cursor-text-objects-up)", { desc = up_description })
vim.keymap.set("x", "]", "<Plug>(cursor-text-objects-down)", { desc = down_description })
end,
version = "v1.*",
}
```
Expand Down Expand Up @@ -116,7 +125,8 @@ https://github.com/ColinKennedy/cursor-text-objects.nvim/commits/main/doc/news.t


# Other Plugins
This template is full of various features. But if your plugin is only meant to
be a simple plugin and you don't want the bells and whistles that this template
provides, consider instead using
[nvim-cursor-text-object](https://github.com/ellisonleao/nvim-plugin-template)
This plugin is a sort-of successor to [vim-ninja-feet](https://github.com/tommcdo/vim-ninja-feet) with some notable differences

- visual mode support
- better edge-case handling
- (IMO) better documenting what the code does / how it works
3 changes: 1 addition & 2 deletions doc/news.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Notable changes since CursorTextObjects 1.0
===============================================================================
NEW FEATURES *cursor-text-objects-new-features*

- Added llscheck.yml - A GitHub workflow that detects type annotation issues!
- Added urlchecker.yml - A GitHub workflow that finds broken URLs!
- Added default `<Plug>` mappings


===============================================================================
Expand Down
8 changes: 4 additions & 4 deletions plugin/cursor_text_objects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local function _map(keys, mode, direction)
end, { expr = true, silent = true })
end

_map("[", "o", "up")
_map("]", "o", "down")
_map("[", "x", "up")
_map("]", "x", "down")
_map("<Plug>(cursor-text-objects-up)", "o", "up")
_map("<Plug>(cursor-text-objects-down)", "o", "down")
_map("<Plug>(cursor-text-objects-up)", "x", "up")
_map("<Plug>(cursor-text-objects-down)", "x", "down")
Loading
Loading