Differences

This shows you the differences between the selected revisions of the page.

2010-03-23 2010-03-23
no summary (kdpickett) no summary (kdpickett)
Line 28: Line 28:
If you want to avoid that, you need to make sure that your editor opens each file in a separate window (process). Some editors do that by default while some offer a configuration option for that. If either is the case, then configure your editor as an external editor for WinSCP and enable preference option //[[ui_editor_preferences#external|External editor opens each file in separate window (process)]]//. WinSCP will then treat the file as closed when the editor launched to open it is closed. If you want to avoid that, you need to make sure that your editor opens each file in a separate window (process). Some editors do that by default while some offer a configuration option for that. If either is the case, then configure your editor as an external editor for WinSCP and enable preference option //[[ui_editor_preferences#external|External editor opens each file in separate window (process)]]//. WinSCP will then treat the file as closed when the editor launched to open it is closed.
  * Note that this setting only affects the "edit" operation. So you may want to make sure that editing is the [[ui_pref_panels#double-click|default operation for double-click]].   * Note that this setting only affects the "edit" operation. So you may want to make sure that editing is the [[ui_pref_panels#double-click|default operation for double-click]].
-  * For configuring Vim, you would not choose to option preference above for opening each file in a separate process.  See [[task_edit#Configuring Vim as an External Editor in WinSCP|Configuring Vim as an External Editor in WinSCP]] for more information.+  * For configuring Vim, you would not choose to option preference above for opening each file in a separate process.  See [[task_edit#configuring_vim_as_an_external_editor|Configuring Vim as an External Editor]] for more information. 
 + 
 +===== Configuring Vim as an External Editor ===== 
 + 
 +Vim can be easily configured for use with WinSCP.  To configure Vim as an external editor in WinSCP, do the following
 +  - From the menu of WinSCP, select //Options > Preferences// 
 +  - Select //Editors// from the left pane of the //Preferences// window. 
 +  - From //Editor Preference//, select //Add ...// 
 +  - From the //Add Editor// window, click on the //External editor// radio button. 
 +  - Click the //Browse// button and navigate to the path where Vim is installed.  For example, the default installation for a Windows installation of Vim is ''"C:\Program Files\Vim\vim72\'' (Assuming Vim 7.2 is your version).  You could also apply these steps to the portable version of Vim as well. 
 +  - Select //gvim.exe// as the editor.  **(Note: This selects the GUI version of Vim.)** 
 +You will notice the the box will return something that looks similar to the following:\\ **''"C:\Program Files\Vim\vim72\gvim.exe"'' !.!**\\  
 +Make sure to leave the **!.!** as it is at the end of the string.\\  
 +For simple use of Vim, choosing any of the //External editor options// below the //Editor// selection are optional depending on your needs.  However, as you will see in the next section, this is not the case for using Vim with multiple tabs.  To complete the external editor selection, click the OK button at each dialog to finish the setup. 
 +Whenever you right-click on a file and select **Edit**, the file will be loaded into Vim for editing. 
 + 
 +==== Configuring WinSCP for Vim Multi-Tab Use ==== 
 + 
 +Vim supports multiple tabs as of version 7.  Invoking a multiple tab session requires an additional command line argument to be passed to Vim.  Step 6 above documents what is returned when the Vim editor executable (//gvim.exe//) is selected.  The string **''"C:\Program Files\Vim\vim72\gvim.exe"'' !.!** 
 +is indicated in the box for //External editor//.  In order to enable multiple tab support, you must pass the //--remote-tab-silent// argument to the command line just before **!.!**.  To make this change, place your cursor in the drop-down box after the ''"'' and before the **!.!**.\\  
 +Just type in //--remote-tab-silent//.  Make sure there is a space between that and **!.!**.\\  
 + 
 +The full command line string should look accordingly:\\  
 +''"C:\Program Files\Vim\vim72\gvim.exe" --remote-tab-silent'' !.! 
 +\\  
 +In the section below titled //External editor options (affects editing remote files only)//, make sure the box titled //External Editor opens each file in separate window (process)// is **Un-Checked**.  You want each file to open in Vim in the same process since the tabs are derived in the same Vim session. 
 + 
 +To edit files in Vim using multiple tabs, select either one or multiple files in the WinSCP file Explorer using your mouse and keyboardRight click on one of the highlighted files and select **Edit**.  Vim will load the selected files in separate tabs in one Vim edit session.  Any time you want to edit an additional file in the same session, just right-click on it and select **Edit**.  The file will be loaded into a new tab in the original Vim session.\\  
===== [[binary]] Editing Binary Files ===== ===== [[binary]] Editing Binary Files =====