Tag Archives: vim

Meet the “It’s All Text!” Firefox extension

Yes, I’m a vim addicted. I mean vim the text editor. I’m so addicted to it that I tend to use vim’s shortcuts even in LibreOffice documents, thunderbird e-mails, web forms etc. with awful results.

Then I found It’s All Text, a Firefox extension which saved my web experience when editing long textareas.

It’s really simple: it puts an overlay “edit” button beside each textarea which is visible only when overing it. When you click it, your preferred editor will come up filled of the text of the textarea. Now you can make your edits, close it and boom, the text is in the textarea.

Wonderful.

For me it’s a productivity boost.

I use it everywhere, like now, I’m writing this blog post in my preferred editor.

The nerd tip

There a deeper tip I use: I’m opening vim from a gnome-terminal.

I created a bash script under my $HOME/bin directory with this name editor-for-it-s-all-text.sh and which content is

#!/bin/bash
/usr/bin/gnome-terminal --full-screen -e "vim '$1'"

Then I configured “It’s All Text” to use that editor and now I use my beloved vim in a full screen terminal window.

Awesome.

Detect Markdown files in vim

Quick tip which force vim to recognize .md files as Markdown formatted files:

  • create, if not exists, the needed directory
    mkdir -p ~/.vim/ftdetect/
    
  • create the file ~/.vim/ftdetect/markdown.vim with this content
    autocmd BufNewFile,BufRead *.md,*.mkdn,*.markdown :set filetype=markdown
    

Done.

Android

How to compile Android SDK samples

Recently I came across a Stackoverflow question about sample code in Android SDK.
The user was asking how to import code in an Eclipse project.

I’m not using Eclipse in my Android projects so I answered with command line instructions. My development environment is based on vim and bash.

My answer was a bit off topic, but can be useful to someone else.

Let’s presume you want to compile LunarLander sample.
You need to copy the directory recursively to a new path and work on it with the android command:
$ cp -r $ANDROID_SDK/samples/android-15/LunarLander .
$ android update project --path LunarLander/ --target 3 --subprojects
$ cd LunarLander/
$ ant debug install

You have to check the targets available to your system with the following command:
$ android list targets

References