summaryrefslogtreecommitdiffstats
path: root/runtime/mswin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-28 18:36:48 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-28 18:36:48 +0200
commitc3fdf7f80b2febdd8a8f7a1310631567d257d66a (patch)
tree52419da4ad3491444daa8336699d88e9b9682ab2 /runtime/mswin.vim
parentc312b8b87a589ed8452dbf0f555f05ff86d04692 (diff)
patch 8.0.1232: MS-Windows users are confused about default mappingsv8.0.1232
Problem: MS-Windows users are confused about default mappings. Solution: Don't map keys in the console where they don't work. Add a choice in the installer to use MS-Windows key bindings or not. (Christian Brabandt, Ken Takata, closes #2093)
Diffstat (limited to 'runtime/mswin.vim')
-rw-r--r--runtime/mswin.vim19
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/mswin.vim b/runtime/mswin.vim
index 6dff7e7719..da869a9fc7 100644
--- a/runtime/mswin.vim
+++ b/runtime/mswin.vim
@@ -1,7 +1,7 @@
" Set options and add mapping such that Vim behaves a lot like MS-Windows
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2017 Feb 09
+" Last change: 2017 Oct 28
" bail out if this isn't wanted (mrsvim.vim uses this).
if exists("g:skip_loading_mswin") && g:skip_loading_mswin
@@ -105,14 +105,15 @@ onoremap <C-F4> <C-C><C-W>c
if has("gui")
" CTRL-F is the search dialog
- noremap <C-F> :promptfind<CR>
- inoremap <C-F> <C-\><C-O>:promptfind<CR>
- cnoremap <C-F> <C-\><C-C>:promptfind<CR>
-
- " CTRL-H is the replace dialog
- noremap <C-H> :promptrepl<CR>
- inoremap <C-H> <C-\><C-O>:promptrepl<CR>
- cnoremap <C-H> <C-\><C-C>:promptrepl<CR>
+ 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
" restore 'cpoptions'