Vim Tips Wiki
mNo edit summary
 
(Change to TipImported template + severe manual clean)
Line 1: Line 1:
 
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=535
 
|id=535
  +
|previous=534
|title=Working with only one term/console?
 
  +
|next=536
|created=August 19, 2003 9:24
+
|created=August 19, 2003
 
|complexity=basic
 
|complexity=basic
 
|author=Gnaphos
 
|author=Gnaphos
 
|version=6.0
 
|version=6.0
 
|rating=30/20
 
|rating=30/20
 
}}
|text=
 
Sometimes you can only work with a single terminal/console, or you hate having
+
Sometimes you can only work with a single terminal/console, or you hate having too many windows open and need to switch between them, or QuickFix does not work on your favourite languages? This simple, yet powerful key stroke (Ctrl-Z) might be very useful to you.
   
  +
For example, let's say you are composing an email using vim on mutt, or you want to compile your <insert your favourite language> file, you can simply press Ctrl-Z, gives you the prompt back, do multiple commands and whatever you want, and goes back to vim editing by typing "fg" again.
too many windows open and need to switch between them, or QuickFix does not
 
   
 
If you need to admin some machine that only have vi instead of vim on some reason, you can edit multiple files by suspend them, using "jobs" to list them and "fg %n" (n is the job number) to load them back.
work on your favourite languages? This simple, yet powerful key stroke (Ctrl-Z)
 
   
 
So by using the simple Ctrl-Z, not only that you can edit multiple files in the same vim, you can edit multiple groups of files in different vim.
might be very useful to you.
 
   
 
Although it is a shell feature, but it goes together nicely with vim.
   
 
Just in case for people that do not know, if all you want is to run a single external command, use ":!cmd", or "!<motion><filter>" to filter <motion> text throught the command.
   
For example, let's say you are composing an email using vim on mutt, or you want
+
For example, if you have a line "1 + 1 * 2", position cursor on it, and type "!}bc", you got "3" for you answer back.
   
 
Or another example, position your cursor at the first line of your paragraph and type "!}fmt", now the paragraph is nicely formatted.
to compile your <insert your favourite language> file, you can simply press Ctrl-Z,
 
 
gives you the prompt back, do multiple commands and whatever you want, and
 
 
goes back to vim editing by typing "fg" again.
 
 
 
 
If you need to admin some machine that only have vi instead of vim on some reason,
 
 
you can edit multiple files by suspend them, using "jobs" to list them and "fg %n" (n
 
 
is the job number) to load them back.
 
 
 
 
So by using the simple Ctrl-Z, not only that you can edit multiple files in the same vim,
 
 
you can edit multiple groups of files in different vim.
 
 
 
 
Although it is a shell feature, but it goes together nicely with vim.
 
 
 
 
Just in case for people that do not know, if all you want is to run a single external
 
 
command, use ":!cmd", or "!<motion><filter>" to filter <motion> text throught the
 
 
command.
 
 
 
 
For example, if you have a line "1 + 1 * 2", position cursor on it, and type "!}bc",
 
 
you got "3" for you answer back.
 
 
 
 
Or another example, position your cursor at the first line of your paragraph and
 
 
type "!}fmt", now the paragraph is nicely formatted.
 
 
 
 
With all these in hand, you don't need to waste key strokes to switch between
 
 
different windows anymore, the only drawback is it only works in *nix.
 
}}
 
   
 
With all these in hand, you don't need to waste key strokes to switch between different windows anymore, the only drawback is it only works in *nix.
== Comments ==
 
I like to use GNU screen in only one terminal/console. Pressing C-a C-a can quickly switch between different "windows" . And C-a C-c opens a new window.
 
   
 
==Comments==
 
I like to use GNU screen in only one terminal/console. Pressing C-a C-a can quickly switch between different "windows" . And C-a C-c opens a new window.
 
http://www.gnu.org/software/screen/screen.html
 
http://www.gnu.org/software/screen/screen.html
   
'''Anonymous'''
 
, February 2, 2004 4:05
 
 
----
 
----
<!-- parsed by vimtips.py in 0.325730 seconds-->
 

Revision as of 07:10, 4 November 2007

Tip 535 Printable Monobook Previous Next

created August 19, 2003 · complexity basic · author Gnaphos · version 6.0


Sometimes you can only work with a single terminal/console, or you hate having too many windows open and need to switch between them, or QuickFix does not work on your favourite languages? This simple, yet powerful key stroke (Ctrl-Z) might be very useful to you.

For example, let's say you are composing an email using vim on mutt, or you want to compile your <insert your favourite language> file, you can simply press Ctrl-Z, gives you the prompt back, do multiple commands and whatever you want, and goes back to vim editing by typing "fg" again.

If you need to admin some machine that only have vi instead of vim on some reason, you can edit multiple files by suspend them, using "jobs" to list them and "fg %n" (n is the job number) to load them back.

So by using the simple Ctrl-Z, not only that you can edit multiple files in the same vim, you can edit multiple groups of files in different vim.

Although it is a shell feature, but it goes together nicely with vim.

Just in case for people that do not know, if all you want is to run a single external command, use ":!cmd", or "!<motion><filter>" to filter <motion> text throught the command.

For example, if you have a line "1 + 1 * 2", position cursor on it, and type "!}bc", you got "3" for you answer back.

Or another example, position your cursor at the first line of your paragraph and type "!}fmt", now the paragraph is nicely formatted.

With all these in hand, you don't need to waste key strokes to switch between different windows anymore, the only drawback is it only works in *nix.

Comments

I like to use GNU screen in only one terminal/console. Pressing C-a C-a can quickly switch between different "windows" . And C-a C-c opens a new window. http://www.gnu.org/software/screen/screen.html