-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
82 lines (71 loc) · 2.1 KB
/
vimrc
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
set encoding=utf-8
set ruler
set rnu
set number
" 结尾统一换行符
set fileformat=dos
set showmode
" 自适应不同语言的智能缩进
filetype indent on
" 将制表符扩展为空格
set expandtab
" 设置编辑时制表符占用空格数
set tabstop=4
" 设置格式化时制表符占用空格数
set shiftwidth=4
" 让 vim 把连续数量的空格视为一个制表符
set softtabstop=4
" 高亮显示搜索结果
set hlsearch
" 设置默认进行大小写不敏感查找
set ignorecase
" 如果有一个大写字母,则切换到大小写敏感查找
set smartcase
" 设置延迟渲染
set lazyredraw
" 一些需要强制渲染的场景https://github.com/tpope/vim-sensible/issues/78
autocmd VimEnter * redraw!
filetype on
set autoread
" 开启语法高亮功能
syntax enable
" 允许用指定语法高亮配色方案替换默认方案
syntax on
source ~/.myvim/install.vim
"##### auto fcitx ###########
let g:input_toggle = 0
function! Fcitx2en()
let s:input_status = system("fcitx-remote")
if s:input_status == 2
let g:input_toggle = 1
let l:a = system("fcitx-remote -c")
endif
endfunction
function! Fcitx2zh()
let s:input_status = system("fcitx-remote")
if s:input_status != 2 && g:input_toggle == 1
let l:a = system("fcitx-remote -o")
let g:input_toggle = 0
endif
endfunction
set timeoutlen=300 ttimeoutlen=0
" 退出插入模式
autocmd InsertLeave * call Fcitx2en()
"进入插入模式
autocmd InsertEnter * call Fcitx2zh()
"##### auto fcitx end ######
" 自动到达上一次打开的位置
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g'\"" | endif
" 当前行高亮的方案
set cursorline
highlight CursorLine cterm=NONE guibg=#222222
" check for and load file changes
autocmd WinEnter,BufWinEnter,FocusGained * checktime
" disable swapfile to avoid errors on load
set noswapfile
set guifont=DejaVuSansMono\ Nerd\ Font\ Mono:20
let g:neovide_refresh_rate=60
let g:neovide_fullscreen=v:true
let g:neovide_cursor_animation_length=0.05
let g:neovide_cursor_antialiasing=v:true
autocmd FileType json syntax match Comment +\/\/.\+$+