summaryrefslogtreecommitdiff
path: root/nsis
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 /nsis
parentc312b8b87a589ed8452dbf0f555f05ff86d04692 (diff)
downloadvim-git-c3fdf7f80b2febdd8a8f7a1310631567d257d66a.tar.gz
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 'nsis')
-rw-r--r--nsis/gvim.nsi46
-rw-r--r--nsis/vimrc.ini68
2 files changed, 113 insertions, 1 deletions
diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
index 8447d5ffe..4e9bbfb45 100644
--- a/nsis/gvim.nsi
+++ b/nsis/gvim.nsi
@@ -83,6 +83,7 @@ SilentInstall normal
# These are the pages we use
Page license
Page components
+Page custom SetCustom ValidateCustom ": _vimrc setting"
Page directory "" "" CheckInstallDir
Page instfiles
UninstPage uninstConfirm
@@ -135,6 +136,10 @@ Function .onInit
StrCpy $1 "-register-OLE"
StrCpy $2 "gvim evim gview gvimdiff vimtutor"
+ # Extract InstallOptions files
+ # $PLUGINSDIR will automatically be removed when the installer closes
+ InitPluginsDir
+ File /oname=$PLUGINSDIR\vimrc.ini "vimrc.ini"
FunctionEnd
Function .onUserAbort
@@ -404,7 +409,7 @@ Section "Add an Edit-with-Vim context menu entry"
SectionEnd
##########################################################
-Section "Create a _vimrc if it doesn't exist"
+Section "Create a _vimrc if it doesn't exist" sec_vimrc_id
SectionIn 1 3
StrCpy $1 "$1 -create-vimrc"
@@ -463,6 +468,45 @@ Section -post
SectionEnd
##########################################################
+Function SetCustom
+ # Display the InstallOptions dialog
+
+ # Check if a _vimrc should be created
+ SectionGetFlags ${sec_vimrc_id} $0
+ IntOp $0 $0 & 1
+ StrCmp $0 "1" +2 0
+ Abort
+
+ Push $3
+ InstallOptions::dialog "$PLUGINSDIR\vimrc.ini"
+ Pop $3
+ Pop $3
+FunctionEnd
+
+Function ValidateCustom
+ ReadINIStr $3 "$PLUGINSDIR\vimrc.ini" "Field 2" "State"
+ StrCmp $3 "1" 0 +3
+ StrCpy $1 "$1 -vimrc-remap no"
+ Goto behave
+
+ StrCpy $1 "$1 -vimrc-remap win"
+
+ behave:
+ ReadINIStr $3 "$PLUGINSDIR\vimrc.ini" "Field 5" "State"
+ StrCmp $3 "1" 0 +3
+ StrCpy $1 "$1 -vimrc-behave unix"
+ Goto done
+
+ ReadINIStr $3 "$PLUGINSDIR\vimrc.ini" "Field 6" "State"
+ StrCmp $3 "1" 0 +3
+ StrCpy $1 "$1 -vimrc-behave mswin"
+ Goto done
+
+ StrCpy $1 "$1 -vimrc-behave default"
+ done:
+FunctionEnd
+
+##########################################################
Section Uninstall
# Apparently $INSTDIR is set to the directory where the uninstaller is
# created. Thus the "vim61" directory is included in it.
diff --git a/nsis/vimrc.ini b/nsis/vimrc.ini
new file mode 100644
index 000000000..a3e9ecb5b
--- /dev/null
+++ b/nsis/vimrc.ini
@@ -0,0 +1,68 @@
+[Settings]
+NumFields=7
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=53
+Text=" Key remapping "
+
+[Field 2]
+Type=radiobutton
+Text=Do not remap keys for Windows behavior (Default)
+Left=10
+Right=-10
+Top=17
+Bottom=25
+State=1
+Flags=GROUP
+
+[Field 3]
+Type=radiobutton
+Text=Remap a few keys for Windows behavior (<C-V>, <C-C>, <C-A>, <C-S>, <C-F>, etc)
+Left=10
+Right=-10
+Top=30
+Bottom=47
+State=0
+Flags=NOTABSTOP
+
+[Field 4]
+Type=GroupBox
+Left=0
+Right=-1
+Top=55
+Bottom=-5
+Text=" Mouse behavior "
+
+[Field 5]
+Type=radiobutton
+Text=Right button extends selection, left button starts visual mode (Unix)
+Left=10
+Right=-5
+Top=72
+Bottom=80
+State=0
+Flags=GROUP
+
+[Field 6]
+Type=radiobutton
+Text=Right button has a popup menu, left button starts select mode (Windows)
+Left=10
+Right=-5
+Top=85
+Bottom=93
+State=0
+Flags=NOTABSTOP
+
+[Field 7]
+Type=radiobutton
+Text=Right button has a popup menu, left button starts visual mode (Default)
+Left=10
+Right=-5
+Top=98
+Bottom=106
+State=1
+Flags=NOTABSTOP