mirror of
https://github.com/amix/vimrc
synced 2025-07-09 10:45:00 +08:00
Use sources_non_forked folder for pathogen path, with sources_non_forked_fallback folder as fallback.
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2017-2021, Maxim Baz
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@ -1,122 +0,0 @@
|
||||
# lightline-ale
|
||||
|
||||
This plugin provides [ALE](https://github.com/w0rp/ale) indicator for the [lightline](https://github.com/itchyny/lightline.vim) vim plugin.
|
||||
|
||||

|
||||
|
||||
## Table Of Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Integration](#integration)
|
||||
- [Configuration](#configuration)
|
||||
- [License](#license)
|
||||
|
||||
## Installation
|
||||
|
||||
Install using a plugin manager of your choice, for example:
|
||||
|
||||
```viml
|
||||
call dein#add('dense-analysis/ale') " Dependency: linter
|
||||
call dein#add('itchyny/lightline.vim') " Dependency: status line
|
||||
call dein#add('maximbaz/lightline-ale')
|
||||
```
|
||||
|
||||
## Integration
|
||||
|
||||
1. Register the components:
|
||||
|
||||
```viml
|
||||
let g:lightline = {}
|
||||
|
||||
let g:lightline.component_expand = {
|
||||
\ 'linter_checking': 'lightline#ale#checking',
|
||||
\ 'linter_infos': 'lightline#ale#infos',
|
||||
\ 'linter_warnings': 'lightline#ale#warnings',
|
||||
\ 'linter_errors': 'lightline#ale#errors',
|
||||
\ 'linter_ok': 'lightline#ale#ok',
|
||||
\ }
|
||||
```
|
||||
|
||||
2. Set color to the components:
|
||||
|
||||
```viml
|
||||
let g:lightline.component_type = {
|
||||
\ 'linter_checking': 'right',
|
||||
\ 'linter_infos': 'right',
|
||||
\ 'linter_warnings': 'warning',
|
||||
\ 'linter_errors': 'error',
|
||||
\ 'linter_ok': 'right',
|
||||
\ }
|
||||
```
|
||||
|
||||
3. Add the components to the lightline, for example to the right side:
|
||||
|
||||
```viml
|
||||
let g:lightline.active = { 'right': [[ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ]] }
|
||||
```
|
||||
|
||||
3.1. Lineinfo, fileformat, etc. have to be added additionaly. Final example:
|
||||
|
||||
```viml
|
||||
let g:lightline.active = {
|
||||
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ],
|
||||
\ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'fileformat', 'fileencoding', 'filetype'] ] }
|
||||
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
##### `g:lightline#ale#indicator_checking`
|
||||
|
||||
The indicator to use when ALE is in progress. Default is `Linting...`.
|
||||
|
||||
##### `g:lightline#ale#indicator_infos`
|
||||
|
||||
The indicator to use when there are infos. Default is `I:`.
|
||||
|
||||
##### `g:lightline#ale#indicator_warnings`
|
||||
|
||||
The indicator to use when there are warnings. Default is `W:`.
|
||||
|
||||
##### `g:lightline#ale#indicator_errors`
|
||||
|
||||
The indicator to use when there are errors. Default is `E:`.
|
||||
|
||||
##### `g:lightline#ale#indicator_ok`
|
||||
|
||||
The indicator to use when there are no warnings or errors. Default is `OK`.
|
||||
|
||||
### Using icons as indicators
|
||||
|
||||
If you would like to replace the default indicators with symbols like on the screenshot, then you'll need to ensure you have some "iconic fonts" installed, such as [Font Awesome](https://fontawesome.com). A common alternative is to replace your primary font with one of the [Patched Nerd Fonts](https://github.com/ryanoasis/nerd-fonts), which saves you from having to install multiple fonts.
|
||||
|
||||
The following icons from the Font Awesome font are used in the screenshot:
|
||||
|
||||
- Checking: [f110](https://fontawesome.com/icons/spinner)
|
||||
- Infos: [f129](https://fontawesome.com/icons/info)
|
||||
- Warnings: [f071](https://fontawesome.com/icons/exclamation-triangle)
|
||||
- Errors: [f05e](https://fontawesome.com/icons/ban)
|
||||
- OK: [f00c](https://fontawesome.com/icons/check) (although I prefer to disable this component)
|
||||
|
||||
To specify icons in the configuration, use their unicode codes as `"\uXXXX"` (make sure to wrap them in double quotes). Alternatively copy the icons from a font website, or type <kbd>\<C-v\>u\<4-digit-unicode\></kbd> or <kbd>\<C-v\>U\<8-digit-unicode\></kbd> to insert the literal characters.
|
||||
|
||||
See the code points here:
|
||||
|
||||
- Font Awesome: https://fontawesome.com/icons
|
||||
- Nerd Fonts: https://github.com/ryanoasis/nerd-fonts#glyph-sets
|
||||
|
||||
Here's the configuration snippet used in the screenshot:
|
||||
|
||||
```viml
|
||||
let g:lightline#ale#indicator_checking = "\uf110"
|
||||
let g:lightline#ale#indicator_infos = "\uf129"
|
||||
let g:lightline#ale#indicator_warnings = "\uf071"
|
||||
let g:lightline#ale#indicator_errors = "\uf05e"
|
||||
let g:lightline#ale#indicator_ok = "\uf00c"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Released under the [ISC License](LICENSE)
|
@ -1,58 +0,0 @@
|
||||
let s:indicator_infos = get(g:, 'lightline#ale#indicator_infos', 'I: ')
|
||||
let s:indicator_warnings = get(g:, 'lightline#ale#indicator_warnings', 'W: ')
|
||||
let s:indicator_errors = get(g:, 'lightline#ale#indicator_errors', 'E: ')
|
||||
let s:indicator_ok = get(g:, 'lightline#ale#indicator_ok', 'OK')
|
||||
let s:indicator_checking = get(g:, 'lightline#ale#indicator_checking', 'Linting...')
|
||||
|
||||
|
||||
""""""""""""""""""""""
|
||||
" Lightline components
|
||||
|
||||
function! lightline#ale#infos() abort
|
||||
if !lightline#ale#linted()
|
||||
return ''
|
||||
endif
|
||||
let l:counts = ale#statusline#Count(bufnr(''))
|
||||
return l:counts.info == 0 ? '' : printf(s:indicator_infos . '%d', l:counts.info)
|
||||
endfunction
|
||||
|
||||
function! lightline#ale#warnings() abort
|
||||
if !lightline#ale#linted()
|
||||
return ''
|
||||
endif
|
||||
let l:counts = ale#statusline#Count(bufnr(''))
|
||||
let l:all_warnings = l:counts.warning + l:counts.style_warning
|
||||
return l:all_warnings == 0 ? '' : printf(s:indicator_warnings . '%d', all_warnings)
|
||||
endfunction
|
||||
|
||||
function! lightline#ale#errors() abort
|
||||
if !lightline#ale#linted()
|
||||
return ''
|
||||
endif
|
||||
let l:counts = ale#statusline#Count(bufnr(''))
|
||||
let l:all_errors = l:counts.error + l:counts.style_error
|
||||
return l:all_errors == 0 ? '' : printf(s:indicator_errors . '%d', all_errors)
|
||||
endfunction
|
||||
|
||||
function! lightline#ale#ok() abort
|
||||
if !lightline#ale#linted()
|
||||
return ''
|
||||
endif
|
||||
let l:counts = ale#statusline#Count(bufnr(''))
|
||||
return l:counts.total == 0 ? s:indicator_ok : ''
|
||||
endfunction
|
||||
|
||||
function! lightline#ale#checking() abort
|
||||
return ale#engine#IsCheckingBuffer(bufnr('')) ? s:indicator_checking : ''
|
||||
endfunction
|
||||
|
||||
|
||||
""""""""""""""""""
|
||||
" Helper functions
|
||||
|
||||
function! lightline#ale#linted() abort
|
||||
return get(g:, 'ale_enabled', 0) == 1
|
||||
\ && getbufvar(bufnr(''), 'ale_enabled', 1)
|
||||
\ && getbufvar(bufnr(''), 'ale_linted', 0) > 0
|
||||
\ && ale#engine#IsCheckingBuffer(bufnr('')) == 0
|
||||
endfunction
|
@ -1,6 +0,0 @@
|
||||
augroup lightline#ale
|
||||
autocmd!
|
||||
autocmd User ALEJobStarted call lightline#update()
|
||||
autocmd User ALELintPost call lightline#update()
|
||||
autocmd User ALEFixPost call lightline#update()
|
||||
augroup END
|
Binary file not shown.
Before Width: | Height: | Size: 47 KiB |
Reference in New Issue
Block a user