Luty « 2013 « Różności …

Różności …

1 lutego 2013


Zaszufladkowany do: Oracle — Jacek @ 00:10

wyłączenie kolorowania:

syntax off

skasowanie pustych linii:


wyszukanie ^M


dopisanie czegoś do końca linii:

SET TERMOUT OFF; spool M:\Documents\test; select * from employees; / spool off;

For example, to delete all lines containing "profile" (the first command is optional;
it shows the lines that the second command will delete):

skasowanie początku lini do określonego wyrażenia:
:%s/^.*QUERY: //g

dodanie średnika na końcu każdej linii

skasowania linii od znaku "*" do końca linii
skasowanie linii od zanku "*" np. 5 znaków
dodanie czegoś na początku linii
:%s/^/Coś /g
skasowanie linii do ostatniej spacji
:%s/^.* //g
skasowanie całości tekstu
x   - delete current character
dw  - delete current word
dd  - delete current line
5dd - delete five lines

d$  - delete to end of line
d0  - delete to beginning of line

delete to beginning of file

delete to end of file

More complex patterns can be used, such as deleting all lines that are empty or that
contain only whitespace:


To delete all lines that do not contain a pattern, use g!, like this command
to delete all lines that are not comment lines in a Vim script:

Delete all trailing whitespace (at the end of each line) with:

Like with ed(1), the substitution text can be omitted if blank:


More rarely, a user might want to delete (leading) whitespace at the beginning of each line:

" Same thing (:le = :left = left-align given range):

Strona startowa: