Comments (8)
Hey, yes you are right about that. I added this to the config:
mappings = {
org = {
org_increase_date = '+',
org_decrease_date = '+'
}
and after removing that mapping it works as expected. Really nice, thank you very much! I guess this can be closed then.
from orgmode.
If you think it's worth fixing, I could actually try to fix it myself. I don't have much experience with lua, but this doesn't seem to be too hard to fix.
from orgmode.
Idea is to have / increment/decrement date by one day when used within date context. Anything outside of it fallback to the default behavior.
As you said, Vim automatically finds first number and increases it. I don't think there's a way to prevent it from doing that.
Workaround is to bind date increment/decrement to another mapping, for example +/-:
require('orgmode').setup({
mappings = {
org = {
org_increase_date = '+',
org_decrease_date = '+'
}
}
})
That way / will work by default everywhere.
from orgmode.
Workaround is to bind date increment/decrement to another mapping, for example +/-:
I tried what you suggested, but it seemed to give the same behaviour as <C-a>
/ <C-x>
, probably because the fallback is sent to nvim here: https://github.com/kristijanhusak/orgmode.nvim/blob/master/lua/orgmode/org/mappings.lua#L118
So I guess what I'm asking for is that <C-a>
will first move to the date context (similar to how <C-a>
is moving to the closest number) and then increase the date by one. Alternatively, it does not do anything if it's not on a date context. I think the current behaviour is not so intuitive, even though it makes sense by how vim's <C-a>
and org-mode's <C-a>
work
from orgmode.
Oh, right, I need to fix that fallback to fallback to the defined mapping.
We could handle it by jumping to next number manually and then re-checking if it's date or not. Thanks for suggestion, I'll try to fix it.
from orgmode.
@kvalv I pushed a fix for this.
- Different mappings are now properly falling back to the ones defined
- / Behaves as you suggested. It should properly jump to the date and increase it by a day.
Let me know if it works as expected.
from orgmode.
Hey, nice to hear you worked on this!
-
OK, so the way I understood it, if the cursor is on the beginning of the line and I hit
<C-a>
it should move to the next date object and increase it by 1 day. On the video, if I hit do that, nothing happens. (which is still much better than increasing the year) -
Perhaps an unexpected side-effect of the change is that if I now type
<C-a>
without next dates, it moves to the nearest number (in this case2
), which I think also is not intended.
simplescreenrecorder-.39.mp4
from orgmode.
Do you have default mappings set for this? It's not behaving same for you like it is for me. Here's gif how it works for me:
from orgmode.
Related Issues (20)
- Orgmode mappings for increment/decrement date part under cursor are inverted HOT 2
- Huge performance drop after tree-sitter drop HOT 9
- Keep empty line between folded headlines HOT 1
- No agenda entries found HOT 6
- Orgmode as filetype plugin throws error HOT 9
- Add support for citations
- Application of colorscheme breaks todo keyword highlighting HOT 3
- uuidgen does not exist on Windows HOT 2
- Windwos path with Colon (:) (ex: E:\repoes\README.md) can't open
- Error (freezes nvim) when opening file with code block name in different case (e.g. "Python", "JSON", "R"): `no such language: R` HOT 1
- Context is lost when archiving headline with level >1 HOT 2
- Make Virtual Indentation (indent mode) support `set wrap` HOT 2
- Improve documentation workflow. HOT 9
- Repeating API calls to get_entries cause stackoverflow at some time HOT 6
- * TODO Display checkbox progress (as virtual text) [2/4] HOT 1
- Date arithmetic does calculate correctly +/- 1 month
- Advanced search regex
- Cursor position after "Move subtree" doesn't allow for convenient repetition HOT 1
- How to change highlighting of folded lines? HOT 6
- Refiling ignores preamble export options HOT 2
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 orgmode.