Archive

Archive for the ‘Webmasters’ Category

vi Command list for Command Line Editing

September 16th, 2009 No comments

As you already know, Linux has some things that require command line even for user tasks. Most of them are connected with file modification. There are some ways to alter files from command line, and one of the most effective seems to be vi. It is a powerful editor that comes with lots of functions and if you know its hotkeys, it will save you lots of time. Some people say that it cannot be compared even with Windows text editors. So let me show you several things that will make your interaction with vi more pleasant.

We’ll start with cursor control, as it’s the first need when you open a file.

h Left
j Down
k Up
l (or spacebar)    Right

Of course, you’re welcome to use keyboard arrows if you like them so much. There are some more complicated manipulations, so let me show them. These commands will help you to navigate between your file text in a smart way.

w Forward one word
b Back one word
e End of word
( Beginning of current sentence
) Beginning of next sentence
{ Beginning of current paragraph
} Beginning of next paragraph
[[ Beginning of current section
]] Beginning of next section
0 Start of current line
$ End of current line
^ First non-white character of current line
+ or Return (Enter)    First character of next line
- First character of previous line
n | character n of current line

If your file takes some screens, there are some commands for screen movements.

H Top line of current screen
M Middle line of current screen
L Last line of current screen
nH n lines after top line of current screen
nL n lines before last line of current screen
Ctrl-F Forward one screen
Ctrl-B Back one screen
Ctrl-D Down half a screen
Ctrl-U Up half a screen
Ctrl-E Display another line at bottom of screen
Ctrl-Y Display another line at top of screen
z Return (Enter)  Redraw screen with cursor at top
z . Redraw screen with cursor in middle
z – Redraw screen with cursor at bottom
Ctrl-L Redraw screen without re-positioning
Ctrl-R Redraw screen without re-positioning

Of course, there are some commands related to search and moving between line numbers.
/text Search for text (forwards)
/    Repeat forward search (Just like F3 in Microsoft Windows)
?text Search for text (backwards)
? Repeat previous search backwards
n Repeat previous search
N Repeat previous search, but it opposite direction
/text/+n    Go to line n after text
?text?-n Go to line n before text
% Find match of current parenthesis, brace, or bracket (very useful for programmers).
Ctrl-G Display line number of cursor
nG Move cursor to line number n
:n Move cursor to line number n
G Move to last line in file

As you can see, there are lots of ways to navigate within a file. Let’s start with wile editing commands, they aren’t less interesting.

A Append to end of current line
i Insert before cursor
I Insert at beginning of line
o Open line above cursor
O Open line below cursor
ESC End of insert mode
Ctrl-I Insert a tab
Ctrl-T Move to next tab position
Backspace Move back one character
Ctrl-U Delete current line
Ctrl-V Quote next character
Ctrl-W Move back one word
cw Change word
cc Change line
C Change from current position to end of line
dd Delete current line
ndd Delete n lines
D Delete remainer of line
dw Delete word
d} Delete rest of paragraph
d^ Delete back to start of line
c/pat Delete up to first occurance of pattern
dn Delete up to next occurance of pattern
dfa Delete up to and including a on current line
dta Delete up to, but not including, a on current line
dL Delete up to last line on screen
dG Delete to end of file
J Join two lines
p Insert buffer after cursor
P Insert buffer before cursor
rx Replace character with x
Rtext Replace text beginning at cursor
s Substitute character
ns Substitute n characters
S Substitute entire line
u Undo last change

And we finally come to file manipulation commands as we will need to save (or not) our changes.

:w Write file
:w! Write file (ignoring warnings, force writing)
:w! file Overwrite file (ignoring warnings)
:wq Write file and quit
:q Quit
:q! Quit (even if changes not saved)
:w file Write file as file, leaving original untouched
ZZ Quit, only writing file if changed
icon mad vi Command list for Command Line Editing Quit, only writing file if changed
:n1,n2w file Write lines n1 to n2 to file
:n1,n2w >> file Append lines n1 to n2 to file
:e file2    Edit file2 (current file becomes alternate file)
:e! Reload file from disk (revert to previous saved version)
:e# Edit alternate file
% Display current filename
# Display alternate filename
:n Edit next file
:n! Edit next file (ignoring warnings)
:n files Specify new list of files
:r file Insert file after cursor
:r !command Run command, and insert output after current line

As you can see, the number of vi commands is really huge. If you get acquainted to this editor, you won’t even try anything else, the professional programmers say. If you need vi to edit files (e.g. crontab modification), you will find all the necessary commands above.

Have a good time with vi! icon smile vi Command list for Command Line Editing

WordPress 2.8 Release

June 15th, 2009 No comments

Nowadays the great majority of Internet users are familiar with WordPress which represents the largest self-hosted blogging tool in the world. Being started in 2003 by a small group of people at the moment it’s used on hundreds of thousands of sites and seen by tens of milions of people every day.

One of the greatest things about WordPress, in addition to the fact that it’s absolutely free, is the feature of being completely customizable, thus giving the opportunity to use it for almost anything.

Since the appearance of the first version (0.7 on 27th of May, 2003) WordPress has been constantly updated introducing a lot of different improvements and offering greater functionality each and every time. Starting from the Version 1.0 most of the releases were named after well-known jazz musicians. After 1.5 release WordPress seemed to have something people really liked and it started to experience some fairly rapid growth (in a period of one year – from 2006 to 2007 – the amount of downloads increased in more than 2,5 times).

The last version – 2.8 “Baker” version named in honor of noted trumpeter and vocalist Chet Baker – representing the main topic of the given post was released on June 10th, 2009. Let’s check what new features and improvements of this release are.

Read more…

Voting Plugins For WordPress Blogs

June 4th, 2009 8 comments

It’s quite a well-known fact that users’ feedback is of the great importance to the site owners. In addition to the fact that their feedback makes your site more attractive (because people like to read posts with a lot of comments and to express their opinion – they like being involved), it shows you how valuable and relevant your content is.

Thus it helps you to understand what the things that should be improved are.   Generally to get this extremely important feedback we give users the opportunity to leave the comments after each and every post. No doubt it’s a really nice idea. However there is one more thing that shouldn’t be underestimated – voting opportunity (voting functionality for posts).

Let’s discuss the most popular voting plugins for the WordPress that can help your blog to become even better.
Read more…