jueves, 11 de octubre de 2018

staging hunks without magit

So there's magit that allows you to stage hunks as if you were doing "git add -p".  And I love it, but sometimes magit feels like too much, and it's slower than using vc.

I've been using git-gutter for some time, and I think there's a nice potential for staging hunks with it.

(use-package git-gutter
  :ensure t
  :config (global-git-gutter-mode t)
  :bind ("C-x v s" .  git-gutter:stage-hunk)
  ("C-x v n" .  git-gutter:next-hunk)
  ("C-x v p" .  git-gutter:previous-hunk))

With these configs (I'm using use-package), you can navigate through hunks with c-x v n/p (I'm basing the keybinds on vc "c-x v" ones) and stage them with "c-x v s". 

I'm pretty happy with those, only missing the ability of staging several hunks at once within a region.

viernes, 5 de octubre de 2018

kill-ring-max is a thing

So I recently discovered the variable `kill-ring-max', that dictates the size of the kill-ring, meaning when items on the kill-ring will be discarded.  Its original value is 60, and for some reason I still had it set to the default.

It's strange that I hadn't seen it mentioned before (at least, enough times to pay attention to it,) so let's try to increase the awareness of this very useful variable.

If you use helm-show-kill-ring, or something that allows you to search through kill-ring, having a bigger kill-ring might allow you to recover s"lost" work.

martes, 11 de septiembre de 2018

The Algernon Argument

From Here:
That intelligence (g) in healthy people is nearly impossible to improve is clear from the failure of psychology to provide any such method. But why intelligence would be so constant is not as clear: many other cognitive abilities are improvable (like working memory), so why not intelligence?

domingo, 12 de agosto de 2018

Adopting org-gcal.el

I just wanted to announce that I recently adopted org-gcal.

This great emacs mode imports google calendar events to your org files, and has some support for exporting events to your google calendars.

The author went missing in action for more than a year, and there were some nasty bugs in master that made the initial experience quite disappointing. Most of the bugs had Pull Requests opened, but still pending to be merged. So I decided to adopt the package to give it some love, and since last week, the melpa link points to my repo instead of @myuhe's.

Big props to the original author and also the many users of the module that helped with the migration.

If you use org-gcal, my recommendation is to update the package, and it will only improve your experience. There's an ongoing big refactoring that uses oauth2.el to manage all the tokens and oauth, but it still have issues that I haven't figured out how to solve in an elegant way.
Of course, if you have suggestions (or even better, code) for org-gcal, please direct them to https://github.com/kidd/org-gcal.el .

miércoles, 25 de julio de 2018

meta git-tip-of-the-day

curl https://raw.githubusercontent.com/git-tips/tips/master/tips.json |
     jq 'map([.title, .tip] | join(" --> ")) | join("\n")' -j | 
     shuf -n1

jueves, 28 de junio de 2018

TIL: dabbrev-expand in zsh

So just by chance I found that M-/ does a kind of dabbrev-expand in zsh.

And it took me a few seconds to realize that shouldn't happen in that context.

Or should it?

What's for sure is this is one of the coolest things you'll learn today about zsh.