esm7 / obsidian-vimrc-support

A plugin for the Obsidian.md note-taking software
MIT License
1.05k stars 45 forks source link

Mapping <C-d>zz #135

Open bbawj opened 2 years ago

bbawj commented 2 years ago

Please make sure your question is within the scope of this plugin.

Describe the question I like to use <C-d> and <C-u> to navigate and wish to center the screen after centering with zz. I would like to ask if anyone managed to have any success mapping <C-d> to <C-d>zz

My current mapping: noremap <C-d> <C-d>zz This works in vim but seems to not be supported here.

RiccardoTonioloDev commented 1 year ago

Hey try to use imap instead of noremap. It seems like noremap it's not supported by the plugin, but imap is.

bbawj commented 1 year ago

noremap is supported:

See README:

The plugin skips blank lines and lines starting with Vimscript comments (" ...).
Special support for yanking to system clipboard can be activated by set clipboard=unnamed (unnamedplus will do the same thing).
Support for the tabstop Vim option (e.g. set tabstop=4).
Custom mapping/unmapping commands in addition to the defaults:
    noremap
    iunmap
    nunmap
    vunmap
    PRs are welcome to implement more :)
RiccardoTonioloDev commented 1 year ago

Yeah I've seen it, but a lot of people have problems while using it. That's why I suggested you to use imap.

ChristinWhite commented 2 months ago

I don't know if this is still an issue @bbawj but at least for me both bindings are working with the current versions of Obsidian and Vimrc Support

noremap <C-d> <C-d>zz
noremap <C-u> <C-u>zz