# Introduction

Sometimes, we want an in-momery jpg or png image that is represented as binary data. But often, what we have got is image in numpy ndarray or PIL Image format. In this post, I describe how to convert numpy image or PIL Image object to binary data without saving the underlying image.

# Introduction

One key spirit of Vim is to accomplish something in as fewer key strokes as possible. When you repeat a command a few times in order to perform an action, you need to ask yourself if there is a better way to do it. Only in this way, can you make progress in mastering Vim. For example, when your want to delete five lines of texts, if you press dd five times, you are certainly doing it the wrong way. After looking up the Vim manual, you know that you can use 5dd or d4j: you only need three keystrokes instead of ten!

The other day, I saw a post in a forum asking for help on how to quickly move the cursor inside a buffer. After using Neovim for nearly a year, I would like to share what I have learnt about fast movement and navigation inside Neovim/Vim.

Recently, I was bitten by the unintuitive behaviour of glob.glob() and I think it would be beneficial to write down what I have found.

In this post, I want to share how to use bindkeys command to solve a few issues when using Zsh.

6.18 快到了，加上在家里使用的 IKBC C87 青轴声音太大，敲击费力，所以动了换一把更加静音，触发力度更小的键盘的心思。在京东和淘宝上入手了多款键盘试用，不得不说，一把好的键盘真的是难选啊。自从去年双十一入手了一把 Leopold 红轴键盘以后，其他的键盘真的很难入我的眼睛了。试用过的几把键盘以及感受如下：

Over the past few years, I have been using some dedicated note-taking software to take my notes. But all these tools I have tried are either slow or do not work well when I want to search some notes. Finally, I decided to take my notes in Markdown and convert them to PDF for reading.

# Introduction

Suppose that we have the following text in normal mode (cursor is indicated by |):

|hello world

if we use dw, we delete hello<Space>1 and only world is left; if we use de, hello is deleted and <Space>world is left. Have you ever wondered about why dw do not delete w while de will delete the o in hello? It seems that the motion e and w are somewhat inconsistent. It turns out that this has something to do with the exclusivity of motions in Vim.

This is the series 3 of my blog posts about some nifty techniques of using Nvim. For other series, see

Currently I am writing all my Python code using Neovim and a couple of plugins to provide auto-completion, linting, etc.

Neovim has powerful ability in editing texts. But if you are in a browser and want to input some text, can we somehow utilize the editing power of Vim? In this post, I would like to share several ways to use Vim or Vim-like editing when you are working inside a browser.

Many normal mode commands accept a count, which means to repeat the motion count times. For example, 3j moves the cursor 3 lines below the current line and 4w will move the cursor four words forward. Usually, the user-defined mappings can not take a count. Even if they can, they will most probably not work the way you expect them to. In this post, I will describe what I have learned to make a fairly complex mapping repeatable with a count.

In this post, I want to talk about how to enable built-in spell check in Nvim.

Some words are hard to type, it is handy if Neovim can provide auto-completion for the words we are typing. We can achieve word completion in Neovim in two ways.

# Introduction

I have been using Vim-airline for a while to customize my statusline. We can change the theme used for statusline with the many themes available in vim-airline-themes. Not all these themes looks good since it depends on the background color you use for Neovim and certainly your aesthetics.

I only use a handful of themes myself and I change my themes when I feel bored with one theme. It occurs to me that I can write a simple script to randomly pick a theme from my favorite list1. It turns out writing such a script is not easy for Neovim newbies like me.

In this post, I would like to share how I end up achieving what I want by mixing Vim script and Python script.

This is the series 2 of the nifty Nvim techniques.

• For series 1, see here.

If you have used Sublime Text before, you may be familiar with the snippet function. Snippets let you input a trigger word and expand the trigger to some boilerplate code or string you do not want to repeat each time. You will increase your efficiency dramatically with the help of snippets.