Vim: ctrl-f not scrolling

Created on 11 Aug 2016  路  8Comments  路  Source: VSCodeVim/Vim

Do you need help or have a question? Ask us on Slack 馃懌.
Found a bug? Please fill out the sections below 馃憤.

What did you do?

Press ctrl + f

What did you expect to happen?

Page down

What happened instead?

Cursor advanced one character forward (emacs-style implementation of C-f)

Technical details:

  • VSCode Version: Version 1.4.0 (1.4.0)
  • VsCodeVim Version: 0.1.6
  • OS: OS X 10.11.6

    Other notes

ctrl + b seems to be doing what is expected, more or less.
C-u and C-b seem to be doing what they should... More or less.

Most helpful comment

if you set "vim.useCtrlKeys": true in your settings.json that doesn't work, just search

"vim.handleKeys":{
        "<C-a>": false,
        "<C-f>": false
    },

it makes C-f doesn't work. so just change "<C-f>": false to "<C-f>": true

so it works now.

All 8 comments

Please put "vim.useCtrlKeys": true in your settings.json. That will enable ctrl-f. :)

ah okay, works fine now. Maybe there's a way to make this a default setting for OS X? Having half the functionality out of the box is a little strange, but I could see how taking c-f away on other platforms might also be shocking.

_Edit: I take that back, ctrl-f by default would make more sense since it's a vim plugin_

ctrl+f has been a hot topic. We've seen two camps that have expected ctrl+f to either:

1) page down
2) VSCode's find

So maybe we should have (1) be the default and (2) be reconfigured in the settings.json.

I have two ideas.

  • It is very possible to turn on useCtrlKeys by default in OSX. @hk0i's suggestion makes perfect sense; that setting only affects windows users (and perhaps Linux, I'm not sure)
  • When a user attempts to use a ctrl key like ctrl-f, ctrl-c etc and they haven't enabled useCtrlKeys, we could show an information popup telling them to enable useCtrlKeys for the Vim-related settings. This would ease discoverability.

(Also, trust me @hk0i, there is nothing that I would like more than to enable ctrl-f by default across all platforms. However, the last time I did that, I got a _lot_ of backlash, including some people mentioning it in reviews over on the extension marketplace.)

Yeah that's right @johnfn, it would affect both Windows and Linux, but on OS X the CMD key (Linux "Meta" key, or the windows key) is used instead of Ctrl for most shortcuts, leaving the ctrl keys mostly open for remapping and usually defaulting (in editable text regions) to an emacs-style default key map.

I actually like both of those suggestions. For OS X specifically, there's nothing stopping ctrl-f from making sense since otherwise it would just move forward one character (vim's hjk l key) which, safe to assume, is _not_ the expected behavior in this scenario.

Then on platforms where remapping ctrl-f (or any other key that may be used by VSC, for that matter) would cause a conflict, throwing a dialog stating that could be helpful.

I believe the ideavim plugin for Intellij IDEA does something similar鈥攏ot a full dialog, but they show a notification in the upper-right using their built in notification system.

I have no idea what VSC has since this is really my first day using it. Vim keybindings are usually the first thing I look for in an editor before dropping it for the real vim.

if you set "vim.useCtrlKeys": true in your settings.json that doesn't work, just search

"vim.handleKeys":{
        "<C-a>": false,
        "<C-f>": false
    },

it makes C-f doesn't work. so just change "<C-f>": false to "<C-f>": true

so it works now.

if you set "vim.useCtrlKeys": true in your settings.json that doesn't work, just search

"vim.handleKeys":{
        "<C-a>": false,
        "<C-f>": false
    },

it makes C-f doesn't work. so just change "<C-f>": false to "<C-f>": true

so it works now.

C-d and C-u doesn't work in my vscode, I except these short-keys should be page half.

Was this page helpful?
0 / 5 - 0 ratings