vimrc icon indicating copy to clipboard operation
vimrc copied to clipboard

How to page up and down as a replacement for <c-f> and <c-b>?

Open hangjitrai opened this issue 9 years ago • 6 comments

and have been mapped to ctrlp commands.

What keys can be used for navigating the page with page up and page down? I know I can map it to anything but I want to know the 'standard' way to map the keys to these functionalities.

hangjitrai avatar Aug 23 '17 01:08 hangjitrai

@hangjitrai I have this exact question as you. I just wonder why the author assign c-f, c-b to ctrlp. How do you pagedown or pageup then? I think the standard way of page down, page up should not be replaced easily.

cheng10 avatar Oct 04 '17 02:10 cheng10

See https://github.com/amix/vimrc/issues/119#issuecomment-151835510 for a fix

But this doesn't work for C-f, it remains on the plugin, so in total you need to add

let g:ctrlp_map = '<c-p>'
nnoremap <C-f> <PageDown>
nnoremap <C-b> <PageUp>

to ~/.vim_runtime/my_configs.vim. First line above is the default by ctrlp plugin that is changed here to C-f in ~/.vim_runtime/vimrcs/plugins_config.vim, line 48

Razor-13 avatar Oct 30 '17 09:10 Razor-13

@Razor-13 Great tip, works great. I'd like to point out though, that C-f and C-b are backwards, should be:

let g:ctrlp_map = '<c-p>'
nnoremap <C-f> <PageDown>
nnoremap <C-b> <PageUp>

Based on the vim docs(http://vimdoc.sourceforge.net/htmldoc/scroll.html):

"Ctrl-F: Scroll window [count] pages Forwards (downwards) in the buffer. See also 'startofline' option. When there is only one window the 'window' option might be used."

Ahh, feels so good to have scrolling back to normal. I love the awesome config otherwise, thanks everyone.

joeyslack avatar Oct 30 '17 20:10 joeyslack

Correct, edited my comment above so anyone pasting it don't get confused

Razor-13 avatar Oct 31 '17 02:10 Razor-13

I'm glad you resolved this 👍

amix avatar Nov 30 '19 12:11 amix

I'm glad I found the answer to my issue here. I can now do ctrl+f and ctrl+b to navigate pages.

bruno-rescale avatar Jan 13 '22 23:01 bruno-rescale