Thursday, January 29, 2009

Vim - basics - copy-paste

Useful shortcuts for Vim beginners: 

mark text 
v ... start highlighting text 
+y ... end highlighting text 

d ... cut 
P ... P-paste above cursor 
p ... paste below 

u ... undo 
Ctrl+R ... redo 
source: source web 
other: other web 
Vim macro for copy-paste with Ctrl+C and Ctrl+W: abclinuxu.cz (Czech version)

VI shourtcuts:

Go to
Shift g    = end of file
gg    = start beginning of file
GG    = start of file
:22    = go to line 22
0 = start of line
^ = first letter on line
$ = end of line

Copy to buffer
:t.    = duplicate line
:t7 = copy line after line 7

yy = copy current line
ayy = copy current line to buffer a
a5yy = copy 5 lines into buffer a

Paste from buffer
y7yp = copy and paste 7 lines
p = paste line
ap = paste buffer a at the cursor


Search
n = search next
N = search previous
* = go to next occurrence of word under cursor
# = go to previous occurence

Less shortcuts

NoHup
# Nohup process id pid :
nohup my_command > my.log 2>&1 &
echo $! > save_pid.txt

Monday, January 12, 2009

No sound in Flash under Linux

Problem description:
Using Debian or Ubuntu Linux, I experienced problem with no sound
using Flash player in Firefox.

Solution:
# apt-get install alsa-oss

Details:
alsa-oss package creates interface between Alsa sound libraries and OSS libraries. Latest systems usually support Alsa drivers while Flash requires OSS. This package interconnects both of them to play together.

Sunday, January 11, 2009

Firefox default browser in Linux

How to set Firefox as default browser for Thunderbird and other applications in Debian or Ubuntu Linux?


System wide default
Define Firefox as system wide default web browser by running:
update-alternatives --config x-www-browser


KDE4 default
To use Firefox as default in the KDE4, you must open:
Desktop Settings / Personalised Settings -> Default Applications -> Web Browser ->

or in latest KDE open:
System Settings / Default Applications -> Web Browser ->

check: 'in the following browser'
set value: /usr/bin/firefox


Thunderbird default
In Thunderbird open menu:
Edit / Preferences / Advanced / General / Config Editor

Change Filter to:
network.protocol-handler.app.

Add or modify existing preferences. Double click specific preference for modification or,
if preference is not in list, right click to empty area and choose: New -> String

Insert key name: network.protocol-handler.app.ftp
Value: /etc/alternatives/x-www-browser

Insert key name: network.protocol-handler.app.http
Value: /etc/alternatives/x-www-browser

Insert key name: network.protocol-handler.app.https
Value: /etc/alternatives/x-www-browser


Edit Thunderbird config directly
Optionaly you can edit your Thunderbird config directly.
Thunderbird preferences file: ~/.thunderbird/*.default/prefs.js


Note
If you have not selected your default browser, you can replace string /etc/alternatives/x-www-browser by /usr/bin/firefox (with appropriate path)

Keywords: thunderbird url open
Source: novell.com