Removing blank spaces

Hi ,
I want to go out of vi editor temporarily and execute a command in command prompt and again going back to the editor . Is it possible . Any help on this is really helpful.

  1. Need to open vi
  2. Temporarily come out and execute a command and go back to vi editor
tr -d ' '

To execute an operating system command from within vi, just type for example

:!ls -l /tmp<CR>

You can also fork a subshell with

:sh<CR>

---------- Post updated at 07:57 ---------- Previous update was at 07:54 ----------

You can also send the current contents of the vi editor buffer through a filter program with

1G!Gtr -d ' '<CR>

1G ... to go to the first line
!G ... send everything from the current position up to the last line through the following command
tr -d ' ' ... the tr command to delete spaces
<CR> ... to terminate the command sequence

Thanks a lot. Its working:b:

@rogerben: please don't change a question to a totally different one while it has already been answered. Editing should be done to clarify an existing question, not to ask another one. In the latter case, either ask it in the thread if you feel there is a relationship or in a different thread where it would get a better visibility.

Hi Rojer,

Hope your query is answer by now but I would also like to point you towards the use of

screen 

command

This screen command creates a new screen under a same window and it acts as if there are 2 sessions running.

Try this screen concept and revert back if it helps you cause.

Vivek,
The screen command is not working . Can you pls let me know the exact usage of the screen command