Then Notes 隨筆

Vim 操作筆記

.vimrc

" Highlight
syntax on

" 行號
set number
set relativenumber

" 搜尋
set hlsearch
set incsearch " 漸進搜尋,不用按 enter 才開始
set ignorecase " 忽略大小寫
set smartcase

" Tab / Space
set expandtab " tab to space
set tabstop=4
set shiftwidth=4

" Filetype
filetype on
filetype plugin on
filetype indent on

" ESC delay
set timeoutlen=1000 ttimeoutlen=0

nnoremap <F5> :%y+<CR> " F5 yank all lines to clipboard

選取

選取到第一次出現某個字元

選取一個單詞

選取到最上方 / 最下方

選取前一段 / 後一段

選取一整行

複製 / 貼上

複製一個單詞

複製一整行 / 複製多行

複製到句首 / 句尾

複製到最上方 / 最下方

重複貼上

插入

刪除

刪除一整行 / 刪除多行

刪除到句尾

刪除到最上方 / 最下方

刪除並進入插入模式

用法與 dD 相同

註解

多行註解

取消多行註解

儲存並離開