公告:魔扣目录网为广大站长提供免费收录网站服务,提交前请做好本站友链:【 网站目录:https://www.morko.net 】, 免友链快审服务(50元/站),

点击这里在线咨询客服
新站提交
  • 网站:51998
  • 待审:31
  • 小程序:12
  • 文章:1030137
  • 会员:747

首先,打开电脑终端并执行以下命令安装Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

更多关于Homebrew, 大家可以访问官网:https://brew.sh/

安装Vim:

brew install vim

安装Vim插件:Vundle

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

如果您的电脑上还没安装git就先执行以下命令安装:

brew install git

创建.vimrc文件于根目录

touch ~/.vimrc

将以下这些代码复制并粘贴至刚刚创建的.vimrc文件中的最顶部

set nocompatible              " required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" ...

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

然后运行:

:PluginInstall

之后您就可以以此类推安装各种各样的插件了,

此文不能将所有插件一一列出,但可推荐对于Python开发非常有用的一些。

分屏布局:

横屏命令:

:sp <文件名>
Vim与Python的天作之合macOS配置

 

竖屏命令:

:vs <文件名>
Vim与Python的天作之合macOS配置

 

可设置分屏为向下或向右分:

set splitbelow
set splitright

代码伸缩功能:(详情:https://vim.fandom.com/wiki/Folding)

set foldmethod=indent
set foldlevel=99

用空格键快速执行伸缩命令:

" Enable folding with the spacebar
nnoremap <space> za

准确伸缩插件:

Plugin 'tmhedberg/SimpylFold'

添加之后执行安装命令:

:PluginInstall

添加可见代码伸缩:

let g:SimpylFold_docstring_preview=1

支持UTF-8

set encoding=utf-8

PEP 8规范查看:

Plugin 'nvie/vim-flake8'

美化代码:

let python_highlight_all=1
syntax on

编辑器主题:

Plugin 'morhetz/gruvbox'

文件浏览:

Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
let NERDTreeIgnore=['.pyc$', '~$'] "ignore files in NERDTree

超级搜索:

Plugin 'kien/ctrlp.vim'

Git集成

Plugin 'tpope/vim-fugitive'

状态条

Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}

如果您嫌烦,直接访问以下地址粘贴复制设置即可:

https://github.com/wangold/vim-config/blob/master/vimrc

分享到:
标签:Python
用户无头像

网友整理

注册时间:

网站:5 个   小程序:0 个  文章:12 篇

  • 51998

    网站

  • 12

    小程序

  • 1030137

    文章

  • 747

    会员

赶快注册账号,推广您的网站吧!
最新入驻小程序

数独大挑战2018-06-03

数独一种数学游戏,玩家需要根据9

答题星2018-06-03

您可以通过答题星轻松地创建试卷

全阶人生考试2018-06-03

各种考试题,题库,初中,高中,大学四六

运动步数有氧达人2018-06-03

记录运动步数,积累氧气值。还可偷

每日养生app2018-06-03

每日养生,天天健康

体育训练成绩评定2018-06-03

通用课目体育训练成绩评定