Command line: VIM

Why am I moving from Visual Studio to VIM?

As I mentioned in my previous post I want to use VIM instead of Visual Studio to work on my logcmd project. This would be a kind of an experiment, but I do have some fair reasons behind that decision. Why do I think VIM is a good alternative to Visual Studio?

Continue reading

Command line, Tips & tricks

Investigating “git log” without mouse

As I’m a huge fun of doing the job using keyboard only, I’ve got addicted to VsVim, vim mode using CapsLock, then git console. Unfortunately there were still some actions that were “uncomfortable” like for example investigating “git log“. In order to copy a part of previous commit message or commit id I had to use both mouse and keyboard. Finally I have figured out that the solution is really simple: pipe the result to vim:

git log | vim --noplugin -

- is to tell vim to read from stdin
--noplugin is used to speed up load time and reset some strange behaviour, but you can live without it I think

As it’s not very short, best to have it as console alias:

doskey gl=git log | vim --noplugin -

Here you have some demo:

gif_im_color_dither_16_20a833df54

My journey to figure it out was not that straightforward, as I thought it should be some feature/plugin to my terminal (ConEmu at home, Console2 at work) – nothing found. Then I tried to use VIM as terminal (using ConqueTerm) but not everything worked there (i.e. Yeoman) and finally git commit opened “vim” inside of console in vim … “Vimception” ]:-)>

Finally we can use the same trick in several other places like
git branch – copy branch name for further use in git checkout
git status – copy file name to add/reset/checkout changes
and more…

Own projects

Challenge accepted: starting ‘logcmd’ – a console logs browser

I know that I was not blogging for a while. The only cheap excuse that comes to my mind is having a second job of begin father of two evils angels. I tried hard several times but stuck without publishing. Because of that I realized that I really need some actuation. And then Maciej Aniserowicz came with his “Daj sie poznac 2016” initiative (or maybe I just got tired of the idea that I will stay inproductive, and keep wathing movies every evening till my children go to university).
I was fighting for a long with the same cheap excuse, but won, and joined 10 mins before the registration was to be closed.

The rule is to blog about some pet project, so here is mine: logcmd. It will be a simple tool to read application logs (from file, console and more) and then search, filter, browse. The idea was born out of the need some time ago, when I searched for some online log4net log browser, because I wanted to filter NHibernate queries from the logfile.
As the subject is not very demanding, I decided to add two cool features on top of that. First, it will be done without Visual Studio but in VIM + OmniSharp (soon I’ll try to explain why, who knows, maybe there will be some live-coding video). Second, the tool itself will also be done as a console application. Why? Because of many reasons:
* console seems to be much closer to developer than another Visual-Log-Studio,
* console application can be easily integrated with tmux/tmux-like plugins or used for automation
* console is more portable than desktop
* I fell in love with the way git interacts with the user in command-line
* I don’t like desktop programming. All the desktop applications that I did in the past just seemed ugly to me.

Did I think about other projects? Sure, but there were some ambitious ones, that would probably die unfinished. There was also JavaScript game “Battlecity” and some Commodore 64 project. Who knows, maybe I’ll get back to them in the interim.

When talking about pet projects, I always have one picture in the back of my mind:

pet-project