Skip to content

Commit

Permalink
识别 pyx 文件
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanghy committed Jul 20, 2020
1 parent ea72694 commit 3f89172
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions vim-pro/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ set clipboard+=unnamed
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter * match ExtraWhitespace /\s\+$\| \+\ze\t\+\|\t\+\zs \+/

" 识别 Python 文件类型
autocmd BufRead,BufNewFile *.py,*.pyx set filetype=python


" 快捷打开并编辑 vimrc 文件的键盘绑定====================================
" 命令模式输入 \ee 打开 .vimrc 配置文件
Expand Down Expand Up @@ -254,9 +257,9 @@ function HeaderPython()
endf

if filereadable(expand("~/.vim/skeleton/skeleton.local.py"))
autocmd bufnewfile *.py 0r ~/.vim/skeleton/skeleton.local.py
autocmd bufnewfile *.py,*.pyx 0r ~/.vim/skeleton/skeleton.local.py
else
autocmd bufnewfile *.py call HeaderPython()
autocmd bufnewfile *.py,*.pyx call HeaderPython()
endif
"------------------------------------------------ end ---------------------

Expand Down
9 changes: 6 additions & 3 deletions vimrc-mini
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ set lazyredraw
set ttyfast

" 高亮行和列
set cursorline "突出显示当前行"
"set cursorcolumn "突出显示当前列"
set cursorline "突出显示当前行
"set cursorcolumn "突出显示当前列

" 设置字体
set guifont=Monaco:h12:cANSI
Expand Down Expand Up @@ -121,6 +121,9 @@ imap <> <><ESC>
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter * match ExtraWhitespace /\s\+$\| \+\ze\t\+\|\t\+\zs \+/

" 识别 Python 文件类型
autocmd BufRead,BufNewFile *.py,*.pyx set filetype=python


"==========================================================================
" 快捷键映射
Expand Down Expand Up @@ -166,7 +169,7 @@ function HeaderPython()
normal o
endf

autocmd bufnewfile *.py call HeaderPython()
autocmd bufnewfile *.py,*.pyx call HeaderPython()
"------------------------------------------------ end ---------------------


Expand Down

0 comments on commit 3f89172

Please sign in to comment.