2026-04-29
VSCode Neovim - Prevent Output Panel from Stealing Focus
2026-04-29 ~ 2026-10-15

The note is generated by Opus-4.7

Problem

When using the vscode-neovim extension, the VSCode Output panel automatically reveals and steals focus from the terminal whenever Neovim logs appear.

Root Cause

In src/messages_manager.ts, the extension calls this.channel.show(true) (which reveals and focuses the Output panel) whenever the number of lines in a Neovim message exceeds cmdheight:

1
2
3
4
5
6
const lineCount = outputMsg.split("\n").length;
const cmdheight = (await this.main.client.getOption("cmdheight")) as number;

if (lineCount > cmdheight) {
  this.channel.show(true);
}
  • cmdheight=0 (default when ext_messages is enabled): every message exceeds 0 lines → Output panel steals focus on every log
  • cmdheight=1: only messages with more than 1 line trigger the Output panel
  • cmdheight=N: only messages exceeding N lines trigger it

Fix

Set cmdheight=1 in the VSCode-specific Neovim config (~/.config/nvim/lua/plugins/vscode.lua):

2025-10-24
Git 配置PAT
2025-10-24 ~ 2025-10-24

The note is partly generated by “ChatGPT.”

The article “Proxy set, but ssh -T git@github.com still fails” explains that Git SSH cannot use an HTTP proxy and provides a solution. However, in my experience, even using that solution, network performance can be unreliable. Therefore, if you can use HTTPS for Git, I recommend switching from SSH to HTTPS directly. Below is the method to switch to HTTPS and configure a Personal Access Token (PAT) for authentication.

2025-10-24
Proxy set, but ssh -T git@github.com fails
2025-10-24 ~ 2026-10-15

The note is generated by ChatGPT.

Observation — Proxy set, but SSH still fails

Although you set http_proxy / https_proxy (or all_proxy), running:

1
ssh -T git@github.com

still times out or fails.

Root cause — SSH does NOT use the HTTP proxy (key point)

Terminal HTTP/SOCKS environment variables affect HTTP/HTTPS-aware programs (curl, wget, git clone https://…, etc.), but OpenSSH does not honor those variables. SSH opens a raw TCP connection and must be explicitly told to use a proxy — otherwise it tries a direct connection and gets blocked by the network/firewall.

2025-10-23
Trash-cli — The Recycle Bin on Linux
2025-10-23 ~ 2025-10-23

📘 Overview

On Linux, the command-line tool trash-cli provides a safe alternative to rm, allowing you to move files to the Trash instead of permanently deleting them.
It fully complies with the FreeDesktop Trash Specification, which is used by desktop environments such as GNOME and KDE.


🧰 Installation

You can install trash-cli using your package manager or Python’s pip:

1
2
3
sudo apt install trash-cli
# or
pip install trash-cli

🚫 Disable rm (for safety)

To avoid accidental permanent deletions, you can override the rm command and display a friendly warning instead.

2025-10-23
Use tmux save-buffer to sync clipboard
2025-10-23 ~ 2026-10-15

The note is generated by ChatGPT.

This note explains how to:

  1. Synchronize text copied in a remote Neovim session with your local clipboard via tmux.
  2. Implement a cpwd command to copy the current working directory of your shell to the local clipboard.
  3. Understand the underlying principle of how tmux buffers bridge remote Neovim and local clipboard.

1. Prerequisites

  • tmux 3.3a+ (supports load-buffer -w)
  • Neovim installed on the remote server

2. Principle: How tmux Buffers Bridge Remote and Local Clipboard

  1. tmux Buffers as an Intermediate Clipboard

2025-10-17
Git配置SSH Key
2025-10-17 ~ 2025-10-17

The note is generated by 豆包.

一、配置目的

通过 SSH Key 实现与远程仓库(GitHub/GitLab/Gitee 等)的无密码安全连接,避免每次操作远程仓库时重复输入账号密码。

二、操作步骤

1. 检查本地是否已存在 SSH Key

首先确认本地是否已有生成好的 SSH Key,避免重复创建。

2025-10-17
Linux上好用的工具
2025-10-17 ~ 2025-10-17
  • linux上的垃圾桶: trash-cli
    1. 安装
      sudo apt install trash-cli
      或
      pip install trash-cli
      
    2. 取消"rm":
      alias rm='echo "
      ⚠️  This is not the command you are looking for.
      

      👉 Please use trash-cli instead. It is safer and provides these commands:

      trash-put / trash → Move files/directories to trash
      trash-empty → Empty the trashcan(s)
      trash-list → List trashed files
      trash-restore → Restore a trashed file
      trash-rm → Remove individual files from trash
      "'

2025-10-06
vscode常用设置
2025-10-06 ~ 2025-10-06

行号设置

VS Code 内置行号有三种模式:

  • "off":不显示行号
  • "on":绝对行号
  • "relative":相对行号
    设置方式(以"relative"为例):
  1. 打开设置(Ctrl + ,)
  2. 搜索 line numbers
  3. 找到 Editor: Line Numbers,选择 relative

或者在 settings.json 里写:

2025-10-06
为Git配置代理
2025-10-06 ~ 2025-10-06

❗️The note is generated by DeepSeek.

🔧 配置 Git 使用 HTTP 代理

您可以通过 Git 命令行来设置全局的 HTTP 和 HTTPS 代理。

  1. 设置全局代理:
    打开终端(例如 Windows 的 Git Bash、macOS 的 Terminal 或 Linux 的 Shell),执行以下命令:

2025-10-06
Inspect Editor Tokens and Scopes
2025-10-06 ~ 2025-10-06

❗️The note is generated by DeepSeek.

Developer: Inspect Editor Tokens and Scopes 是 VSCode 中一个非常实用的开发者工具命令,它可以帮助你深入了解代码在编辑器中的语法标记和范围信息。

🎯 命令用途

这个命令主要用于:

  • 诊断语法高亮问题 - 找出为什么某些代码没有按预期显示颜色
  • 自定义主题配置 - 获取准确的 scope 名称来修改特定语法元素的样式
  • 理解语法结构 - 了解代码如何被解析和标记

🔧 使用方法

  1. 打开命令面板: