Archive

Posts Tagged ‘config’

My vimperator settings

January 6, 2011 1 comment

Update (20110502): This post was updated for Vimperator 3.1. Copy/paste is corrected in this new version, thus the plugin mswin.vimp is not needed anymore. I removed that part from the post.

Vimperator is a Firefox browser extension with strong inspiration from the Vim text editor, with a mind towards faster and more efficient browsing. It has similar key bindings and you could call it a modal web browser, as key bindings differ according to which mode you are in. For example, it has a special Hint mode, where you can follow links easily with the keyboard only. Also most functionality is available as commands, typing :back will go back within the current page history, just like hitting the back button in the toolbar.” (source)

Vimperator is a very useful Firefox add-on. When I reinstall a system, this is one of the first add-ons that I need to install in order to be able to work efficiently :)

Here are my config files:

Useful commands:

To tell the truth, I only use a very small subset of the features offered by Vimperator. Here are my favourites:

  • ESC (hitting the ESC key => enter command mode)
  • j, k (Scroll down and up. To memorize: j looks like a down arrow.)
  • r (reload the page)
  • o URL (open URL in the current tab)
  • t URL (open URL in a focused new tab)
  • T URL (Open URL in an unfocused new tab. This is a custom feature added to my config file.)
  • / SEARCH_TERM (Vim-like, case-insensitive incremental search. Pressing n you can jump to the next the search hit.)
  • d (close the current tab)
  • u (Restore a closed tab. Can be used repeatedly to restore several closed tabs.)
  • :res (Restart the browser. It’ll restore the tab set.)
  • gu (From the current URL, remove the part after the last ‘/’. Example: http://www.mozilla.com/en-US/firefox/central/ becomes http://www.mozilla.com/en-US/firefox/)
  • gU (In the current URL, leave the host name only. Example: http://www.mozilla.com/en-US/firefox/central/ becomes http://www.mozilla.com/)
  • gg (jump to the top of the page)
  • G (jump to the end of the page)
  • y (copy the current URL to the clipboard)
  • ALT+y (Copy page title to the clipboard. This is a custom feature added to my config file.)
  • Shortcuts; I just love them. You have a favourite site, say http://slashdot.org/, and you want to assign an alias to this site, for instance “sd”. Then, you’d like to open this site by using the command “:o sd“. To this end, visit the site (here http://slashdot.org/), and assign a bookamark to it by “:bma -k=sd“. From now on, “sd” is associated to http://slashdot.org/. You can type “sd” in the address bar too.

If you know some cool tips, please share with us in the comments.

Configure Midnight Commander to open files with custom application

December 8, 2010 7 comments

Problem

You use Midnight Commander (mc) for all your file operations. So far it’s not a problem :) However, when you hit Enter on a file, you would like to set what application mc should use for opening the given file.

For instance, you want to open an .avi file with VLC instead of X player, etc.

Solution

Steps to follow:

cd ~/.mc
cp /etc/mc/mc.ext .
ln -s mc.ext bindings

That is, copy the global mc.ext to your local .mc directory and put a symbolic link on it called bindings. Now you can start customizing your local mc.ext file.

Don’t forget to restart mc after editing mc.ext!

Examples:

(1) You want to open all your video files with VLC. You also want to add support for .wmv files.

# add these lines
regex/\.([wW][mM][vV])$
    Include=video

# modify the include/video section
include/video
    #Open=(mplayer %f >/dev/null 2>&1 &)   # for mplayer
    Open=(vlc %f >/dev/null 2>&1 &)   # for VLC

(2) Open .docx files with OpenOffice.org.

# add these lines
regex/\.([Dd][oO][cC][xX])$
    Open=(ooffice %f &)

(Thanks for the mc mailing list for their help).

Categories: ubuntu Tags: , , , ,

My .vimrc settings

November 19, 2010 Leave a comment

Here is my VIM config file: download. I didn’t paste it here since it’s quite long and contains some special characters. After download you will have to rename it; in the header of the file it is explained.

Links

Categories: ubuntu Tags: , , ,

My .bashrc settings

November 7, 2010 Leave a comment

After installing Ubuntu, it’s a good idea to customize your .bashrc file a bit. Just append your modifications to the end of the default file that is located at ~/.bashrc.

Here is my basic extension:

#############################################################################
# Jabba's extension
#############################################################################
umask 077

EDITOR=/usr/bin/vim
export EDITOR

alias md='mkdir'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias d='ls -al'
alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
alias run='chmod u+x'
alias cpc='CWD_LAC="`pwd`"'
alias cdc='cd "$CWD_LAC"'
alias rid='chmod 644'
alias ridd='chmod 755'
alias gq='gqview &'
alias tailf='tail -f'
alias cls='clear'
alias nh='nautilus . 2>/dev/null'
alias gt='gthumb &'
alias p='cls; python'
alias th='echo "cls; cd `pwd`"'
alias kr='krusader &'
alias kill9='kill -9'

/usr/games/fortune | /usr/games/cowthink

For the last line to work you will have to install two extra packages:

sudo apt-get install fortune-mod cowsay

Then every time you open a terminal, a cute cow will be waiting for you with some wise stuff.

Categories: bash Tags: , ,

My mplayer settings

November 7, 2010 Leave a comment

To customize mplayer, modify the file ~/.mplayer/config. Every time you launch mplayer, settings are read from this file. Reduce command-line arguments and put them in this file.

Here is my config file:

# Write your default config options here!

# Font
font=/home/jabba/.mplayer/fonts/comic.ttf

fs = "1"
#subfont-text-scale = "3"
subfont-text-scale = "4"
#subfont-text-scale = "5"
subcp = "iso-8859-2"
#aspect="4:3"
#aspect="16:9"

# audio output: ALSA
# PulseAudio caused a problem in Jaunty 9.04 beta
ao=alsa

# video driver
vo=xv

# Find subtitle files (1: load all subs containing movie name)
sub-fuzziness=1

# Font encoding
subfont-encoding=unicode

# Subtitle file encoding
utf8=yes

# Resample the font alphamap (10: bold black outline)
ffactor=10

# Font size (2: proportional to movie width)
subfont-autoscale=2

# Font blur radius (default: 2)
subfont-blur=1.0

# font outline thickness (default: 2)
subfont-outline=1.0

For subtitles I use the Comic font. Download it somewhere and specify its absolute path. Videos start in fullscreen (fs). Previously I had some problems with the accents in Hungarian subtitles but with subcp I managed to solve it. The other settings are mainly for the subtitles.

Categories: ubuntu Tags: , ,
Follow

Get every new post delivered to your Inbox.

Join 73 other followers