Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl-f does not scroll forward in MacVim

Tags:

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?

like image 763
cumin Avatar asked Jan 08 '18 02:01

cumin


People also ask

What does CTRL F do in Vim?

Ctrl+f will search within the file ctrl+shift+f will search in all the files in the folder tree. I added ripgrep , It search :Rg! ,it always search in all files like Ctrl + shift + f Whether Rg can be used to search with the files? (like ctrl + f ).

What does control d do in Vim?

You will see list of commands that matches characters in front of the cursor by pressing CTRL-D in the command mode. For example, if you pressed :se in normal mode, then pressed CTRL-D , you will see list of commands that start with se .


2 Answers

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
like image 99
OTOTO Avatar answered Sep 23 '22 13:09

OTOTO


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.

like image 39
cumin Avatar answered Sep 21 '22 13:09

cumin