Tag: vim

3 Posts

Configure Vim on Linux Mint 20.03
This is just a simple record. About the configuring process on Windows, here is another blog. Version Info Vi IMproved 8.1 (2018 May 18) Huge version with GTK3 GUI. .vimrc[ref]无插件Vim配置文件vimrc推荐与各VIM配置项解释[/ref] " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by " the call to :runtime you can find below. If you wish to change any of those " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim " will be overwritten everytime an upgrade of the vim packages is performed. " It is recommended to make changes after sourcing debian.vim since it alters " the value of the 'compatible' option. runtime! debian.vim " Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc. " This happens after /etc/vim/vimrc(.local) are loaded, so it will override " any settings in these files. " If you don't want that to happen, uncomment the below line to prevent " defaults.vim from being loaded. let g:skip_defaults_vim = 1 " Uncomment the next line to make Vim more Vi-compatible " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible'…
Vim Commands Memo
Move cursor h and l : Left and Right.k and j : Up and Down. Basic Edit i: enter insert mode, cursor is before the highlighted character. a: enter insert mode, cursor is after the highlighted character. :wq: save and quit.:q!: quit and do not save. Delete and Undo x: delete the current highlighted character. d: delete. Its basic format is d <number> <motion>. motion:w: move cursor to the next word's first letter.e: move cursor to the current word's last letter.$: move cursor to the end of this line. then Delete Operation:dw: delete until cursor get to the first letter of the next character.d2e: do {delete until deleted the end of the current letter} twice.... ...dd: delete the whole line (and put it into the register). u: undo.U: undo all the operations to this line.<Ctrl>+R: redo. Paste and Change p: add things in register after the current cursor.r<char>: keep in normal mode, replace the current character with <char>. c: change. It has the same format with d.cw: delete from cursor to the end of this…
Vim Configure Process Recording
Version Info gVim version 8.1.1 8.2.0577 for Windows Initialize[ref]无插件Vim配置文件vimrc推荐与各VIM配置项解释[/ref] First add these lines to _vimrc. set nocompatible set autoread set shortmess=atI set magic set title set nobackup set noerrorbells set visualbell t_vb= set t_vb= set timeoutlen=500 set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1 set fileformats=unix,dos,mac set termencoding=utf-8 set formatoptions+=m set formatoptions+=B set guifont=Source\ Code\ Pro:h14 set ruler set number set nowrap set showcmd set showmode set showmatch set matchtime=2 set hlsearch set incsearch set ignorecase set smartcase set expandtab set smarttab set shiftround set autoindent smartindent shiftround set shiftwidth=4 set tabstop=4 set softtabstop=4 set cursorcolumn set cursorline filetype on syntax on set foldmethod=syntax set nofoldenable Install Theme: Solarized[ref]15个著名的Vim配色方案整理-Vim入门教程(7)[/ref] [github author="altercation" project="vim-colors-solarized"][/github] Download theme and unpack *.zip. Add Solarized.vim to /Vim/vim81/color directory.Then add this line to _vimrc. colorscheme Solarized now theme already installed Install Vim-plug package manager[ref]Vim轻量高效插件管理神器vim-plug介绍-Vim插件(9)[/ref][ref]如何安装 Vim 插件[/ref] Install Vim-plug First download the plug.vim and put it into the /autoload directory. I find there's already a plug.vim. Maybe it's built-in at Vim ver. 8.1. Add these lines to _vimrc. call plug#begin('D:\Program\ Files\ (x86)\Vim\vim81\pack') call plug#end() Restart Vim. An error indication:…