⬆️ ⬇️

Ideal editor or friend of Notepad ++ with SFTP

Preamble


“Once, in the icy winter season” ... I faced a task to edit the code on a remote server, access to which is only via SSH.

Due to the fact that the code is quite voluminous and with a large number of nested structures, the use of the editor built into Midnight Commander became difficult. From that moment on, my walking around Google and Yandex began in order to find an editor with syntax highlighting, support for block folding and SFTP (Secure FTP, or "FTP via SSH") ...



Ambula


... Actually, the editor was the only one who suited me - the long-known Notepad ++. However, for all its advantages, it does not know how to work with SFTP, and I have not found a plug-in that implements this functionality. But we are not afraid of obstacles, so it was possible to make Notepad ++ work comfortably all the same.



This requires the free OpenSource WinSCP utility (available on the off site ), which allows you to work with files using FTP, SFTP and SCP. With a sufficiently large functionality, it weighs ~ 1.2Mb and, most importantly, allows you to implement your plans.

')

So let's get started.

After installation, open WinSCP. We see a fairly simple and intuitive interface. At the first stage, we are interested in the “Preferences” section in the left menu. Selecting it, we get to the window with a choice of appearance. Personally, I prefer “Norton Commander”, but if the task is only to edit the files on a remote server, Export-like is quite convenient. However, this is irrelevant. And one more “Preferences” button, which is in this window, is essential.

Clicking on it will take you to advanced settings, where we will be interested in the “Editors” menu, where you can specify editor settings for certain types of file extensions. The default editor for all types of "*. *" Is used. But we will not use it, so we will teach you to open Notepad ++. Select the extension "*. *" And click "Edit".

In the window that opens, put the point "External Editor" and write the path to notepad ++. Exe. By installing the checkbox on the item “External editor opens multiple files ...” we’ll make it clear that the editor is able to open different files in separate Tabs, and by setting the checkbox to “Force text transfer mode ...”, we allow synchronization using Ctrl + S waiting for the closure of the external editor. Click "OK". Once again. Setup complete.

Now it’s enough to go to the “Session” menu, enter settings for connecting to the host (if you wish, you can also save them) - and voila! after the connection (at the first - we allow to save the public key) - we see the file manager window.

Click on the file - opens Notepad ++. Rule, press Ctrl + S - the modified file is already on the server. Problem solved!



P.S


I want to note that this is certainly not the only way to solve the problem. But it seemed to me more convenient. In general, it is quite usable.



Oh yeah ... this is my first habratopik, so do not judge strictly)

Source: https://habr.com/ru/post/49414/



All Articles