Posts

An Hour Well Spent

I spent a bout an hour at the office today getting my F6 mapped to to a vimscript function that tidies up the whitespace in my code.

Usually I map F6 to trim trailing whitespace, and F7 to replace tabs with spaces.

inoremap <F6> %s/\s+$//g <CR>
inoremap <F7> %s/\<TAB>//g <CR>
But today I decided that I was going to combine those two into a single TidyWS() vimscript function.

It turns out getting this to work cleanly was more challenging than I expected.

Long story short, here's how I did it.


function! TidyWS() letl:save=winsaveview() silent! %s/\s+$//g silent! %s/\<Tab>//g callwinrestview(l:save) echo"whitespace tidied" endfunction
nnoremap<F6> :call TidyWS()<CR>

Blue Falls Drive

Image
The city of Chula Vista finally replaced this sign for the nth time.  Why anyone would name a street, only one block away from a community college, "Blue Falls" is beyond me; it probably won't be too much longer, till once again, some young pirates turn the "F" into a "B".

Backdoor Visitor

Image

The Safe Bet in Todays Economy?

Image

Multimedia message

Image

Election Time

Image
Who to vote for? I think I'll just write myself in!

door stop

Image
so it turns out that this makes a great door stop!