Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use terminal while coding in vim?

I have a few php files open in Vim, at the same time I want to list files from specific folder in the same server in terminal. How should I do that ?

For example:

In terminal, I am in devserver:~$

Using Vim, I have opened few files to continue my work.

Now, to do other operations on the same server (for example, I would like to list files from styles/), how do I use the terminal window/tab ?

What I do:

In one tab, open files using Vim and In another tab do other operations in same server (like listing/removing etc).

In this case, I have to do ssh login for each tab. Is there any way where I can code using Vim and do other operations in the same server in terminal ?

Please guide me for the best practices for this.

like image 301
RaviRokkam Avatar asked Nov 29 '22 15:11

RaviRokkam


2 Answers

In command mode you can use !<command>

For example:

:!ls

to list files in the current directory.

like image 37
RicoZ Avatar answered Dec 04 '22 22:12

RicoZ


I use Ctrl-z to suspend vim, and fg to call it back.


If you want to do 3+ tasks at the same time, I suggest tmux.

like image 132
kev Avatar answered Dec 04 '22 23:12

kev