Archive for the ‘vim’ Tag

“Hello Butt” in Python   Leave a comment

My wife is not a programmer. She is also not a techie, nor is she at all interested in such things. She likes her computer to let her surf facebook, play Bejeweled and make pretty pictures in PhotoShop, but that’s about it.

And of course, thanks to her disinterest, I have a strong fascination with tricking her into doing technical stuff. Like tonight when, in a sleep haze, I told her I had something I needed her to help me with.

Her: “What do you need me to do?”

Me: “Open up terminal.”

Her: “What’s a terminal?”

Me: “It’s an application in your Utilities folder… ya the black one.”

Her: “Now what?”

Me: “Do you have a folder you just throw lots of junk files in?”

Her: “You mean like my temp folder?”

Me: *grinning with pride*
Me: “Yes, exactly. Change your directory to it.”

Her: “Wha… how… how do I do that?”

“Me: Type cd and the directory… wait cd **space** and the director… wait no it’s case-sensitive… ok good.”

Her: “Now what?”

“Me: Type vi space susan.py.”

Her: “What the fuck is this thing?”

Me: “A text editor. Hit i. Ok now you can type… no not yet. Type what I tell you.”

Her: “Ok, what do I type?”

Me: “Type myvar.. all one word… space equals sign space… and then ummm..”

Her: “What else do I type?”

Me: “I don’t know, whatever you want, but put quote marks around it.”

Her: *click click click click*

Me: “I guess that works…”

Me: “Okay, now hit enter and type while parenthesis uppercase-T, then the rest in lower case, true, then end paren and a colon…. Nice!”

Me: “Now enter, hit space 4 times… now type print parenthesis myvar close paren enter”

Her: “Now what?”

Me: “Hit escape, and type upper-case ZZ… no, both z’s are upper-case”.

Me: “Alright, now type python space sus… you can hit tab to complete the word. nice. ok now hit enter”

butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
butt
^C

The end.

Posted December 24, 2010 by Rob Ciaccio in Python

Tagged with , , ,

Shifting from a Windows to Unix-Centric Coding Mentality   Leave a comment

I found the following post by Phil on Apple.StackExchange intriguing. Phil is struggling with moving his development environment from Windows to OS X:

I’m having trouble finding a coding environment that is comfortable and I’m hoping anyone has had the same problem. On my windows box at the office I’ve found my ideal coding environment that I really dig. VS2010 or Eclipse, Notepad++, WinScp, Fireftp is often everything I need.

On my macbook pro however, I’ve not yet found that environment that just says “click”.

It struck a chord with me in that I went through a very similar experience when I first started working on my Mac. Here’s an excerpt from my answer, you can read the full text by clicking through:

I was in a huge programming rut before I started using my mac, but I’m finding that being forced to look at my process and tools in a different way is really bringing out talents and interests I didn’t know I had before. I’m coding in python and c++ rather than javascript and c#, in one of the oldest editors in existence, and I’m loving it.

Multi-Platform vimrc Using Dropbox   2 comments

I’ve been using vim in place of notepad++ and fraise with greater frequency lately. It’s quite a hassle to maintain vim settings on two different platforms in a consistent enough way that the settings are identical. Yesterday I decided to fix that.

I run a local subversion server at home for versioning my free-time projects and other documents. I store my working copies of the repository in a folder inside my Dropbox. What I decided to do was run a WinMerge diff/merge with my OS X .vimrc and my Windows _vimrc files. Everything that was common to both files, I merged right, then saved to a new text file called ‘vimrc_common’. So afterwards, I was left with 3 relatively similar files, .vimrc, _vimrc, and vimrc_common.

After checking in the changes, it was a simple task to remove the script that was now in common from the two original files, leaving only the platform specific stuff. I added a line to each of the original files that sources the common file at its path on the respective OS, and voila, no more vimrc duplication!

vim-editor_logo

Posted December 9, 2010 by Rob Ciaccio in Software, Vim

Tagged with , , , , ,