-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add option to use plugin as a simple cursor replacement #3
Comments
Thank you for asking me! Like this: /* iAWriter-ish style. */
.cursorWrapper .x-cursor {
opacity: 1;
background: #00bbff;
width: 3px;
left: -1px;
top: -6px;
height: calc(12px + var(--cursor-height));
transition: opacity;
}
/* Disable movement effect */
.cursorWrapper .x-cursor::after {
display: none;
}
/* Blinking */
.cursorWrapper .x-cursor0,
.cursorWrapper .x-cursor1 {
animation: blink1 1s 0s both infinite;
}
@keyframes blink1 {
0% {
opacity: 1;
}
45% {
opacity: 1;
}
50% {
opacity: 0.2;
}
95% {
opacity: 0;
}
100% {
opacity: 0.2;
}
} Could you please try this CSS snippet? |
Hello. Thanks for sharing the snippet. It works well enough for me. I don't know if there is a way to make it more responsive. Just want to report two issues. The custom cursor does not follow scroll position, and it is slower to respond than the system cursor after typing each letter. I will have to comment out the blink because the system cursor is still visible causing distraction. ninja-2022-08-30_14.05.15.mp4Also noticed this glitch. I understand this is just a fun plugin, so I can live with the issues. ninja2-2022-08-30_14.31.16.mp4Thanks again. Having a more prominent cursor helps me |
@ronrdev |
Awesome! |
So sorry for missing replies!
Yes, we can! We can make different styles between both modes. as below: /* The cursor colour in a light theme */
.theme-light .x-cursor {
background: #00bbff;
}
/*The cursor colour in a dark theme */
.theme-dark .x-cursor {
background: #ffbbff;
} Just only make the scope narrow.
Owing to the v1.0 upgrade, we have to ignore the area where tabs are shown, otherwise we could not move the window. So we have to offset the cursor also in custom CSS.
Could you please try this CSS again? |
Thank you for sharing the css. It's working great and ninja cursor feels more responsive with the new release. |
Hello and thank you for suggesting these features @ronrdev, additionally because you're a fan of iA Writer you should check out the plugin called Stille as it focuses on the sentence you're struggling. But I do have a question for @vrtmrz, is there anyway you can help me with this issue? I am noot sure if its a css problem or something I need to disable on my end. Basically the IA cursor you provided above works great for me, but it slightly is a bit faster than the original cursor, when the IA cursor blinks you can faintly see the system cursor. Obsidian_83PezILgIl.mp4 |
Oh my dear, I am really sorry for missing this! If you feel noisy with the default cursor, we can make that invisible with this CSS: .cm-editor * {
caret-color: transparent !important;
} |
Hey, this doesn't work when you have text selected. Any way to apply this for that too? Also, the styling posted earlier in the thread (#3 (comment)) doesn't play nice with selected text in general, especially when there's multiple rows selected. You got any ideas on how to fix that? (Or alternatively, disabling the custom cursor while text is selected) EDIT: Another thing I thought I'd ask too, I'm using 'transition-duration: 100ms;' to smoothen the movement of the caret. EDIT2: There also seems to be a bug where every 2nd scroll downwards or so, the cursors position doesn't update? |
@Anutim for hiding the cursor that appears when text is selected, I found that you can add:
|
Hello and thanks for making this excellent plugin :-) I am also using it to have an iA Writer-style big and fat cursor that is easy to locate. (The "ninja swoosh" is a really cool idea that also serves a purpose, but perhaps a bit too wild for my taste :-) Mostly this works great with the above snippets (thanks for sharing them!), but there are still two issues:
Cheers! |
A third issue: select multiple lines of text, and you can see a cursor for every line on the left. This is fine by me, but when I delete all the lines, the cursors on the left stay there until I move the cursor again. There's also a minor issue when you fold/unfold a section. The cursor won't move until I let go of the modifier key. But this is not a biggie :-) PS: I do understand that this is a bit of a hack, so not everything can be fixed… but hopefully some things can :-) |
Hello I had set an animation delay that is not working after updating today. I'm still looking for a solution. Not sure what changed that is affecting this.
|
Here’s my updated snippet that incorporates all the fixes as well as solves the latest bug with the cursor blinking during typing as well as the cursor sometimes not blinking when idle. In the code I did reduce the animation delay to 1 second.
|
Since obsidian switched to using the system cursor a plugin is needed to add back an optional styled cursor. I personally like the fat blue cursor of iAwriter.
Option to go back to a custom cursor in Obsidian.
Option to turn off cursor movement effects. (As cool as they are :)
Adding an image from iAwriter just to show how the prominent cursor fits with the intention of this plugin.

The text was updated successfully, but these errors were encountered: