Setting up a development environment in Fedora 18

Useful tools to install

# Editors. You should install both of these.
sudo yum -y install vim-enhanced emacs
sudo yum -y install emacs

# Useful and fun languages.
sudo yum -y install perl ruby
sudo yum -y install ghc                           # Haskell
sudo yum -y install gcc gcc-c++ clang    # You should have two compilers

# Development support tools.
sudo yum -y install perf valgrind

# Source code revision control.
sudo yum -y install git
sudo yum -y install gitg
sudo yum -y install gitk

Bash configuration

Add these lines to your .bashrc file:

# Source global definitions

if [ -f /etc/bashrc ]; then
. /etc/bashrc

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
# ... and add timestamps
export HISTTIMEFORMAT="[%F %T] "

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

PS1="\t(\$?)\W\$ "

if [ "$TERM" != "dumb" ]; then
    # The default color for directories is really hard to see. Change it.
    eval "`dircolors -b | sed s/di=01\;34/di=01\;31/1`"
    alias ls='ls --color=auto'
    alias vi=vim

Update your .emacs file (if you have buffer staleness problems)

I do most of my development work in a Fedora VM. It is hosted on my MacBook Air which is running Mountain Lion. To make the source files visible to the host OS and to other VMs, I keep the files on the host OS filesystem and mount them into the VM(s). This works really well and gives me seamless access to source files no matter which system I am in.

Why do I do this? To guarantee that I'm writing portable source it is good to jump over to different VMs and build the same source. I could do this using separate checkouts into each VM, but I find I tend to lose track of changes I've made if I do it that way.

There's a downside to doing this. Emacs constantly polls files to see if they have been updated on the filesystem. If they have, it prompts you to confirm that you really want to edit your buffer instead of reloading. Because time does not always move linearly in a VM sometimes the VM thinks the host file is newer. When this happens every 5-10 minutes of editing it can get really inconvenient. You can disable this feature in emacs by adding this line to your .emacs file. I don't recommend doing this unless you've run into this precise problem.

  (global-auto-revert-mode t)


Popular posts from this blog

Programming language notes, links

Questions to ask about yourself, your job, your company

Patching VMware Tools in Fedora 18