PROJET AUTOBLOG


bfontaine.net

Site original : bfontaine.net

⇐ retour index

Mise à jour

Mise à jour de la base de données, veuillez patienter...

How to speed-up Vim’s Command-T plugin

jeudi 4 septembre 2014 à 00:03

Command-T is a wonderful Vim plugin which allows you to open files with a minimal number of keystrokes. It’s really handy in a large codebase where you only have to type <leader>t, then a couple letters and press enter to open your file. It’s based on a fuzzy matching, which let you skip letters without worrying.

I recently installed the plugin on another machine and noticed it was really low: I had to wait a couple seconds to get the files list everytime. My computer has 8GB RAM so the problem wasn’t there.

The solution is pretty simple: the plugin relies on a C extension which I forgot to compile after the installation.

From the docs:

cd ~/.vim/bundle/command-t/ruby/command-t
ruby extconf.rb
make

It’ll make the plugin incredibly faster. This step is easy to miss if you read the docs too quickly. I wrote this blog post to remember this, I hope it might help a couple others since I didn’t find anything on Google about this issue.

How to speed-up Vim’s Command-T plugin

jeudi 4 septembre 2014 à 00:03

Command-T is a wonderful Vim plugin which allows you to open files with a minimal number of keystrokes. It’s really handy in a large codebase where you only have to type <leader>t, then a couple letters and press enter to open your file. It’s based on a fuzzy matching, which let you skip letters without worrying.

I recently installed the plugin on another machine and noticed it was really low: I had to wait a couple seconds to get the files list everytime. My computer has 8GB RAM so the problem wasn’t there.

The solution is pretty simple: the plugin relies on a C extension which I forgot to compile after the installation.

From the docs:

cd ~/.vim/bundle/command-t/ruby/command-t
ruby extconf.rb
make

It’ll make the plugin incredibly faster. This step is easy to miss if you read the docs too quickly. I wrote this blog post to remember this, I hope it might help a couple others since I didn’t find anything on Google about this issue.

How to speed-up Vim’s Command-T plugin

jeudi 4 septembre 2014 à 00:03

Command-T is a wonderful Vim plugin which allows you to open files with a minimal number of keystrokes. It’s really handy in a large codebase where you only have to type <leader>t, then a couple letters and press enter to open your file. It’s based on a fuzzy matching, which let you skip letters without worrying.

I recently installed the plugin on another machine and noticed it was really low: I had to wait a couple seconds to get the files list everytime. My computer has 8GB RAM so the problem wasn’t there.

The solution is pretty simple: the plugin relies on a C extension which I forgot to compile after the installation.

From the docs:

cd ~/.vim/bundle/command-t/ruby/command-t
ruby extconf.rb
make

It’ll make the plugin incredibly faster. This step is easy to miss if you read the docs too quickly. I wrote this blog post to remember this, I hope it might help a couple others since I didn’t find anything on Google about this issue.

How to remember the difference between conj and cons in Clojure

dimanche 25 mai 2014 à 22:06

When I started writing Clojure, I couldn’t memorize the difference between conj and cons and always used one instead of the another. Their name are similar, but cons is used to add an element at the beginning of a vector, while conj is used to add an element at the end of it. How can one memorize this? I found a mnemonic trick over the time that helps me remember this. Here is it:

The trick is to look at the last letter of each function, s and j. As shown in the image below, the s of cons shows the right, while the j of conj shows the left.

This means that cons pushes elements from the left to the right, that is, at the beginning of a vector. conj, on the other hand, pushes elements from the right to the left, which is at the end of a vector. That’s it. Once you see this in your head, you’ll never forget the difference between cons and conj on a vector.

How to remember the difference between conj and cons in Clojure

dimanche 25 mai 2014 à 22:06

When I started writing Clojure, I couldn’t memorize the difference between conj and cons and always used one instead of the another. Their name are similar, but cons is used to add an element at the beginning of a vector, while conj is used to add an element at the end of it. How can one memorize this? I found a mnemonic trick over the time that helps me remember this. Here is it:

The trick is to look at the last letter of each function, s and j. As shown in the image below, the s of cons shows the right, while the j of conj shows the left.

This means that cons pushes elements from the left to the right, that is, at the beginning of a vector. conj, on the other hand, pushes elements from the right to the left, which is at the end of a vector. That’s it. Once you see this in your head, you’ll never forget the difference between cons and conj on a vector.