how to search replace in the whole text

how to undo redo

how to change selected text UPPERCASE to lowercase

other examples:


vim; # start vim
# inside vim global search and replace
:%s/search/replace/g

vi testfile.txt; # open some file with this content

Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test
i
:1,5s/T/t/g

# 1 = start at line 1
# 5 = stop at line 5
# s = search and replace mode
# T = search for this
# t = replace with this
# g = globally meaning apply to the full line, not just the beginning

:3,$s/T/t/g

# 3 = start at line 3
# $ = until the end of file
# s = search and replace mode
# T = search for this
# t = replace with this
# g = globally meaning apply to the full line, not just the beginning

# by the way you can type
: # and cursor up/down to scroll to your command history

Credits vi:

Vi “the original”. Without further remarks this is the version of Vi that appeared in Sun OS 4.x. “:version” returns “Version 3.7, 6/7/85”. Sometimes other versions are referred to. Only runs under Unix. Source code only available with a license. More information on Vi can be found through: http://vi-editor.org [doesn’t currently work…] moved to -> http://ex-vi.sourceforge.net/ Bill Joy https://en.wikipedia.org/wiki/Vi William NelsonBillJoy (born November 8, 1954) is an American computer scientist. Joy co-founded Sun Microsystems in 1982 along with Vinod Khosla, Scott McNealy and Andreas von Bechtolsheim, and served as chief scientist at the company until 2003. He played an integral role in the early development of BSD UNIX while a graduate student at Berkeley, and he is the original author of the vi text editor. He also wrote the 2000 essay “Why the Future Doesn’t Need Us“, in which he expressed deep concerns over the development of modern technologies. sources: https://sourceforge.net/projects/ex-vi/

licensing trouble:

The vi editor is one of the most common text editors on Unix. It was developed starting around 1976 by Bill Joy at UCB, who was tired of the ed editor. But since he used ed as a code base, access to the original sources has required a commercial Unix Source Code License for more than twenty years. In January 2002, Caldera was so kind to remove usage restrictions to the Ancient Unix Code by a BSD-style license (see the announcement at Slashdot) and thus vi is now finally free.

160KByte

traditional vi is a rather small program (the binary size is approximately 160 kBytes on i386) just with its extremely powerful editing interface, but lacking fancy features like multiple undo, multiple screens, or syntax highlighting.

Credits vim:

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as “vi” with most UNIX systems and with Apple OS X. Vim is rock stable and is continuously being developed to become even better. Among its features are:

    • persistent, multi-level undo tree
    • extensive plugin system
    • support for hundreds of programming languages and file formats
    • powerful search and replace
    • integrates with many tools

3. Credits                              credits author Bram Moolenaar

Most of Vim was written by Bram Moolenaar <mail redacted to avoid spam>.

Parts of the documentation come from several Vi manuals, written by:
        W.N. Joy
        Alan P.W. Hewett
        Mark Horton

The Vim editor is based on Stevie and includes (ideas from) other software,
worked on by the people mentioned here.  Other people helped by sending me
patches, suggestions and giving feedback about what is good and bad in Vim.

Vim would never have become what it is now, without the help of these people!

        Ron Aaron               Win32 GUI changes
        Mohsin Ahmed            encryption
        Zoltan Arpadffy         work on VMS port
        Tony Andrews            Stevie
        Gert van Antwerpen      changes for DJGPP on MS-DOS
        Berkeley DB(3)          ideas for swap file implementation
        Keith Bostic            Nvi
        Walter Briscoe          Makefile updates, various patches
        Ralf Brown              SPAWNO library for MS-DOS
        Robert Colon            many useful remarks
        Marcin Dalecki          GTK+ GUI port, toolbar icons, gettext()
        Kayhan Demirel          sent me news in Uganda
        Chris & John Downey     xvi (ideas for multi-windows version)
        Henk Elbers             first VMS port
        Daniel Elstner          GTK+ 2 port
        Eric Fischer            Mac port, 'cindent', and other improvements
        Benji Fisher            Answering lots of user questions
        Bill Foster             Athena GUI port
        Google                  Lets me work on Vim one day a week
        Loic Grenie             xvim (ideas for multi windows version)
        Sven Guckes             Vim promoter and previous WWW page maintainer
        Darren Hiebert          Exuberant ctags
        Jason Hildebrand        GTK+ 2 port
        Bruce Hunsaker          improvements for VMS port
        Andy Kahn               Cscope support, GTK+ GUI port
        Oezguer Kesim           Maintainer of Vim Mailing Lists
        Axel Kielhorn           work on the Macintosh port
        Steve Kirkendall        Elvis
        Roger Knobbe            original port to Windows NT
        Sergey Laskavy          Vim's help from Moscow
        Felix von Leitner       Previous maintainer of Vim Mailing Lists
        David Leonard           Port of Python extensions to Unix
        Avner Lottem            Edit in right-to-left windows
        Flemming Madsen         X11 client-server, various features and patches
        Tony Mechelynck         answers many user questions
        Paul Moore              Python interface extensions, many patches
        Katsuhito Nagano        Work on multi-byte versions
        Sung-Hyun Nam           Work on multi-byte versions
        Vince Negri             Win32 GUI and generic console enhancements
        Steve Oualline          Author of the first Vim book frombook
        Dominique Pelle         valgrind reports and many fixes
        A.Politz                Many bug reports and some fixes
        George V. Reilly        Win32 port, Win32 GUI start-off
        Stephen Riehm           bug collector
        Stefan Roemer           various patches and help to users
        Ralf Schandl            IBM OS/390 port
        Olaf Seibert            DICE and BeBox version, regexp improvements
        Mortaza Shiran          Farsi patches
        Peter da Silva          termlib
        Paul Slootman           OS/2 port
        Henry Spencer           regular expressions
        Dany St-Amant           Macintosh port
        Tim Thompson            Stevie
        G. R. (Fred) Walter     Stevie
        Sven Verdoolaege        Perl interface
        Robert Webb             Command-line completion, GUI versions, and
                                lots of patches
        Ingo Wilken             Tcl interface
        Mike Williams           PostScript printing
        Juergen Weigert         Lattice version, AUX improvements, UNIX and
                                MS-DOS ports, autoconf
        Stefan 'Sec' Zehl       Maintainer of vim.org

I wish to thank all the people that sent me bug reports and suggestions.  The
list is too long to mention them all here.  Vim would not be the same without
the ideas from all these people: They keep Vim alive!
love peace friendship gross-national-happiness

Links:

http://www.vim.org/

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin