\0

Mind fragmentation at its finest

7/31/2011

I'm lazy and I don't want my hand to jump from keyboard to mouse multiple times for a simple task

Tiling window managers just make sense. They make my workflow faster and smoother with minimum fuss especially if I have to navigate out of emacs to another application.

Recently though, I've explored Eclipse to try out the new functionalities of the ADT plugin. Eclipse's workflow is mouse oriented, even with the Emacs+ plugin. Some functionalities like switching perspectives have keyboard shortcuts which makes transitioning from text editing to viewing DDMS output a lot smoother, but navigating through most of the panes and tabs are painful without using the mouse. Also, Eclipse spawns a lot of floating windows which contain a lot of gui controls that are also a pain to navigate without the mouse. Closing these floating windows are what irritates me the most when I'm on a tiling window manager because my hand needs to navigate from the mouse back to the keyboard to press the kill window keybinding. This is because the usual gui controls for window management are not present when using a tiling window manager, but I've seen configurations that includes those sorts of gui controls. Right now though, I have decided to give Gnome 3 a try. The first thing I did is to rebind the workspace and window control commands to become somewhat like what I'm used to.

This led me to the realization that I'm not really using the tiling feature of tiling WMs to their full potential. Most of the time, I configure the tiling WM to put certain apps to their own workspace because it I prefer to jump to a particular workspace number rather than navigating a stack of unrelated window tiles. In fact, ever since I used emacs, I rarely even tile windows because emacs itself can do split buffers, and most of the apps that I use are inside emacs. The good thing is, emacs doesn't force me to use the mouse. Switching between buffers, tiles, and workspaces is seamless especially with StumpWM's, or even with Xmonad's out of the box configuration.

For a couple of years now, I've tried to maintain a keyboard oriented workflow. Firefox, another app that I heavily use, usually breaks this workflow not until I have installed the Vimperator plugin. Eclipse seems to break this workflow more often though. If there's a way to navigate Eclipse's numerous panes just like the way I navigate tiles, I'll definitely sign up. Or maybe I should just reconfigure my tiling WM to make it easier to deal with floating windows. Some apps simply take away the fun out of tiling window managers. Oh well, C'est la vie.

3/10/2011

Icicles - Yes, they kinda look like fingers

Is ten fingers really enough to become a productive coder? I don't think so. Are there ways to compensate for our general lack (in my opinion) of fingers? Lots! TAB key, at yer service!

As programmers, we generally like to lessen the amount of typing that we do. Most text environments offer TAB completion, whether it be your shell or your IDE. Even though I hate the TAB character with a passion (yes, I do belong to the spaces camp of the tabs vs spaces war), I do like the TAB key very much. In fact, the TAB key is my favorite key.

Emacs has a multitude of ways to make you love that TAB key of yours even more than you currently do, and if you don't, then you will definitely learn to love it. In this post though, I'll share you my thoughts about Icicles.

