{"id":13412775,"url":"https://github.com/Weissle/easy-action","last_synced_at":"2025-03-14T18:32:12.707Z","repository":{"id":110914252,"uuid":"559121317","full_name":"Weissle/easy-action","owner":"Weissle","description":"A Neovim plugin allows you to perform an action on where you can see.","archived":false,"fork":false,"pushed_at":"2024-06-18T16:35:36.000Z","size":29,"stargazers_count":39,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-31T20:51:26.297Z","etag":null,"topics":["neovim","neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Weissle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-10-29T05:50:00.000Z","updated_at":"2024-07-12T06:35:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"643a4b6b-967c-482d-b03a-5f750e0c5778","html_url":"https://github.com/Weissle/easy-action","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"ellisonleao/nvim-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weissle%2Feasy-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weissle%2Feasy-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weissle%2Feasy-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weissle%2Feasy-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Weissle","download_url":"https://codeload.github.com/Weissle/easy-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221495311,"owners_count":16832457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","neovim-plugin"],"created_at":"2024-07-30T20:01:29.058Z","updated_at":"2024-10-26T04:31:09.742Z","avatar_url":"https://github.com/Weissle.png","language":"Lua","funding_links":[],"categories":["Motion"],"sub_categories":["GitHub"],"readme":"# easy-action\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Weissle/easy-action/default?style=for-the-badge)\n![Lua](https://img.shields.io/badge/Made%20with%20Lua-blueviolet.svg?style=for-the-badge\u0026logo=lua)\n\neasy-action is a plugin which allows you to execute an action, such as yank and delete, but keeps your cursor position.\n\nIt bases on [EasyMotion](https://github.com/easymotion/vim-easymotion)-like plugins.\nWhen use EasyMotion-like plugin, you need to trigger them and choose the position you jump.\nFor easy-action, you need to trigger easy-action, input your action, choose where to perform the action.\n\nIn the below example, my cursor is on the left window and I will copy and delete the text on the right window which is around 45 line. In this example, I use `\u003cspace\u003ee` to trigger easy-action.\n\n\nhttps://user-images.githubusercontent.com/29982556/198888179-22180ad5-6248-45ef-b494-7051b672dd80.mp4\n\n\n## Background\nWith the easy-motion like plugin, we can easily jump to anywhere visible.\nHowever, it is not so easy to execute an action on where is visible.\nThink about how many keys we need to press if we want to yank or delete something which is not under our cursor.\n\n## Status\nThe whole plugin's status is alpha. \nYour feedbacks are very important to the easy-action's improvement.  \nI use hop.nvim, supporting other relative plugins maybe slow.Thus, PR is welcome.\n\n**Currently supported Plugins**:\n- [X] [hop.nvim](https://github.com/phaazon/hop.nvim)  \n- [X] [leap.nvim](https://github.com/ggandor/leap.nvim)  \n- [ ] [mini.nvim](https://github.com/echasnovski/mini.nvim)\n\n## Install\n\nWith packer.nvim\n```lua\nuse {\n  'Weissle/easy-action',\n  requires = {\n    {\n      \"kevinhwang91/promise-async\",\n      module = { \"async\" },\n    }\n  }\n}\n```\n\n## Config\n\n```lua\n-- Below setting is default and you don't need to copy it. You may just require(\"easy-action\").setup({})\nrequire(\"easy-action\").setup({\n  -- These chars can show up any times in your action input.\n  free_chars = \"0123456789\",\n  -- These chars can show up no more than twice in action input.\n  limited_chars = \"iafFtT\",\n  -- Cancel action.\n  terminate_char = \"\u003cESC\u003e\",\n  -- all action contains `key` will be replaced by `value`. For example yib -\u003e yi(\n  remap = {\n    ib = \"i(\",\n    ab = \"a(\",\n  },\n  -- Default jump provider\n  jump_provider = \"hop\",\n  jump_provider_config = {\n    hop = {\n      action_select = {\n        char1 = {\n          -- action ends with any char of options will use HopChar1MW command.\n          options = \"(){}[]\u003c\u003e`'\\\"\",\n          cmd = \"HopChar1MW\",\n          feed = function(action)\n            return string.sub(action, #action)\n          end,\n        },\n        line = {\n          -- action ends with any char of options will use HopLineMW command.\n          options = \"yd\",\n          cmd = \"HopLineMW\",\n        },\n        -- Default command.\n        default = \"HopChar2MW\",\n      },\n    },\n    leap = {\n      action_select = {\n        default = function()\n          require(\"leap\").leap({ target_windows = require(\"leap.util\").get_enterable_windows() })\n        end,\n      },\n    },\n  },\n  -- Just make sure they are greater than 0. Usually 1 is all right.\n  jump_back_delay_ms = 1,\n  feed_delay_ms = 1,\n})\n```\n\n**Use other jump plugins**  \n```lua\nrequire(\"easy-action\").setup({\n  jump_provider = \"other_jump_plugin_name\",\n  jump_provider_config = {\n    other_jump_plugin_name = function(action)\n      -- Your will get the action which is going to be executed. And you can choose your jump command. \n      -- It can be string, then easy-action will do vim.cmd(ret).\n      -- It can be function, then easy-action will call ret().\n      -- It can be table, {cmd = string|function, feed = string}, then easy-action will execute this cmd and feed the `feed`.\n    end\n  }\n})\n```\n\n## Usage\neasy-action doesn't change your keymap by default. You may\n```lua\nlocal opts = { silent=true, remap=false }\n-- trigger easy-action.\nvim.keymap.set(\"n\",\"\u003cleader\u003ee\", \"\u003ccmd\u003eBasicEasyAction\u003ccr\u003e\", opts)\n\n-- To insert something and jump back after you leave the insert mode\nvim.keymap.set(\"n\",\"\u003cleader\u003eei\", function()\n  require(\"easy-action\").base_easy_action(\"i\", nil, \"InsertLeave\")\nend, opts)\n\n-- run :h base_easy_action() to see more details about the base_easy_action.\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWeissle%2Feasy-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWeissle%2Feasy-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWeissle%2Feasy-action/lists"}