This is a one of many mini-posts that I will do on using the VI editor. I’ve recently bumped into some pages that contains valuable information on how to use VI. The problem with it is its too wordy and that makes it hard to look for information when you need it.
So this post and the following ones will use tags relevant to the subject to help the search for relevant information quicker.
D – delete the characters of the line after the cursor position
C – delete the characters of the line after the cursor position and change to insert mode
R – change to insert & overwrite mode; it’s like pressing the Ins key on the keyboard; whereas ‘r’ replaces a single character, ‘R’ replaces every character that you type over
s – behaves like ‘x’ but switches to insert mode
S – deletes the whole line and change to insert mode
Tags: delete, substitute, tips
When doing some simple programming, I like to use the Vim editor instead of using a full-blown IDE. It’s a good editor but I want to use it more efficiently. Some of the things I customise for myself are:
These settings are saved in a file named .vimrc in each user’s home directory. Simply save the vi commands in this file to have your customisation. But remember to remove the semicolons. Below is my .vimrc contents to achieve my customisation.
set tabstop=4
set autoindent
colorscheme wombat
wombat is a colour scheme file which I saved in the directory /usr/share/vim/vim71/colors/.
P.S. While searching for some help on setting the file types in Vim, I found this page in wikibooks.org that describes the tips a programmer would use. It’s unbelievably useful. Do check it out if you use vi editor!
Another page with some useful tips is http://tips.webdesign10.com/general/vim
Tags: tips
In openSUSE 10.3, there is no readily available solution (that I know of) that lets a user print to PDF. The closest thing there is to that is a PostScript (PS) file. Fortunately there is a easy way to convert PS files to PDF. There is a command called ps2pdf which does exactly that. Its usage is very straightforward as well:
ps2pdf document.ps document.pdf
How much simpler can that get?
Tags: tips
Installing fonts has been somewhat of a neglect in Linux. Although I haven’t checked, it seems that recent distributions of SUSE Linux has made it GUI-friendly.
Nevertheless, being a console guy, I believe it’s better to know a more reliable way to make things work that is more ‘portable’ (i.e. work in other distributions as well).
So for fonts, the most straightforward way I know is to copy the font into your personal directory’s hidden font folder e.g. /home/coder/.fonts
After having done that, the next step is to then make the font available to your applications. This can be done with the command:
fc-cache -fv
That’s all there is to it!
Ever since I’ve started listening to the Security Now podcast, I’ve grown a lot more security- and privacy- conscious (which is a good thing). From the podcast, I’ve learnt that one of the easiest thing you can do to protect yourself on the Internet is to disable cookies by default, and allow only those from domains that you trust to be stored on your computer.
Being a Firefox user, I disabled cookies by default and set up an exception list to allow only hosts that I trust. Over time, this list has grown quite a bit. For whatever reason if I lose this list (either through an upgrade or a different computer), it can be quite inconvenient to redo the list again. Fortunately, I’ve found a way to back up the list.
Tags: tips
From the blog aggregator planetsuse.org, Garrett LeSage posted about using the Compose key to enter different typographical characters such as —, ®, ©, ², ¿, ¡, ÷ etc
Interested? Read his posting to see how it works.
By the way, the post is for Linux only. Enjoy.
Tags: tips