惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
J
Java Code Geeks
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
L
LangChain Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Martin Fowler
Martin Fowler
月光博客
月光博客
Y
Y Combinator Blog
U
Unit 42
D
Docker
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Louis C Deng's Blog

RoPE: Properties, Patterns, and Long-Context Behavior CS336 Assignment 1: Large Language Model Training and Inference CS231n Lecture Note: Generative Models CS231n Lecture Note: Self-Supervised Learning CS231n Lecture Note: Large Scale Distributed Training 自動微分 | DIY 實現自己的 PyTorch From RNNs to Transformers CS231n Lecture Note VII: Recurrent Neural Networks Uncovering Batch & Layer Normalization CS231n Lecture Note VI: CNN Architectures and Training CS231n Lecture Note V: Convolution Neural Networks Basics Demystifying Softmax Loss: A Step-by-Step Derivation for Linear Classifiers Backpropagation: A Vector Calculus Perspective CS231n Lecture Note IV: Neural Networks and Backpropagation CS231n Lecture Note III: Optimization CS231n Lecture Note II: Linear Classifiers CS231n Lecture Note I: Image Classification CSAPP Cache Lab II: Optimizing Matrix Transposition CSAPP Cache Lab I: Let's simulate a cache memory! CS188 Search Lecture Notes III CS188 Search Lecture Notes II How to Use TouchID for Sudo Commands on macOS CS188 Search Lecture Notes I RECAP2025: 留白 CSAPP Bomb Lab 解析 x64 暫存器速查表 CSAPP Data Lab 解析 矩陣的 Modified Gram Schmidt 方法 聊一聊位掩碼(Bit Mask) 整數溢位與未定義行為
vimrc 配置指南
Louis C Deng · 2020-07-26 · via Louis C Deng's Blog

Vim 即 Vi Improved,它的前身是 Vi。它是一個十分強大的編輯器,優點如下:

  • 不需要滑鼠,純鍵盤
  • Linux 系統預裝
  • 鍵盤命令肌肉記憶之後,效率非常高

但是,它的配置許許多多,讓人難以記住。我正好要在新電腦上配置它,故寫此文。

為什麼不用別人現成的?

  1. 自己的配置更順手,自己更熟悉。
  2. 瞭解 Vim Script,可以自己造外掛
  3. etc.

不會 Vim 怎麼辦

啊這…… 🤣

你可以試著在命令列輸入 vimtutor

vimrc 的位置

本篇文章以新安裝的 vim 為例。Vim 的配置檔案叫做 vimrc。在 Mac、Linux 等系統上,位於 ~/.vimrc。在 Windows 系統中,它叫做 _vimrc,但是同樣位於 Home 目錄中。

全域性的配置,在 Mac、Linux 等系統上,位於 /etc/vimrc。在 Windows 系統上,它儲存在 Vim 安裝目錄,同樣叫做 vimrc

配置

一個什麼也沒有配置的 Vim,開啟可能是這樣的:

image.png

下面各配置,你可以新增自己想要的。以下所有配置都可以在命令模式輸入,臨時啟用或關閉。

基本

1
2
3
4
5
6
7
8
9
set nocompatible 
filetype plugin on
syntax on
set showmode
set showcmd
set mouse=a
set encoding=utf-8
set t_Co=256
filetype indent on

縮排

1
2
3
4
5
set autoindent 
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=2

介面

1
2
3
4
5
6
7
8
9
set number 
set relativenumber
set cursorline
colorscheme default
set wrap
set linebreak
set laststatus=2
set ruler
set showmatch

搜尋

1
2
3
set hlsearch 
set incsearch
set ignorecase

更多

Vim 配置不止這些,我只介紹了一些常用的。Vim Script 值得學習,學完了還可以自己開發外掛。

題外話 - 外掛

外掛管理,Vim 雖然新增了自帶的,但我還是很推薦 Vim-Plug