-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.vim
More file actions
102 lines (90 loc) · 2.4 KB
/
basic.vim
File metadata and controls
102 lines (90 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
" Close Vi-compatibility.
set nocompatible
" Disable the default Vim startup message.
set shortmess+=I
" Enable mouse support.
" set mouse+=a
" Syntax highlighting, use one half theme
syntax on
set t_Co=256
set background=light
" 突出显示当前行
set cursorline
" Light scheme
colorscheme onehalflight
let g:airline_theme='onehalflight'
" Dark scheme
" colorscheme onehalfdark
" let g:airline_theme='onehalfdark'
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" Load indentation rules and plugins.
filetype plugin indent on
" Show relative line numbers.
set number
" set relativenumber
" 打开状态栏标尺
set ruler
" 设定命令行的行数为 1
set cmdheight=1
" 显示状态栏 (默认值为 1, 无法显示状态栏)
set laststatus=2
" 设置在状态行显示的信息
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ Ln\ %l,\ Col\ %c/%L%)
" 搜索时高亮显示被找到的文本
set hlsearch
" Enable searching as you type, rather than waiting till you press enter.
set incsearch
" Show matching brackets.
set showmatch
" Do case insensitive matching.
set ignorecase
" Do smart case matching.
set smartcase
" 短暂跳转到匹配括号的时间
set matchtime=2
" 设置魔术
set magic
" Hide buffers when they are abandoned.
set hidden
" 当buffer被丢弃的时候隐藏它
set bufhidden=hide
" 不要生成swap文件
setlocal noswapfile
" 设定 << 和 >> 命令移动时的宽度为 4
set shiftwidth=4
" 使得按退格键时可以一次删掉 4 个空格
set softtabstop=4
" 设定 tab 长度为 4
set tabstop=4
" 把插入的 tab 字符替换成tabstop的空格
set expandtab
" 开启新行时使用智能自动缩进
set smartindent
" 不设定在插入状态无法用退格键和 Delete 键删除回车符
set backspace=indent,eol,start
" 自动切换当前目录为当前文件所在的目录
set autochdir
" 关闭错误信息响铃
set noerrorbells
" 关闭使用可视响铃代替呼叫
set novisualbell
" 置空错误铃声的终端代码
set t_vb=
" 开始折叠
set foldenable
" 设置语法折叠
set foldmethod=syntax
" 设置折叠区域的宽度
set foldcolumn=0
" 设置折叠层数为 1
setlocal foldlevel=1
" set the menu & the message to English
set langmenu=en_US
let $LANG='en_US'
" open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright