【vim配置】.vimrc
【vim配置】.vimrc
set nocompatible set enc=utf-8 "-show line number "set number "-enable filetype plugin filetype plugin on set history=500 syntax on set autoindent set smartindent "-show brackets match set showmatch "-show status set ruler "-close highline match "set nohls "-enable quick search set incsearch "-enable paste mode set paste "set tabstop=4 set ts=4 "set shiftwidth=4 set sw=4 "set expandtab set et if has("autocmd") filetype plugin indent on endif autocmd filetype python setlocal et sta sw=4 sts=4 "-smart append title by file type func SetTitle() if &filetype == ‘sh‘ call setline(1, "\#!/bin/bash") call append(line("."), "\# ") call append(line(".")+1, "") else call setline(1, "\#!/usr/local/bin/python3") call append(line("."), "\# ") call append(line(".")+1, "") endif endfunc autocmd BufNewFile *.py,*.sh exec ":call SetTitle()" "-go to the end of file autocmd BufNewFile * normal G "-press F2 to delete empty line nnoremap <F2> :g/^\s*$/d<CR>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。