November 2008

Edit GMail messages using Vim

Ok, why would you want to do this ?

Because you can.

1) Install this add-on which allows you to edit text areas in firefox using an external editor:

https://addons.mozilla.org/en-US/firefox/addon/4125

2) Install VIM

ftp://ftp.vim.org/pub/vim/pc/gvim72.exe

3) Setup the plugin to use vim (addOns->its all text addon->options)

4) make sure gmail is using “plain text” as editing - otherwise its not a text area, but some mad iframe.

6) Happy Days!

sysadmin
bash

Comments (0)

Permalink

Navigate Backwards and forwards in Visual Studio

This should have been obvious but it took me about 15mins of googling to find. Which is funny as the menu items seem to be quite obviously on display under the “View” menu!

Anyway in Eclipse you do CTRL+LEFT_ARROW, CTRL+RIGHT_ARROW which is particularly useful if you have just jumped to the declaration of a method so you can go back to where you were.

In Visual studio the equivalent is CTRL+- (thats control and the minus key together) to go forwards, its CTRL+SHIFT+- (shift plus minus).

I have now re-mapped these to CTRL+ALT+LEFT_ARROW and CTRL+ALT+RIGHT_ARROW.

You map in Tools->Options->Keyboard its a bit tricky to find stuff they are called View.NavigateForwards and View.NavigateBackwards. You can discover these by just typing in the box at the bottom and it will show you what they are assigned to.

ides

Comments (0)

Permalink

Read in a list of files and loop over them in bash

Needed to do this and after a bit of looking around (Bash scripting) came up with this:


#!/bin/bash

FILE_LIST_SOURCE=listoffiles.txt
DEFAULT_FILE="some.default.file"

[ -f $FILE_LIST_SOURCE ] && LIST_OF_FILES=$(cat $FILE_LIST_SOURCE)

LIST_OF_FILES=${LIST_OF_FILES:-$DEFAULT_FILE}

#echo -e "\nLIST_OF_FILES:\n$LIST_OF_FILES"

echo "List of files:"
for i in $LIST_OF_FILES; do
    echo $i
done


sysadmin
bash

Comments (0)

Permalink