forked from physcxia/hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
79 lines (63 loc) · 1.68 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
" .vimrc file
" Author: Xia Chen , ThinkPositive0x0
" Email: [email protected] , [email protected]
" Manage plugins with vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'davidhalter/jedi-vim'
Plug 'octol/vim-cpp-enhanced-highlight'
" Plug 'lervag/vimtex'
" Plug 'vim-latex/vim-latex'
" Plug 'WolfgangMehner/c-support'
call plug#end()
" End of vim-plug
syntax on
set modifiable
set nocompatible
set encoding=utf-8
set fenc=utf-8 "编码
set nu
set ruler
set tabstop=4
set shiftwidth=4
set autoindent
set smarttab
set smartindent
set expandtab
set showmatch "显示匹配的括号
set showcmd
set hlsearch "搜索高亮
set showmode
set mouse=a
let g:tex_flavor='latex'
" Set leader
" let mapleader = "`"
" Maps
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <C-s> :write<cr>
inoremap jk <esc>
cnoremap <expr> %% getcmdtype( ) == ':' ? expand('%:h').'/' : '%%'
autocmd FileType makefile setlocal noexpandtab
au BufNewFile,BufRead *.py "
\ set tabstop=4 "tab宽度
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79 "行最大宽度
\ set expandtab "tab替换为空格键
\ set autoindent "自动缩进
\ set fileformat=unix "保存文件格式
map <F5> :call RunPython()<CR>
func! RunPython()
exec "W"
if &filetype == 'python'
exec "!time python3 %"
endif
endfunc