Comments (3)
As a simple and ad-hoc solution, you can avoid moving the cursor by the following mapping:
nmap <expr> <C-a> 'm`' .. v:count1 .. '<Plug>(dial-increment)``'
nmap <expr> <C-x> 'm`' .. v:count1 .. '<Plug>(dial-decrement)``'
from dial.nvim.
The above settings should solve the problem. Closed.
from dial.nvim.
Here's a version which doesn't use a mark (I remap "m").
local dial_inc_keep_cursor_pos = function()
local pos = vim.api.nvim_win_get_cursor(0)
local cmd = require('dial.map').inc_normal()
local keys = vim.api.nvim_replace_termcodes(cmd, true, true, true)
vim.api.nvim_feedkeys(keys, 'm', false)
vim.schedule(function()
vim.api.nvim_win_set_cursor(0, pos)
end)
end
Killer plugin, thanks.
from dial.nvim.
Related Issues (20)
- `PascalCase` matches one word HOT 4
- Can't seem to get dial.nvim to function? HOT 5
- How to create switch between ES6-style arrow and normal functions? HOT 2
- enhancement: add treesitter queries support for augend.user HOT 3
- Enhancement: Add case-insensitive cycling HOT 2
- Enhancement: Extending dial with support for conversions HOT 1
- New date augend: day/month, i.e. %d/%m
- [Feature Request] Option to only inc/dec when augend is under cursor HOT 7
- Couple of issues HOT 5
- Question on aligning (string formatting) date augend HOT 2
- Attempt to call method 'find' error HOT 2
- Visual block mode increment HOT 3
- Sumneko warning HOT 3
- Date decreasing issue HOT 5
- Workflow proposal HOT 14
- Provide a lua API instead of a string command HOT 1
- Feature request: Support for sequences HOT 2
- lazy.nvim: Failed to run config for dial.nvim: module 'dial' not found HOT 2
- Date pattern like %-m don't work. HOT 15
- Increment/decrement on fooBar1 while cursor is over the 1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dial.nvim.