Vi, a little great editor -I part-
created: 06 Mar 2010 13:38
tags: vi
In all these years, I have always work with vi under linux. Vi is not really the most user friendly editor you can find out there, but certainly is one of the most powerful and flexible.
I strongly encourage my student to have a basic knowledge in vi, and for this, a nice and complete tutorial can be found |here.
Beforehave a look to the most common commands we can use in vi, what should be clear is that vi has two “operating modes”: the edit mode and the command mode. When vi starts, you are in command mode: type i to go in edit mode and start to write. Press the escape key to return in command mode. And please, oh please, forget your mouse ;)
from command mode you can go to insert mode with:
i : start editing from the current position of the cursor
a : start editing from the position next to the current position of the cursor
shift+a : start editing from the end of the line
o : insert a newline below the current line, and start editing
shift+o : insert a newline above the current line, and start editing
some commands in command mode:
x : delete current character
n dd : delete n lines starting from (and including) the current one (dd to delete 1line)
shift+g : jump to the end of the file
n+shift+g : jump to the nth line
1+shift+g : jump to the 1st line
ctrl+g : info about file (name, current line, total line, …)
n shift+y : yank n lines starting from (and including) the current one (Y to yank 1 line)
p : past yanked or deleted lines below the current line
shift+p : past yanked or deleted lines above the current line
. : repeat last command or text entry
u : undo last command
/string : search string in file. type n to jump to the next occurrence, shift+n to jump to the previous occurrence
:1,$s/string/string2/ : replace string1 with string2 in all the file
:n,ms /string/string2/ : replace string1 with string2 from line n to line m
:.,ms /string/string2/ : replace string1 with string2 from the current line to line m
:sp : split horizontally the current vi windows in two
:vsp : split vertically the current vi windows in two
ctrl+w up/down/left/right : change active window (if window has been split)
:e file : open a file /create new file
save, quit, open (command mode):
:w : write (save)
:w! : overwrite an existing file
:q : quit
:q! : quit without saving
:wq or :x : save and quit
visual block (command mode)
ctrl+v : select part of a file (move with the cursor) and then you can use dd, Y, x, …
Continue…
Comments: 0, Rating: 0
Added Google AdSense in the Wiki
created: 05 Mar 2010 10:22
tags: chemcomm
Oh boy, ads also here?
Yes, ads also here. I have decided to add Google advertisement to the wiki, hoping to get enough money to cover the costs to maintain this site. As you may know, wikidot has free accounts, but those have some limitations, in particular regarding the storage for files. Therefore, I have upgraded my free account to a pro lite account, as you can see from the little star in my avatar. This means that I have to pay a little amount of money every year.
To the other hand, I didn't want to spoil the clearness of the wiki graphics stuffing all the empty spaces with ads, so I have been as much discrete as possible: just a little ad on the top of the sidebar and one horizontal banner at the end of the page. No floating ads. Also, only people that do not have a wikidot account (or they have it but are not logged in) will see the ads.
Also, the box to search google is related to my adsense account.
Who gets the money (if any)?
At the moment, I am the only contributor to this site, so there are no questions about who will earn the money, and that would be me. Things may change (or not) in the future, anyway I do not expect to earn lots of money with adsense: it can be discussed, but the idea is that I will reinvest those money into the wiki.
Comments: 0, Rating: 0
Blog
created: 04 Mar 2010 15:08
tags: chemcomm
First post!!!
Today I was looking for something and I ended up on something completely different: how to add a blog to a wikidot site. Could I not to try? Of course not, so, after some tests, the chembytes blog is here :D
I would like to use this blog for all those things that are too small for the wiki, or for those that I want to put in the wiki, when I have no time to write a real page about.
Also, personal things, news and who knows whatelse may find a place on the blog.
Comments: 0, Rating: 0