Index syndication
comment syndication

Archive for apps

Switching to multi-line mode using Textmate Regex

So you have a pattern you want to match across multiple lines, and you have a regular expression that matches it.
You will probably be used to doing this in perl like this:
/some.+?stuff/s
or using regex in ruby like this:
/some.+?stuff/m
However you have just started to get used to Textmate as an editor and you see it supports regex matching. Why though does it not use /s or /m for multi-line dot matching? The reason is that Textmate uses the Oniguruma regular expression library. Oniguruma requires switching to multi-line mode by using an extended group (?m:) so the dot matches the new line as well. So our pattern would be:
(?m:some.+?stuff)
Essentially doing this turns multi-line on for the sub-expression, being some.+?stuff
Make sense? I thought not. Read on about Textmate Regex for more information.

Wordpress iPhone Application

A quick one today, but worthy of note is the upcoming now out Wordpress iPhone Application.
This means an update of techdebug.com is on the cards…

You can read about it on the dedicated iPhone page.

via TUAW

Textmate Posting Hiccup

Forgive my triple Post Hiccup. When Textmate posted my blog posts, I got errors.
Thinking the post had not completed, I retried until I figured out the problem.
If you use Wordpress V2.3 and post with Textmate, then don’t try to add a new category when posting an article. You get this problem:

  Fatal error: Cannot use object of type WP_Error as array in wp-includes/taxonomy.php on line 1010

Looks like I am not the only one.

Vim Split tips

I use vim a lot of the time, mostly with splits and diffs, so the following key mappings and functions really helped me with managing the split windows. Maybe they will help you too. (Thanks to the Vim tips wiki for these).

  • If you use vertical splits, this will help move left and right across the split. Put in your ~/.vimrc
    " Map multi window keys
    set wmw=0
    " CTRL-H move to left window
    nmap <c-h> <c-w>h<c-w><bar>
    " CTRL-L move to right window
    nmap <c-l> <c-w>l<c-w><bar>
    
  • When scrolling up and down a window, you can use zz to jump the current line to the middle of the window. If you want this on always ala Scroll locking, then you can use this function. It is a toggle option. use \zz to toggle it. Put in your ~/.vimrc
    " Map \zz to lock scroll to middle of window
    map <Leader>zz :let &scrolloff=999-&scrolloff<CR>
    
  • In a window split (of any sort) if you want to maximise to the current window, this will do it for you. When you press CTRL-W then o it will maximise the current view, then when pressed again will return your split arrangement! Put in your ~/.vimrc
    " Max/unmax splits
    nnoremap <C-W>O :call MaximizeToggle ()<CR>
    nnoremap <C-W>o :call MaximizeToggle ()<CR>
    nnoremap <C-W><C-O> :call MaximizeToggle ()<CR>
     
    function! MaximizeToggle()
      if exists("s:maximize_session")
        exec "source " . s:maximize_session
        call delete(s:maximize_session)
        unlet s:maximize_session
        let &hidden=s:maximize_hidden_save
        unlet s:maximize_hidden_save
      else
        let s:maximize_hidden_save = &hidden
        let s:maximize_session = tempname()
        set hidden
        exec "mksession! " . s:maximize_session
        only
      endif
    Endfunction
    
Technorati Tags: , , , ,

eReader Pro now free for Palm

I use eReader on my Palm, but only for free documents and not often enough to warrant paying for it.
eReader Pro Now that is no longer required. As I noticed at the downloadsquad, eReader Pro for Palm and Windows mobile devices is now being offered for free.

If you would like your own copy for Palm (or windows mobile) you can download it from the ereader website.

Next entries »