At first, I was daunted by the number of Icicles stuff that I have to put on my .emacs. This helped me decide to opt for Ido for my buffer/file completion tool instead. As my usage of emacs grew heavier and heavier, I opted for WinRing as my emacs "window manager". This led me to the discovery that Ido does not support (or perhaps I just don't know how to do it) completion when switching between window configurations. This discovery helped me gain the courage to try out Icicles.

Icicles is well documented in the emacs wiki. Even though I haven't really talked to its developers, I find them as smart and friendly guys who really cares about their users. You'll understand what I'm talking about once you took a peek on their newbie friendly introduction.

Icicles supports all kinds of minibuffer completion. It even completes commands when you're in shell mode, and even file/directory names in shell mode! For instance you have a file named "foo_foo_bar_foo_foo.baz" in your pwd and you want to perform some operation on it. You can type, for instance, mv bar[SHIFT+TAB] and it will expand to "foo_foo_bar_foo_foo.baz" if the string "bar" is unique within your current directory. If not, you will then be presented with a list of possible completions. You can cycle through this list or type some more to make the list of possible completions narrower. This kind of completion is actually called apropos completion. If you know regex, apropos is like ".*?string.*". If you know SQL, apropos is like "LIKE %string%". You get the idea.

As a previous Ido user, I came to like fuzzy completion a lot. Icicles provides this through scatter completion. You can change the mode of completion by pressing M-(. Yes, Icicles supports multiple modes of completion, but the two modes previously mentioned are generally enough for me.

Of course, Icicles is not yet the perfect (altough it nearly is) minibuffer completion mechanism for emacs. I do use shell mode a lot and I have several shell scripts which contains function definitions which I invoke by sourcing the script in my shell and typing in the name of the function ala 'insert your usual shell command here'. Icicles' list of possible completions does not include functions from sourced shell scripts. Or maybe I just don't know how to configure it to do so? If you do know how, though, please tell me.

2/15/2011

My Emacs window-manager of choice: WinRing

My previous post briefly discusses vim's tab support and emacs' lack thereof. Of course I was wrong because you can extend emacs to have its own window-manager! There are actually numerous choices for a window manager, but I chose WinRing since it supports named "tabs" and is reported to be lightweight.

ECB is the primary reason why I want to have gnu screen-like behavior in emacs. This allows me to have separate views of different window configurations. ECB supports several window managers by providing a variable that defines which window configuration it should activate. This is exactly the bahaviour I want since I do not want to display certain buffers with ECB activated, and I particularly dislike having to deactivate and reactivate it depending on the current buffer I'm on.

My discovery of this led to another: Ido does not support switching between different window-configurations. While its support for buffer and file switching is great, it does not go anywhere beyond that. This led me to a more generalized minibuffer completion extension, Icicles, which I'll talk about in another post.

2/05/2011

Emacs buffers and tabs

Emacs buffers are a convenient way to have multiple files open at once. It is also very convenient to switch from different buffers especially if you have ido-mode enabled. Some consider buffers as the Emacs equivalent to tabs, but I kind of disagree.

If you have used Vim, you might be familiar in the way it handles tabs. For instance: in one tab you might have a two windows open, vertically split, each containing a different buffer of its own; and in another tab you have two windows open, horizontally split, each containing a a different buffer of its own.

In this way, tabs become more like views. It's more of something like a window manager's workspaces. I came to miss this functionality in Emacs, or maybe I still don't know how to do it. Perhaps the latter is true.

1/23/2011

Emacs and Vim: My observations so far

It's been a month of using emacs, and I'm enjoying it so far. However, I'm still using the vim+eclim combo at work. The day I use emacs at work is coming near though. It's funny how I rush to get home and mess around with emacs after my day job.

I recently came across this article of a guy who saw this article which are basically articles that explain why they use or chose to use emacs. The former article summarizes the paradigms of both editors, and I would say that what he said is so true. Vim got me real close to my shell. The shell is my IDE of sorts, and GNU screen is an integral part of this IDE, and familiarization with common unix tools is mandatory. Most of the time, I cook up small scripts to automate tedious tasks that vim does not do for me. For example, I have a scripts that build and deploy my project, invoke rest calls and generate logs of which calls passed/failed, clunky refactoring through sed, etc. Maybe someday I'll make a screencast of my current workflow and put it somewhere. It's not really amazing, but I think it's worth sharing.

Emacs is the other way around. I run a shell inside of it, instead of running it in a shell. This allows me to leverage emacs keybindings to execute commands in the shell and copy output from it, which is my favorite feature so far. I can also that in my current setup but it involves GNU screen keybindings which are very much unlike vim keybindings.

There's someone who said that emacs is designed to be a hub for all GNU tools, though I don't remember where I saw that. It's true that whenever I'm using emacs, I feel that I'm CTRLing a command center. Pun intended.

P.S. The latter article is really helpful. Kudos!

1/01/2011

The return to Emacs

I am a Vim user for about 3 years now, but I initially used Emacs before I used Vim. I did not really like Vim when I was still at the stage of choosing which religion to take. How do I get into Vim then? Well, it was forced during my internship. We were working with a Japanese client who just won't allow us to have local copies of the source code. Thus, we have to ssh into his remote machine to edit the code using whatever editor the host has. And there were a lot of editors there but Vim was the only serious thing.

It was hell at first. It's like being forced to wear clothes you don't like to wear. The more I learn about it though, the more I began to like it. I really like how you can chain commands in Vim whether it be a movement or a search command. Heck, search commands are considered movement commands in Vim! Replace until foo? ct/foo<RET>

Three years using Vim taught me a lot about it. I started using different plugins after the first year. NERDTree and TagList are almost mandatory. Almost all the jobs I've been in use Eclipse, and then there's eclim to help me get away with it. Vim can also be customized via vimrc, and I put a lot of BufEnter/BufLeave autocmds there to suit my needs. Not to mention some custom keymappings here and there.

At my third year of using Vim, I began advocating it to my friends and co-workers. I was once assigned to train some fresh-grads in my workplace and I taught them how to use Vim. Guess what? They didn't even spend a week with it. I'm not surprised.

And then I did some sort of a manual file cleanup. I found my old copy of emacs manuscripts hanging around somewhere in my home directory. I felt nostalgic. Guess I'll be staying with Emacs for a while. I just hope emacs-eclim works fine as I need it for my day job.

Creative Commons LicenseMind Fragmentation at its finest by Evan Dale is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.