Recently I've been creating my custom color scheme on VIM for RPGLE language and it works fine when I open files from my computer, but when I try to edit a file via FTP it doesn't work anymore.
Do I need some special config to achieve this?
Related
I am having a lot of trouble solving a SFTP problem...
I would like to be able to open and edit text files in my preferred editor such that I can execute a command on my remote server and it will open the file in Visual Studio Code. Once that file is opened in VS code, I would like to be able to edit it and, when I save, it will save the changes to the same location on the server.
I know something like this is possible because I have used WinSCP where I can double click a text file from the server through the UI and it will open it in whichever editor I choose. When I save changes, it will update those changes on the server. I really want to know what WinSCP is doing behind the scenes when I do that.
Any help would be appreciated. Thanks!
WinSCP is running on your local machine, so it can open a local editor. So, it's not comparable.
You cannot execute local a application from a remote server.
I am trying to open image files, pdf files and music files using Cygwin, a terminal that provides Linux functionality in Windows. So far I have not successfully executed a command that would accomplish what I want. I can only open text files at this moment using vim text editor.
Edit: Thanks for the comments. I am looking to open files using appropriate windows applications. Also, I do not know how I can figure out whether XServer is already installed and why would I need XServer to resolve my issue in the first place.
Use the cygstart utility, e.g.,
cygstart foo.bmp
will open up the image file in Paint.
It’s in the cygutils package, which I believe is installed by default. It has a man page that shows that you can use it to open URLs in your browser, among other things.
I am used to Sublime's plugin that let's you do a mapping between your local project and a remote project. By doing so, when you are done editing a file, you can do a right click and "Upload file" action which automatically updates the file in the remote server.
I am wondering what would be the best way to do this while programming with VIM. I am looking for an easy way to be able to map a local project to a remote one and be able to upload the file easily.
Thanks
If all you want is to edit files on a remote server,
try vim's netrw feature:
vim scp://you#yourserver//path/to/directory/
Edit a file directly:
vim scp://you#yourserver//path/to/directory/somefile.txt
Or if you are already in vim, hit ESC, then type:
:e scp://you#yourserver//path/to/directory/
This assumes that:
you have ssh installed (usually the case for Linux or OSX; if you are on Windows then it depends).
you have ssh access to the server via some convenient method (sshagent and keys)
Most serious FTP clients let you edit remote files locally. Filezilla, gFTP, Transmit, Cyberduck, YummyFTP… they all have their own "Edit in…" button. GUI FTP clients may not be sexy hacker tools but they work very well.
Some of those serious FTP clients have synchronisation features or folder watchers. It might be worth your time to look around for such a feature.
Of course, you can also use Vim itself to edit a remote file via FTP or SFTP:
$ vim sftp://user#machine/filename
$ vim ftp://user#machne/filename
and list remote files:
$ vim sftp://user#machine/directory/
See :help netrw for more info.
Did you consider using a VCS like Subversion, Git or Mercurial?
I'm wondering if there is a way to have MacVim become my default editor when I've SSH'ed into a server. Is there any way for the server's .vimrc file to launch a program on my Mac?
I ask because occasionally I'll be getting some help from our programmer on a project, and if he logs into my account from his computer and opens vim using my configuration the color scheme is usually pretty harsh since he isn't using a terminal that supports 256 colors. Would it be easier to have my .vimrc file set up so if it detects a gui (e.g., I'm using iTerm instead of Terminal.app) it loads the colorscheme I prefer?
Thanks for any advice!
Here's a way to use MacVim to edit files on your server, but it requires you to start MacVim on your local computer first.
First make sure you have netrw installed. Check :help netrw to confirm that it is.
Then after you start MacVim, you can type something like this:
:e scp://username#yourserverdomain.com/.bash_profile
And you should see the file open up in your MacVim vim session. Edit it and save.
Having ssh keys set up to automatically authenticate you into the server will help.
I have gVim (with: NERDTree, minibufexpl). Right now, I can edit files locally with IDE-like feel with NERDTree for a file explorer and minibuf for tabs.
However, I am used to editing files on dummy server I have set up at home. I use Zend Studio to edit files through FTP. Is this feature available in Vim? If so, does it "integrate" well with NERDTree? I would like to browse my FTP directory using NERDTree.
Thank you,
Wenbert
You can edit files remotely over ftp or sftp or scp or whatnot with vim:
vim ftp://user#host/some/file
Of course, this also works with tabs. Don't know about minibuf, though.
Unfortunately, the NERDTree plugin does not seem to support this. However, the :Explore command plays along just nicely.
Of course, you could simply use FTPFS to mount a remote directory and work with that as if it was local storage.