vim ale插件

下载flake8
pip install flake8
下载
pip install rstcheck

在vimrc中添加

let g:ale_linters = {'python': ['flake8'], 'reStructuredText': ['rstcheck']}
let g:ale_fixers = {'python': ['remove_trailing_lines', 'trim_whitespace', 'autopep8']}

ale_linters的详细说明

g:ale_linters                                                   
  Type: |Dictionary|
  Default: `{}`

  The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a
  |List| of linter programs to be run when checking particular filetypes.

  This |Dictionary| will be merged with a default dictionary containing the
  following values: >

  {
  \   'csh': ['shell'],
  \   'go': ['gofmt', 'golint', 'go vet'],
  \   'help': [],
  \   'perl': ['perlcritic'],
  \   'python': ['flake8', 'mypy', 'pylint'],
  \   'rust': ['cargo'],
  \   'spec': [],
  \   'text': [],
  \   'zsh': ['shell'],
  \}
<
  This option can be used to enable only a particular set of linters for a
  file. For example, you can enable only `eslint` for JavaScript files: >

  let g:ale_linters = {'javascript': ['eslint']}
<
  If you want to disable all linters for a particular filetype, you can pass
  an empty list of linters as the value: >

  let g:ale_linters = {'javascript': []}
<
  All linters will be run for unspecified filetypes. All available linters can
  be enabled explicitly for a given filetype by passing the string `'all'`,
  instead of a List. >

  let g:ale_linters = {'c': 'all'}
<
  Linters can be configured in each buffer with buffer-local variables. ALE
  will first look for linters for filetypes in the `b:ale_linters` variable,
  then `g:ale_linters`, and then the default Dictionary mentioned above.

  `b:ale_linters` can be set to a List, or the string `'all'`. When linters
  for two different filetypes share the same name, the first linter loaded
  will be used. Any ambiguity can be resolved by using a Dictionary specifying
  which linter to run for which filetype instead. >

  " Use ESLint for the buffer if the filetype includes 'javascript'.
  let b:ale_linters = {'javascript': ['eslint'], 'html': ['tidy']}
  " Use a List for the same setting. This will work in most cases.
  let b:ale_linters = ['eslint', 'tidy']
  " Disable all linters for the buffer.
  let b:ale_linters = []
  " Explicitly enable all available linters for the filetype.
  let b:ale_linters = 'all'
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值