6

Sometimes I have the need to modify files that are in a FTP server, currently I have Filezilla opening them in sublime. But I'm moving to VIM and I haven't found a way to make the file open in VIM console. Probably works flawless for gVim but anyone have this working on the console?

Luis D Urraca
  • 2,024
  • 4
  • 24
  • 46

3 Answers3

6

I managed to have a console pop up with vim by invoking a custom shell script wrapper instead of vim itself.

#!/bin/bash
gnome-terminal -e "vim $1"

One of the drawbacks is that everytime a new window will pop up. Hope this helps.

soulseekah
  • 8,770
  • 3
  • 53
  • 58
2

This topic is quite old but Vim stays the best ! So, I'd like to share my experience.

I'm using Guake Terminal and Vim v8 on a Debian 9.2 environment. The solution posted by @soulseekah is great but does not allow multiple files open in this configuration.

As the accepted solution, we will need a bash script. The difference will be that we check if vim is running. If no, run it. If yes, open the file in a new tab.

Here we go :

#!/bin/bash

if pgrep -x "vim" > /dev/null ; then
    guake -e ":tabedit $1";
else
    guake -e "vim $1" 
fi

Downsides :

  • Need to be in normal mode to open new files.
  • Not working with gnome-terminal.

Enjoy guys !

JazZ
  • 4,469
  • 2
  • 20
  • 40
0

I use Midnight Commander to do the same thing & it works with console Vim as well as a lot of very useful other commands.

phildobbin
  • 814
  • 8
  • 9