Some tips for iTerm

I just installed iTerm and I'm quite enthusiast. It's not easy to configure, but it has everything needed.

Cool prompt, with iTerm dynamic title

I don't like the default prompt provided in OSX. So I want the more familiar (for ubuntuers) "user@hostname:/current/work/dir$" path. The following one also keeps the terminal title updated with the current work directory. Which is very useful if you use tabs. Put those lines in your ~/.profile file:

PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[00m\]\$ '

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac
Done. This should work also for other Unixes.

Move to next/previous word in iTerm with ALT+Left/Right

I wanted the ALT+Left and ALT+Right combination to move the cursor to next and previous word. So these are the steps:

  1. Menu>Bookmarks>Manage Profiles
  2. Select Keybard>Global
  3. add opt-num-cursor left to send escape sequence ^[b (on the text field you have to type just "b", as the ^[ is added automatically)
  4. add opt-num-cursor right to send escape sequence ^[f ("f" for the textfield)
Done.

Replacing Dock Icons with yours

I don't like the default icon for iTerm. I saw a better one on iTerm website:

iTerm icon
So I discovered how to change the application icon.
  1. Open the icon you want with Preview, then press CMD+C to copy it into the clipboard. A png file is fine.
  2. Find the application in Finder, for instance, from the Dock right-click on the iTerm icon and select "Show in Finder"
  3. Right click on the application and select "Get Info". Or just press CMD+I. A file information window should pop up then.
  4. On the top of the Info window, there's a little icon next to the application name and file size. Click on that icon, and press CMD+V, to paste the new icon as replacement.
Done. Now quit the application (CMD+Q) if it is running, and relaunch it to let the Dock reload the new icon.


No Responses to “Some tips for iTerm”  

  1. No Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

February 2009
M T W T F S S
« Jan   Mar »
 1
2345678
9101112131415
16171819202122
232425262728  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening