I learned to use VIM at the university to administrate linux systems and to develop C++ apps. Then I moved to Java and I enjoyed using an IDE like Netbeans. When I started to play with Ruby and Rails I kept using Netbeans as my editor of choice as it plays very well with them.
As I was bored with “Up arrow key, End key, Enter key” instead of “O” to insert a new line above my cursor and I wanted to play again with this so old but still alive editor, I installed the plugins: rails.vim (just great), haml syntax highlight (I ♡ haml) and irblack color scheme (more Textmate like).
With rails.vim, you get just great shortcuts to browse your rails source file. Type :Rmodel your_model_name to edit your model source file — :Rcontroller, :Rview, :Rmigration, :Rjavascript, :Rstylesheet… work too! It also includes :A (jump to alternate file) and :R (jump to relative file) commands. :A switches between source code and corresponding spec file, :R jumps from model to migration file. The most amazing combo: :AV to open up the alternative file (your spec file usually) in a vertical split window.
I finish up with the two commands I learned to use and love.1) Type ma to “mark” your cursor position as ‘a’ then type 'a to get back to this position. 2) Use qa to record a macro in ‘a’, press q again to stop recording. Then @a to replay it. Using commands to jump to next word / end of line / next something character it can be much faster than making a substitution using regexp or so.
Move your Ubuntu system to another computer in 3 simple steps
You just got a brand new machine but you won’t like to spend hours tuning it to get the same configuration as the one you have used for years?
Let’s transfer your Ubuntu configuration and applications to your new computer in three simple steps.
This method is cross-architecture. I moved successfully my configuration and applications from an Ubuntu 9.04 32bit to a 64bit one.
Prerequisites:
The same version of Ubuntu is installed on both machines. The architecture (32/64 bit) can be different.
Step 1: Store the list of installed packages
Run the following command on the source machine to store the installed packages names in
~/pkglist:sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglistStep 2: Transfer your config
Use
scporrsyncor even a flash drive to transfer your home directory (~/*,~/.*), the source list (/etc/apt/sources.list) and any other files you customized or installed (like apache config under/etcor softwares on/opt) from the source machine to the target one.Step 3: Install packages
On the target machine run the following command in a failsafe terminal session to install your packages:
sudo aptitude update && sudo aptitude install `xargs ~/pkglist`That’s all folks!
Log into your new machine and keep working as if you were using the previous one.