Skip to content

Instantly share code, notes, and snippets.

Tmux 2004 簡捷配置指引

~/.tmux.conf

source-file ~/.tmux.reset.conf
set-option -g default-terminal 'screen-254color'
set-option -g terminal-overrides ',xterm-256color:RGB'

set-option -g prefix ^A
@AlanJui
AlanJui / _Integrate_copilot_plugin_into_NvChad.md
Last active February 20, 2024 07:34
將 copilot.lua 置入 NvChad ,與之整合。 (Integrate copilot.lua into NvChad.)

在 NvChad 引用 copilot.lua 插件

變更程序

  1. 新增 copilot.lua 設定檔,檔案命名為:copilot.lua,置於目錄路徑:~/.config/nvim/lua/custom/configs/ 下;

  2. 變更客製化的插件設定檔: ~/.config/nvim/lua/custom/plugins.lua 。

-- Plugin Manager: install plugins
-----------------------------------------------------------
local vim = vim
local execute = vim.api.nvim_command
local fn = vim.fn
local package_root = require('utils').get_package_root()
local install_path = require('utils').get_install_path()
local compile_path = require('utils').get_compile_path()
local packer_bootstrap
@AlanJui
AlanJui / sudo_nvim.md
Last active December 4, 2023 04:09
如何令 sudo nvim 亦能正常讀取 Neovim 設定檔

sudo nvim 無法正常讀取設定檔的解決方法

🙋‍ 提問

在 Ubuntu 22.04 作業系統,我的 Home Path 為: /home/alanjui。 Neovim Configuration 設定檔,置於路徑: /home/alanjui/.config/nvim/

當我單獨使用 nvim 指令編輯檔案時,Neovim 可正常自 .config/nvim 讀取得我的 Neovim Coinfiguration ; 但若在 nvim 之前加上 sudo 時,則無法同前正常運作。

@AlanJui
AlanJui / Neovim_Search_and_Replace.md
Last active August 29, 2023 05:48
使用 \v (Very Magic) 模式,可令 Neovim 更換文字作業更形簡化。

正規表達式 Very Magic 模式

前言

在 Neovim 使用正規表達式,進行文字的更換(Search and Replace)作業,幾近無所不能。但正規表達式的撰寫,有時會令人頗為心煩, 因為總要為符合「正規表達表的應用規則」,在某些字元之前補上個 "\" (反斜線),以免正規表達式的解析會「誤解」。可是,補上了反斜線之後,卻導致閱讀不易,使用者的思緒反倒被搞亂了。

在 Neovim 中,使用 \v 前綴可以開啟“very magic”模式的正規表達式。在這種模式下,正則表達式的語法更加簡單和直觀,並且不需要像在默認模式下那樣多次使用反斜線 \ 來轉義特殊字符。

在“very magic”模式下,特殊字符(如 ()[]{}.*+?^$ 等)將被視為元字符,不需要額外的轉義。

近日,每當在 Neovim 使用 neogit 插件,進行檔案變更後納管作業時,總會看到一道「快閃即過」的警示訊息!

由於不具備:一目瞭然,可以速讀的本事,對此一閃即過的警示訊息,我能補捉到的概廓,好像在說:「Neogit 易主了...!」

本想不理,但... 每當想要 commit 變更後的檔案,欲將之存檔時,那道警示便會又再閃現。感覺煩了,今天好好調查一下......

Neogit for Neovim官網

哦~~~!Neovim 可用的 Neogit 插件「搬家」了。

摘要

使用 Neovim ,搭配下述之插件(Plugins),即可令 Markdown 文檔化為:需求分析與 功能設計之文件製作工具。

Neovim 插件

return {
  -- Open URI with your favorite browser from Neovim

摘要

使用 W3C Ruby Tag ,為「漢字」標示河洛話「注音」。

【排版需求】:

版面為漢字自左到右横排;注音顯示有二: (1)方音符號:置於漢字右側; (2)台羅拼音:放在漢字下方。

@AlanJui
AlanJui / gist:0c3cca1db3f4043af00f75128a0ba4a2
Created May 10, 2022 09:23
使用 LaTeX 為漢字標注音範例
\documentclass[]{article}
\usepackage[UTF8]{ctex}
%\usepackage[paperwidth=21cm,paperheight=29.7cm]{geometry}
\usepackage{geometry}
\geometry{a4paper,left=1cm,right=1cm,top=3cm,bottom=3cm}
\usepackage{xeCJK}
\setCJKmainfont{Noto Serif CJK TC}
\setmainfont{AR PL UMing TW}
\usepackage{ruby}
\renewcommand\rubysep{-0.6em}