6

In MacVim 8.0, ctrl-f brings up a search window instead of scrolling forward in a buffer by one full screen. ctrl-F (i.e. pressing the SHIFT key also) gives the same result.

Is there a troubleshooting step or a repair step I can take?

cumin
  • 471
  • 5
  • 17
  • Are you confusing `Ctrl-` with `Cmd-`? – romainl Jan 08 '18 at 06:29
  • No; both Ctrl-f and Cmd-f give the same results (a search window pops up). – cumin Jan 08 '18 at 12:31
  • 1
    `:verbose map ` – romainl Jan 08 '18 at 13:11
  • Thanks; mswin.vim has the mapping; how do I disable that bit (is that a separate question for SO?) – cumin Jan 08 '18 at 13:44
  • MacVim doesn't source that script by itself. It *must* be sourced somewhere in your config. – romainl Jan 08 '18 at 14:07
  • My macvim vimrc sources the script, which remaps ctrl-f. On windows gvim 7.4, which also sources mswin, ctrl-f is not remapped. – cumin Jan 08 '18 at 18:20
  • `mswin.vim` is only sourced in one place: `$VIMRUNTIME/evim.vim`, which itself is only ever sourced when you start Vim as `$ evim` or as `$ vim -y`. – romainl Jan 08 '18 at 19:52
  • @romaini 's comment about `:verbose map is helpful in finding where this mapping is coming from. – KC Baltz Dec 07 '20 at 23:38
  • On Windows gvim version 8.2.1484, ctrl-f is remapped to "find." Thanks to [monojohnny](https://stackoverflow.com/questions/48143511/ctrl-f-does-not-scroll-forward-in-macvim/53533136#comment118908445_53533136) for the suggestion to simply :unmap it. – Josiah Yoder Jan 03 '22 at 17:17

3 Answers3

3

I don't know about the MacVim. But I had experienced same situation at window gvim.

I mean when I press "Ctrl+F" I don't want to see search window.

I found the below at "C:\Program Files (x86)\Vim\vim81\mswin.vim".

To resolve your problem, all you have to do is just comment the below line, that's it.

if has("gui")
  " CTRL-F is the search dialog
  noremap  <expr> <C-F> has("gui_running") ? ":promptfind\<CR>" : "/"
  inoremap <expr> <C-F> has("gui_running") ? "\<C-\>\<C-O>:promptfind\<CR>" : "\<C-\>\<C-O>/"
  cnoremap <expr> <C-F> has("gui_running") ? "\<C-\>\<C-C>:promptfind\<CR>" : "\<C-\>\<C-O>/"

  " CTRL-H is the replace dialog,
  " but in console, it might be backspace, so don't map it there
  nnoremap <expr> <C-H> has("gui_running") ? ":promptrepl\<CR>" : "\<C-H>"
  inoremap <expr> <C-H> has("gui_running") ? "\<C-\>\<C-O>:promptrepl\<CR>" : "\<C-H>"
  cnoremap <expr> <C-H> has("gui_running") ? "\<C-\>\<C-C>:promptrepl\<CR>" : "\<C-H>"
endif
OTOTO
  • 198
  • 9
  • 2
    Instead of editing the OOTB .vim file.Try using "unmap " in your personal vim startup file. – monojohnny Apr 26 '21 at 18:45
  • 1
    I had to use the following to get commandline vim to not complain about C-F not being mapped: `if has("gui") unmap endif` – KC Baltz May 17 '22 at 19:46
2

I think what happened is that gvim 8.0 has a mapping for <Ctrl-f> in mswin.vim, but the previous version of gvim does not have that mapping in mswin.vim

I use both versions (on different computers), and so got surprised by the <Ctrl-f> mapping in the gvim 8.0 version.

My vimrc sources mswin.vim because I like the copy-paste functionality.

cumin
  • 471
  • 5
  • 17
0

if you are using Vscode, change "<C-f>" from false to true.

ligne 81

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Karim
  • 1