Vim 实现的输入法体验

文接上回,Vim 虽然贵为编辑器之神,有一个没有解决好的问题就是输入中文,以及中英文的切换问题。最近也尝试了一些试图利用 Vim 提供的功能,在 Vim 中实现输入法的插件。本文做一总结点评。

Neovim 输入法模式自动切换设置

Vim/Neovim 下输入中文最大的痛就是需要频繁从中文模式切换到英文模式,来输入 Vim 的各种命令。本文总结在 macOS、Windows 下如何在离开 insert 模式的时候自动切换到英文输入。

Copy from Remote Server to Local Clipboard via OSC 52 in Neovim

In my daily work, I usually log into a remote server via a terminal emulator and do my development work there. Sometimes, I need to copy text from remote server to my local machine’s clipboard. Previously, I use mouse to select and copy the text, which I find to be quite cumbersome.

Concurrent.futures in Python

executor.map() or executor.submit() There are mainly two different ways to use executor for parallel computing, the first is via executor.map(), and the second way is via executor.submit() combined with concurrent.futures.as_completed(). Here is a simple example to demonstrate this: import time from contextlib import contextmanager from concurrent.futures import ThreadPoolExecutor import concurrent.futures @contextmanager def report_time(des): start = time.time() yield end = time.time() print(f"Time for {des}: {end-start}") def square(x): time.sleep(0.5) return x*x def main(): num = 10 with report_time("using executor.

Linux Tips and Tricks -- s3

Calculate the stat of a column of numbers Suppose we have a file where each line a number, and we want to the get stat of these numbers on the command line. Use python If Python is installed in the system, we can use the following command: cat data.log | python3 -c "import fileinput as FI,statistics as STAT; i = [float(l.strip()) for l in FI.input()]; print('min:', min(i), ' max: ', max(i), ' avg: ', STAT.