├── .gitattributes
├── .gitignore
├── README.md
├── autoload
└── lightline
│ ├── colorscheme
│ ├── nord_improved.vim
│ └── solarized_improved.vim
│ └── delphinus
│ ├── colorscheme
│ ├── nord_improved.vim
│ └── solarized_improved.vim
│ └── components.vim
├── bin
└── dump.py
├── demo.gif
└── plugin
└── lightline_delphinus.vim
/.gitattributes:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim:fenc=utf-8 ff=unix
3 |
4 | # git system files
5 | .gitattributes eol=lf
6 | # gitignore contains Icon^M <- CRLF end
7 | # skip autocrlf,diff enable -> not binary, set -text
8 | .gitignore -text
9 |
10 | # EOF
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### https://raw.github.com/github/gitignore/c1b7904af6689bd01646f008b0561d4f19a0e972/Global/macOS.gitignore
2 |
3 | # General
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must end with two \r
9 | Icon
10 |
11 | # Thumbnails
12 | ._*
13 |
14 | # Files that might appear in the root of a volume
15 | .DocumentRevisions-V100
16 | .fseventsd
17 | .Spotlight-V100
18 | .TemporaryItems
19 | .Trashes
20 | .VolumeIcon.icns
21 | .com.apple.timemachine.donotpresent
22 |
23 | # Directories potentially created on remote AFP share
24 | .AppleDB
25 | .AppleDesktop
26 | Network Trash Folder
27 | Temporary Items
28 | .apdisk
29 |
30 |
31 | ### https://raw.github.com/github/gitignore/c1b7904af6689bd01646f008b0561d4f19a0e972/Global/Vim.gitignore
32 |
33 | # Swap
34 | [._]*.s[a-v][a-z]
35 | [._]*.sw[a-p]
36 | [._]s[a-rt-v][a-z]
37 | [._]ss[a-gi-z]
38 | [._]sw[a-p]
39 |
40 | # Session
41 | Session.vim
42 |
43 | # Temporary
44 | .netrwhist
45 | *~
46 | # Auto-generated tag files
47 | tags
48 | # Persistent undo
49 | [._]*.un~
50 |
51 |
52 | ### https://raw.github.com/github/gitignore/c1b7904af6689bd01646f008b0561d4f19a0e972/Python.gitignore
53 |
54 | # Byte-compiled / optimized / DLL files
55 | __pycache__/
56 | *.py[cod]
57 | *$py.class
58 |
59 | # C extensions
60 | *.so
61 |
62 | # Distribution / packaging
63 | .Python
64 | build/
65 | develop-eggs/
66 | dist/
67 | downloads/
68 | eggs/
69 | .eggs/
70 | lib/
71 | lib64/
72 | parts/
73 | sdist/
74 | var/
75 | wheels/
76 | pip-wheel-metadata/
77 | share/python-wheels/
78 | *.egg-info/
79 | .installed.cfg
80 | *.egg
81 | MANIFEST
82 |
83 | # PyInstaller
84 | # Usually these files are written by a python script from a template
85 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
86 | *.manifest
87 | *.spec
88 |
89 | # Installer logs
90 | pip-log.txt
91 | pip-delete-this-directory.txt
92 |
93 | # Unit test / coverage reports
94 | htmlcov/
95 | .tox/
96 | .nox/
97 | .coverage
98 | .coverage.*
99 | .cache
100 | nosetests.xml
101 | coverage.xml
102 | *.cover
103 | .hypothesis/
104 | .pytest_cache/
105 |
106 | # Translations
107 | *.mo
108 | *.pot
109 |
110 | # Django stuff:
111 | *.log
112 | local_settings.py
113 | db.sqlite3
114 |
115 | # Flask stuff:
116 | instance/
117 | .webassets-cache
118 |
119 | # Scrapy stuff:
120 | .scrapy
121 |
122 | # Sphinx documentation
123 | docs/_build/
124 |
125 | # PyBuilder
126 | target/
127 |
128 | # Jupyter Notebook
129 | .ipynb_checkpoints
130 |
131 | # IPython
132 | profile_default/
133 | ipython_config.py
134 |
135 | # pyenv
136 | .python-version
137 |
138 | # pipenv
139 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
140 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
141 | # having no cross-platform support, pipenv may install dependencies that don’t work, or not
142 | # install all needed dependencies.
143 | #Pipfile.lock
144 |
145 | # celery beat schedule file
146 | celerybeat-schedule
147 |
148 | # SageMath parsed files
149 | *.sage.py
150 |
151 | # Environments
152 | .env
153 | .venv
154 | env/
155 | venv/
156 | ENV/
157 | env.bak/
158 | venv.bak/
159 |
160 | # Spyder project settings
161 | .spyderproject
162 | .spyproject
163 |
164 | # Rope project settings
165 | .ropeproject
166 |
167 | # mkdocs documentation
168 | /site
169 |
170 | # mypy
171 | .mypy_cache/
172 | .dmypy.json
173 | dmypy.json
174 |
175 | # Pyre type checker
176 | .pyre/
177 |
178 |
179 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Yet another theme for lightline
2 |
3 |
4 |
5 | ## What is this?
6 |
7 | This theme is for [lightline][] that is a statusline plugin for Vim. This has features below.
8 |
9 | * Additional components for lightline
10 | - Support [ALE (Asynchronous Lint Engine)][ale]
11 | - Support Powerline icons **(optional)**
12 | - Support [majutsushi/tagbar][tagbar] to show function names **(optional)**
13 | - Support [airblade/vim-gitgutter][vim-gitgutter] / [mhinz/vim-signify][vim-signify] to show diff status **(optional)**
14 | * Improved colorscheme for lightline to fit with [Solarized][] & [Nord][nord-vim] colorschemes
15 |
16 | [lightline]: https://github.com/itchyny/lightline.vim
17 | [devicons]: https://github.com/ryanoasis/vim-devicons
18 | [ale]: https://github.com/dense-analysis/ale
19 | [Solarized]: http://ethanschoonover.com/solarized/vim-colors-solarized
20 |
21 | ## Themes
22 |
23 | * For Solarized Dark (best match for [vim-solarized8][])
24 |
25 |
26 |
27 |
28 |
29 | * For Solarized Light (best match for [vim-solarized8][])
30 |
31 |
32 |
33 |
34 |
35 | * For Nord ([nord-vim][])
36 |
37 |
38 |
39 |
40 |
41 | [vim-solarized8]: https://github.com/lifepillar/vim-solarized8
42 | [nord-vim]: https://github.com/arcticicestudio/nord-vim
43 |
44 | ## Install
45 |
46 | ### for [dein.vim][dein]
47 |
48 | #### Basic setting
49 |
50 | ```vim
51 | call dein#add('delphinus/lightline-delphinus')
52 | call dein#add('itchyny/lightline.vim')
53 |
54 | " optional
55 | call dein#add('ryanoasis/vim-devicons')
56 | call dein#add('dense-analysis/ale')
57 | call dein#add('majutsushi/tagbar')
58 | call dein#add('airblade/vim-gitgutter')
59 | call dein#add('mhinz/vim-signify')
60 | ```
61 |
62 | #### TOML setting
63 |
64 | ```toml
65 | [[plugins]]
66 | repo = 'delphinus/lightline-delphinus'
67 |
68 | [[plugins]]
69 | repo = 'itchyny/lightline.vim'
70 |
71 | # optional
72 | [[plugins]]
73 | repo = 'ryanoasis/vim-devicons'
74 |
75 | [[plugins]]
76 | repo = 'dense-analysis/ale'
77 |
78 | [[plugins]]
79 | repo = 'majutsushi/tagbar'
80 | ```
81 |
82 | [dein]: https://github.com/Shougo/dein.vim
83 |
84 | ### for other plugin managers
85 |
86 | **TODO**
87 |
88 | ## other setting
89 |
90 | ### `g:lightline_delphinus_use_powerline_glyphs`
91 |
92 | If true, it uses glyphs for [Powerline][]. You should use this options with fonts from [powerline-fonts][] or natively supported ones such as [Iosevka][].
93 |
94 | [Powerline]: https://github.com/powerline/powerline
95 | [powerline-fonts]: https://github.com/powerline/fonts
96 | [Iosevka]: https://be5invis.github.io/Iosevka/
97 |
98 | ### `g:lightline_delphinus_use_nerd_fonts_glyphs`
99 |
100 | If true, it uses glyphs for [nerd-fonts][]. You should use this options with [patched fonts][].
101 |
102 | [nerd-fonts]: https://github.com/ryanoasis/nerd-fonts
103 | [patched fonts]: https://github.com/ryanoasis/nerd-fonts#patched-fonts
104 |
105 | ### `g:lightline_delphinus_colorscheme`
106 |
107 | Can be set `solarized_improved` (Default) or `nord_improved`.
108 |
109 | ### `g:lightline_delphinus_tagbar_enable`
110 |
111 | Enable tagbar feature. See below.
112 |
113 | ### `g:lightline_delphinus_gitgutter_enable`
114 |
115 | Enable gitgutter feature. See below.
116 |
117 | Can be set `solarized_improved` (Default) or `nord_improved`.
118 |
119 | ## ALE setting (optional)
120 |
121 | If you want to use neat glyphs statusline for ALE, you should add some settings for ALE. Below is an example that I used in capturing GIF above.
122 |
123 | ```vim
124 | " nr2char(...) is for describing icons from devicons
125 | let g:ale_echo_msg_error_str = nr2char(0xf421) . ' '
126 | let g:ale_echo_msg_warning_str = nr2char(0xf420) . ' '
127 | let g:ale_echo_msg_info_str = nr2char(0xf05a) . ' '
128 | let g:ale_echo_msg_format = '%severity% %linter% - %s'
129 | let g:ale_sign_column_always = 1
130 | let g:ale_sign_error = g:ale_echo_msg_error_str
131 | let g:ale_sign_warning = g:ale_echo_msg_warning_str
132 | let g:ale_statusline_format = [
133 | \ g:ale_echo_msg_error_str . ' %d',
134 | \ g:ale_echo_msg_warning_str . ' %d',
135 | \ nr2char(0xf4a1) . ' ']
136 | ```
137 |
138 | ## tagbar setting (optional)
139 |
140 | lightline-delphinus can detect installed [tagbar][] and show function names on cursor by `tagbar#current()`. The info from tagbar will be updated once per second at the maximum.
141 |
142 | Set `let g:lightline_delphinus_tagbar_enable = 1` to enable this.
143 |
144 | [tagbar]: https://github.com/majutsushi/tagbar
145 |
146 |
147 |
148 | ## gitgutter setting (optional)
149 |
150 | lightline-delphinus can detect installed [vim-gitgutter][] and show diff info calculated from `gitgutter#hunk#hunks()`.
151 |
152 | Set `let g:lightline_delphinus_gitgutter_enable = 1` to enable this.
153 |
154 | [vim-gitgutter]: https://github.com/airblade/vim-gitgutter
155 |
156 |
157 |
158 | ## signify setting (optional)
159 |
160 | lightline-delphinus can detect installed [vim-signify][] and show diff info calculated from `sy#repo#get_stats()`.
161 |
162 | Set `let g:lightline_delphinus_signify_enable = 1` to enable this.
163 |
164 | [vim-signify]: https://github.com/mhinz/vim-signify
165 |
166 |
167 |
168 | ## Contribution
169 |
170 | The colorscheme's are formerly generated because the sources are a bit complicated and take long time to be evaluated in Vim.
171 |
172 | * source: `autoload/lightline/delphinus/colorscheme/nord_improved.vim`
173 | * generated: `autoload/lightline/colorscheme/nord_improved.vim`
174 |
175 | So you should not edit the colorscheme's directly. You should edit the sources, and run the script to generate.
176 |
177 | ```sh
178 | # edit the source
179 | vim autoload/lightline/delphinus/colorscheme/nord_improved.vim
180 | # run the script
181 | # this needs Python 3.6+
182 | bin/dump.py
183 | ```
184 |
--------------------------------------------------------------------------------
/autoload/lightline/colorscheme/nord_improved.vim:
--------------------------------------------------------------------------------
1 |
2 | " DO NOT EDIT THIS FILE
3 | " generated by bin/dump.py
4 | let g:lightline#colorscheme#nord_improved#palette={'inactive':{'right':[['#E5E9F0','#434C5E',7,8],['#E5E9F0','#3B4252',7,0]],'middle':[['#434C5E','#2E3440',8,0]],'left':[['#E5E9F0','#4C566A',7,8],['#E5E9F0','#434C5E',7,8]]},'replace':{'right':[['#3B4252','#ff8e63',0,209],['#3B4252','#ff5f39',0,203],['#3B4252','#ff5f39',0,203]],'middle':[['#E5E9F0','#c52600',7,160]],'ok':[['#E5E9F0','#ff5f39',7,203]],'warning':[['#E5E9F0','#ff5f39',7,203]],'left':[['#dc322f','#E5E9F0',1,7,'bold'],['#3B4252','#ff8e63',0,209],['#3B4252','#ff5f39',0,203],['#E5E9F0','#ff3100',7,202]],'error':[['#E5E9F0','#ff5f39',7,203]]},'normal':{'right':[['#E5E9F0','#4C566A',7,8],['#E5E9F0','#434C5E',7,8],['#E5E9F0','#3B4252',7,0]],'middle':[['#4C566A','#3B4252',8,0]],'ok':[['#A3BE8C','#3B4252',2,0]],'warning':[['#3B4252','#EBCB8B',0,3]],'left':[['#3B4252','#88C0D0',0,6,'bold'],['#E5E9F0','#4C566A',7,8,'bold'],['#E5E9F0','#434C5E',7,8],['#ECEFF4','#3B4252',15,0]],'error':[['#E5E9F0','#BF616A',7,1]]},'terminal':{'right':[['#3B4252','#67b771',0,71],['#3B4252','#3a9545',0,65],['#3B4252','#3a9545',0,65]],'middle':[['#E5E9F0','#085b12',7,22]],'left':[['#2d8f18','#E5E9F0',28,7,'bold'],['#3B4252','#67b771',0,71],['#3B4252','#3a9545',0,65],['#E5E9F0','#1f7b2a',7,28]]},'tabline':{'right':[['#E5E9F0','#4C566A',7,8],['#E5E9F0','#434C5E',7,8],['#E5E9F0','#3B4252',7,0]],'middle':[['#4C566A','#3B4252',8,0]],'left':[['#2E3440','#4C566A',0,8]],'tabsel':[['#2E3440','#4C566A',0,8]]},'visual':{'right':[['#3B4252','#aa4dbe',0,133],['#3B4252','#962aad',0,92],['#3B4252','#962aad',0,92]],'middle':[['#E5E9F0','#6c0382',7,54]],'ok':[['#E5E9F0','#962aad',7,92]],'warning':[['#E5E9F0','#962aad',7,92]],'left':[['#d33682','#E5E9F0',92,7,'bold'],['#3B4252','#aa4dbe',0,133],['#3B4252','#962aad',0,92],['#E5E9F0','#8c04a8',7,91]],'error':[['#E5E9F0','#962aad',7,92]]},'insert':{'right':[['#E5E9F0','#5383bd',7,67],['#E5E9F0','#3169ac',7,60],['#E5E9F0','#0e53a7',7,25]],'middle':[['#E5E9F0','#0a4081',7,24]],'ok':[['#E5E9F0','#0e53a7',7,25]],'warning':[['#E5E9F0','#0e53a7',7,25]],'left':[['#268bd2','#E5E9F0',25,7,'bold'],['#E5E9F0','#5383bd',7,67],['#E5E9F0','#3169ac',7,60],['#E5E9F0','#0e53a7',7,25]],'error':[['#E5E9F0','#0e53a7',7,25]]}}
5 | if get(g:, 'nord_uniform_status_lines')
6 | let g:lightline#colorscheme#nord_improved#palette.inactive.middle[0][1]='#3B4252'
7 | endif
8 |
--------------------------------------------------------------------------------
/autoload/lightline/colorscheme/solarized_improved.vim:
--------------------------------------------------------------------------------
1 | " DO NOT EDIT THIS FILE
2 | " generated by bin/dump.py
3 | if &background ==# 'dark'
4 | let g:lightline#colorscheme#solarized_improved#palette={'inactive':{'right':[['#002b36','#657b83','234','240'],['#839496','#073642','244','235']],'middle':[['#586e75','#073642','239','235']],'left':[['#839496','#073642','244','235'],['#839496','#073642','244','235']]},'replace':{'right':[['#002b36','#ff8e63','234',209],['#002b36','#ff5f39','234',203],['#002b36','#ff5f39','234',203]],'middle':[['#eee8d5','#c52600','187',160]],'ok':[['#eee8d5','#ff5f39','187',203]],'warning':[['#eee8d5','#ff5f39','187',203]],'left':[['#dc322f','#eee8d5','124','187','bold'],['#002b36','#ff8e63','234',209],['#002b36','#ff5f39','234',203],['#eee8d5','#ff3100','187',202]],'error':[['#eee8d5','#ff5f39','187',203]]},'normal':{'right':[['#002b36','#93a1a1','234','245'],['#002b36','#657b83','234','240']],'middle':[['#93a1a1','#073642','245','235']],'ok':[['#859900','#073642','64','235']],'warning':[['#eee8d5','#b58900','187','136']],'left':[['#002b36','#859900','234','64','bold'],['#002b36','#93a1a1','234','245','bold'],['#002b36','#839496','234','244'],['#fdf6e3','#073642','230','235']],'error':[['#eee8d5','#dc322f','187','124']]},'tabline':{'right':[['#002b36','#93a1a1','234','245'],['#002b36','#657b83','234','240']],'middle':[['#839496','#073642','244','235']],'left':[['#002b36','#657b83','234','240']],'tabsel':[['#002b36','#93a1a1','234','245']]},'visual':{'right':[['#002b36','#aa4dbe','234',133],['#002b36','#962aad','234',92],['#002b36','#962aad','234',92]],'middle':[['#eee8d5','#6c0382','187',54]],'ok':[['#eee8d5','#962aad','187',92]],'warning':[['#eee8d5','#962aad','187',92]],'left':[['#d33682','#eee8d5','125','187','bold'],['#002b36','#aa4dbe','234',133],['#002b36','#962aad','234',92],['#eee8d5','#8c04a8','187',91]],'error':[['#eee8d5','#962aad','187',92]]},'insert':{'right':[['#002b36','#5383bd','234',67],['#002b36','#3169ac','234',61],['#002b36','#0e53a7','234',25]],'middle':[['#eee8d5','#0a4081','187',24]],'ok':[['#eee8d5','#0e53a7','187',25]],'warning':[['#eee8d5','#0e53a7','187',25]],'left':[['#268bd2','#eee8d5','33','187','bold'],['#002b36','#5383bd','234',67],['#002b36','#3169ac','234',61],['#eee8d5','#0e53a7','187',25]],'error':[['#eee8d5','#0e53a7','187',25]]}}
5 | else
6 | let g:lightline#colorscheme#solarized_improved#palette={'inactive':{'right':[['#fdf6e3','#839496','230','244'],['#657b83','#eee8d5','240','187']],'middle':[['#93a1a1','#eee8d5','245','187']],'left':[['#657b83','#eee8d5','240','187'],['#657b83','#eee8d5','240','187']]},'replace':{'right':[['#002b36','#ffcec3','234',224],['#002b36','#ffa089','234',216],['#fdf6e3','#ff7c5d','230',209]],'middle':[['#073642','#ff5931','235',203]],'ok':[['#073642','#ff7c5d','235',209]],'warning':[['#073642','#ff7c5d','235',209]],'left':[['#eee8d5','#dc322f','187','124','bold'],['#002b36','#ffcec3','234',224],['#002b36','#ffa089','234',216],['#073642','#ff7c5d','235',209]],'error':[['#073642','#ff7c5d','235',209]]},'normal':{'right':[['#fdf6e3','#586e75','230','239'],['#fdf6e3','#839496','230','244']],'middle':[['#586e75','#eee8d5','239','187']],'ok':[['#859900','#eee8d5','64','187']],'warning':[['#eee8d5','#b58900','187','136']],'left':[['#fdf6e3','#859900','230','64','bold'],['#fdf6e3','#586e75','230','239','bold'],['#fdf6e3','#657b83','230','240'],['#002b36','#eee8d5','234','187']],'error':[['#eee8d5','#dc322f','187','124']]},'tabline':{'right':[['#fdf6e3','#586e75','230','239'],['#fdf6e3','#839496','230','244']],'middle':[['#657b83','#eee8d5','240','187']],'left':[['#fdf6e3','#839496','230','244']],'tabsel':[['#fdf6e3','#586e75','230','239']]},'visual':{'right':[['#002b36','#ffffff','234',231],['#002b36','#f5cafd','234',225],['#fdf6e3','#e898f9','230',177]],'middle':[['#073642','#d96df0','235',171]],'ok':[['#073642','#e898f9','235',177]],'warning':[['#073642','#e898f9','235',177]],'left':[['#eee8d5','#d33682','187','125','bold'],['#002b36','#ffffff','234',231],['#002b36','#f5cafd','234',225],['#073642','#e898f9','235',177]],'error':[['#073642','#e898f9','235',177]]},'insert':{'right':[['#002b36','#a4ccfc','234',153],['#002b36','#75b2fb','234',111],['#fdf6e3','#4e9cf9','230',75]],'middle':[['#073642','#2684f5','235',33]],'ok':[['#073642','#4e9cf9','235',75]],'warning':[['#073642','#4e9cf9','235',75]],'left':[['#eee8d5','#268bd2','187','33','bold'],['#002b36','#a4ccfc','234',153],['#002b36','#75b2fb','234',111],['#073642','#4e9cf9','235',75]],'error':[['#073642','#4e9cf9','235',75]]}}
7 | endif
--------------------------------------------------------------------------------
/autoload/lightline/delphinus/colorscheme/nord_improved.vim:
--------------------------------------------------------------------------------
1 | " =============================================================================
2 | " Filename: autoload/lightline/delphinus/colorscheme/nord_improved.vim
3 | " Author: delphinus
4 | " License: MIT License
5 | " Last Change: 2019-10-23T22:11:07+0900.
6 | " =============================================================================
7 |
8 | let s:nord0 = ['#2E3440', 0 ]
9 | let s:nord1 = ['#3B4252', 0]
10 | let s:nord2 = ['#434C5E', 8 ]
11 | let s:nord3 = ['#4C566A', 8]
12 | let s:nord4 = ['#D8DEE9', 7 ]
13 | let s:nord5 = ['#E5E9F0', 7]
14 | let s:nord6 = ['#ECEFF4', 15]
15 | let s:nord7 = ['#8FBCBB', 14]
16 | let s:nord8 = ['#88C0D0', 6]
17 | let s:nord9 = ['#81A1C1', 4]
18 | let s:nord10 = ['#5E81AC', 12]
19 | let s:nord11 = ['#BF616A', 1]
20 | let s:nord12 = ['#D08770', 11]
21 | let s:nord13 = ['#EBCB8B', 3]
22 | let s:nord14 = ['#A3BE8C', 2]
23 | let s:nord15 = ['#B48EAD', 5]
24 |
25 | let s:red = [ '#dc322f', 1 ]
26 | let s:magenta = [ '#d33682', 92 ]
27 | let s:blue = [ '#268bd2', 25 ]
28 | let s:green = [ '#2d8f18', 28 ]
29 |
30 | let s:bold = 'bold'
31 |
32 | " http://paletton.com/#uid=13C0u0kw0w0jyC+oRxVy4oIDfjr
33 | let s:insert = [
34 | \ [ s:blue, s:nord5, s:bold ],
35 | \ [ s:nord5, [ '#5383bd', 67 ] ],
36 | \ [ s:nord5, [ '#3169ac', 60 ] ],
37 | \ [ s:nord5, [ '#0e53a7', 25 ] ],
38 | \ [ s:nord5, [ '#0e53a7', 25 ] ],
39 | \ [ s:nord5, [ '#0a4081', 24 ] ],
40 | \ [ s:nord5, [ '#0e53a7', 25 ] ] ]
41 | " http://paletton.com/#uid=1090u0kw0w0jyC+oRxVy4oIDfjr
42 | let s:replace = [
43 | \ [ s:red, s:nord5, s:bold ],
44 | \ [ s:nord1, [ '#ff8e63', 209 ] ],
45 | \ [ s:nord1, [ '#ff5f39', 203 ] ],
46 | \ [ s:nord5, [ '#ff3100', 202 ] ],
47 | \ [ s:nord1, [ '#ff5f39', 203 ] ],
48 | \ [ s:nord5, [ '#c52600', 160 ] ],
49 | \ [ s:nord5, [ '#ff5f39', 203 ] ] ]
50 | " http://paletton.com/#uid=14Q0u0kw0w0jyC+oRxVy4oIDfjr
51 | let s:visual = [
52 | \ [ s:magenta, s:nord5, s:bold ],
53 | \ [ s:nord1, [ '#aa4dbe', 133 ] ],
54 | \ [ s:nord1, [ '#962aad', 92 ] ],
55 | \ [ s:nord5, [ '#8c04a8', 91 ] ],
56 | \ [ s:nord1, [ '#962aad', 92 ] ],
57 | \ [ s:nord5, [ '#6c0382', 54 ] ],
58 | \ [ s:nord5, [ '#962aad', 92 ] ] ]
59 |
60 | " http://paletton.com/#uid=12R0u0ko0jTe3tEjEo9tdeFBC9s
61 | let s:terminal = [
62 | \ [ s:green, s:nord5, s:bold ],
63 | \ [ s:nord1, [ '#67b771', 71 ] ],
64 | \ [ s:nord1, [ '#3a9545', 65 ] ],
65 | \ [ s:nord5, [ '#1f7b2a', 28 ] ],
66 | \ [ s:nord1, [ '#3a9545', 65 ] ],
67 | \ [ s:nord5, [ '#085b12', 22 ] ],
68 | \ [ s:nord5, [ '#3a9545', 65 ] ] ]
69 |
70 | let s:normal = [
71 | \ [ s:nord1, s:nord8, s:bold ],
72 | \ [ s:nord5, s:nord3, s:bold ],
73 | \ [ s:nord5, s:nord2 ],
74 | \ [ s:nord6, s:nord1 ],
75 | \ [ s:nord5, s:nord11 ],
76 | \ [ s:nord1, s:nord13 ],
77 | \ [ s:nord14, s:nord1 ] ]
78 |
79 | let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}, 'terminal': {}}
80 |
81 | let s:p.normal.left = s:normal[0:3]
82 | let s:p.inactive.left = [ [ s:nord5, s:nord3 ], [ s:nord5, s:nord2 ] ]
83 | let s:p.insert.left = s:insert[0:3]
84 | let s:p.replace.left = s:replace[0:3]
85 | let s:p.visual.left = s:visual[0:3]
86 | let s:p.terminal.left = s:terminal[0:3]
87 |
88 | let s:p.normal.right = [ [ s:nord5, s:nord3 ], [ s:nord5, s:nord2 ], [ s:nord5, s:nord1 ] ]
89 | let s:p.inactive.right = [ [ s:nord5, s:nord2 ], [ s:nord5, s:nord1 ] ]
90 | let s:p.insert.right = s:insert[1:2] + s:insert[4:4]
91 | let s:p.replace.right = s:replace[1:2] + s:replace[4:4]
92 | let s:p.visual.right = s:visual[1:2] + s:visual[4:4]
93 | let s:p.terminal.right = s:terminal[1:2] + s:terminal[4:4]
94 |
95 | let s:p.normal.middle = [ [ s:nord3, s:nord1 ] ]
96 | " s:p.inactive.middle[1] will be overwritten to s:nord1 when
97 | " g:nord_uniform_status_lines == 1. See bin/dump.py
98 | let s:p.inactive.middle = [ [ s:nord2, s:nord0 ] ]
99 | let s:p.insert.middle = s:insert[5:5]
100 | let s:p.replace.middle = s:replace[5:5]
101 | let s:p.visual.middle = s:visual[5:5]
102 | let s:p.terminal.middle = s:terminal[5:5]
103 |
104 | let s:p.tabline.left = [ [ s:nord0, s:nord3 ] ]
105 | let s:p.tabline.tabsel = [ [ s:nord0, s:nord3 ] ]
106 | let s:p.tabline.middle = [ [ s:nord3, s:nord1 ] ]
107 | let s:p.tabline.right = copy(s:p.normal.right)
108 |
109 | let s:p.normal.error = s:normal[4:4]
110 | let s:p.insert.error = s:insert[6:6]
111 | let s:p.replace.error = s:replace[6:6]
112 | let s:p.visual.error = s:visual[6:6]
113 | let s:p.normal.warning = s:normal[5:5]
114 | let s:p.insert.warning = s:insert[6:6]
115 | let s:p.replace.warning = s:replace[6:6]
116 | let s:p.visual.warning = s:visual[6:6]
117 | let s:p.normal.ok = s:normal[6:6]
118 | let s:p.insert.ok = s:insert[6:6]
119 | let s:p.replace.ok = s:replace[6:6]
120 | let s:p.visual.ok = s:visual[6:6]
121 |
122 | function! lightline#delphinus#colorscheme#nord_improved#palette() abort
123 | return substitute(string(lightline#colorscheme#flatten(s:p)), ' ', '', 'g')
124 | endfunction
125 |
--------------------------------------------------------------------------------
/autoload/lightline/delphinus/colorscheme/solarized_improved.vim:
--------------------------------------------------------------------------------
1 | " =============================================================================
2 | " Filename: autoload/lightline/delphinus/colorscheme/solarized_improved.vim
3 | " Author: delphinus
4 | " License: MIT License
5 | " Last Change: 2019-04-16T20:28:37+0900.
6 | " =============================================================================
7 |
8 | let s:cuicolors = {
9 | \ 'base03': [ '8', '234', 'DarkGray' ],
10 | \ 'base02': [ '0', '235', 'Black' ],
11 | \ 'base01': [ '10', '239', 'LightGreen' ],
12 | \ 'base00': [ '11', '240', 'LightYellow' ],
13 | \ 'base0': [ '12', '244', 'LightBlue' ],
14 | \ 'base1': [ '14', '245', 'LightCyan' ],
15 | \ 'base2': [ '7', '187', 'LightGray' ],
16 | \ 'base3': [ '15', '230', 'White' ],
17 | \ 'yellow': [ '3', '136', 'DarkYellow' ],
18 | \ 'orange': [ '9', '166', 'LightRed' ],
19 | \ 'red': [ '1', '124', 'DarkRed' ],
20 | \ 'magenta': [ '5', '125', 'DarkMagenta' ],
21 | \ 'violet': [ '13', '61', 'LightMagenta' ],
22 | \ 'blue': [ '4', '33', 'DarkBlue' ],
23 | \ 'cyan': [ '6', '37', 'DarkCyan' ],
24 | \ 'green': [ '2', '64', 'DarkGreen' ],
25 | \ }
26 |
27 | " The following condition only applies for the console and is the same
28 | " condition vim-colors-solarized uses to determine which set of colors
29 | " to use.
30 | let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
31 | if s:solarized_termcolors != 256 && &t_Co >= 16
32 | let s:cuiindex = 0
33 | elseif s:solarized_termcolors == 256
34 | let s:cuiindex = 1
35 | else
36 | let s:cuiindex = 2
37 | endif
38 |
39 | let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
40 | let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
41 | let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
42 | let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
43 | let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
44 | let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
45 | let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
46 | let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
47 | let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
48 | let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
49 | let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
50 | let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
51 | let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
52 | let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
53 | let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
54 | let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
55 |
56 | let s:bold = 'bold'
57 |
58 | if &background ==# 'light'
59 | let [ s:base03, s:base3 ] = [ s:base3, s:base03 ]
60 | let [ s:base02, s:base2 ] = [ s:base2, s:base02 ]
61 | let [ s:base01, s:base1 ] = [ s:base1, s:base01 ]
62 | let [ s:base00, s:base0 ] = [ s:base0, s:base00 ]
63 |
64 | " http://paletton.com/#uid=13C0u0knVYVc7ZQi-ZntrXrH4Ty
65 | let s:insert = [
66 | \ [ s:base02, s:blue, s:bold ],
67 | \ [ s:base3, [ '#a4ccfc', 153 ] ],
68 | \ [ s:base3, [ '#75b2fb', 111 ] ],
69 | \ [ s:base2, [ '#4e9cf9', 75 ] ],
70 | \ [ s:base03, [ '#4e9cf9', 75 ] ],
71 | \ [ s:base2, [ '#2684f5', 33 ] ],
72 | \ [ s:base2, [ '#4e9cf9', 75 ] ] ]
73 | " http://paletton.com/#uid=1090u0kkh++7z+WeL+ZpN+WvYZG
74 | let s:replace = [
75 | \ [ s:base02, s:red, s:bold ],
76 | \ [ s:base3, [ '#ffcec3', 224 ] ],
77 | \ [ s:base3, [ '#ffa089', 216 ] ],
78 | \ [ s:base2, [ '#ff7c5d', 209 ] ],
79 | \ [ s:base03, [ '#ff7c5d', 209 ] ],
80 | \ [ s:base2, [ '#ff5931', 203 ] ],
81 | \ [ s:base2, [ '#ff7c5d', 209 ] ] ]
82 | " http://paletton.com/#uid=14Q0u0kcNYG00++6C+qhYVrmpPi
83 | let s:visual = [
84 | \ [ s:base02, s:magenta, s:bold ],
85 | \ [ s:base3, [ '#ffffff', 231 ] ],
86 | \ [ s:base3, [ '#f5cafd', 225 ] ],
87 | \ [ s:base2, [ '#e898f9', 177 ] ],
88 | \ [ s:base03, [ '#e898f9', 177 ] ],
89 | \ [ s:base2, [ '#d96df0', 171 ] ],
90 | \ [ s:base2, [ '#e898f9', 177 ] ] ]
91 | else
92 | " http://paletton.com/#uid=13C0u0kw0w0jyC+oRxVy4oIDfjr
93 | let s:insert = [
94 | \ [ s:blue, s:base2, s:bold ],
95 | \ [ s:base03, [ '#5383bd', 67 ] ],
96 | \ [ s:base03, [ '#3169ac', 61 ] ],
97 | \ [ s:base2, [ '#0e53a7', 25 ] ],
98 | \ [ s:base03, [ '#0e53a7', 25 ] ],
99 | \ [ s:base2, [ '#0a4081', 24 ] ],
100 | \ [ s:base2, [ '#0e53a7', 25 ] ] ]
101 | " http://paletton.com/#uid=1090u0kw0w0jyC+oRxVy4oIDfjr
102 | let s:replace = [
103 | \ [ s:red, s:base2, s:bold ],
104 | \ [ s:base03, [ '#ff8e63', 209 ] ],
105 | \ [ s:base03, [ '#ff5f39', 203 ] ],
106 | \ [ s:base2, [ '#ff3100', 202 ] ],
107 | \ [ s:base03, [ '#ff5f39', 203 ] ],
108 | \ [ s:base2, [ '#c52600', 160 ] ],
109 | \ [ s:base2, [ '#ff5f39', 203 ] ] ]
110 | " http://paletton.com/#uid=14Q0u0kw0w0jyC+oRxVy4oIDfjr
111 | let s:visual = [
112 | \ [ s:magenta, s:base2, s:bold ],
113 | \ [ s:base03, [ '#aa4dbe', 133 ] ],
114 | \ [ s:base03, [ '#962aad', 92 ] ],
115 | \ [ s:base2, [ '#8c04a8', 91 ] ],
116 | \ [ s:base03, [ '#962aad', 92 ] ],
117 | \ [ s:base2, [ '#6c0382', 54 ] ],
118 | \ [ s:base2, [ '#962aad', 92 ] ] ]
119 | endif
120 |
121 | let s:normal = [
122 | \ [ s:base03, s:green, s:bold ],
123 | \ [ s:base03, s:base1, s:bold ],
124 | \ [ s:base03, s:base0 ],
125 | \ [ s:base3, s:base02 ],
126 | \ [ s:base2, s:red ],
127 | \ [ s:base2, s:yellow ],
128 | \ [ s:green, s:base02 ] ]
129 |
130 | if &background ==# 'light'
131 | let s:normal[4][0] = s:base02
132 | let s:normal[5][0] = s:base02
133 | endif
134 |
135 | let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
136 |
137 | let s:p.normal.left = s:normal[0:3]
138 | let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base0, s:base02 ] ]
139 | let s:p.insert.left = s:insert[0:3]
140 | let s:p.replace.left = s:replace[0:3]
141 | let s:p.visual.left = s:visual[0:3]
142 |
143 | let s:p.normal.right = [ [ s:base03, s:base1 ], [ s:base03, s:base00 ] ]
144 | let s:p.inactive.right = [ [ s:base03, s:base00 ], [ s:base0, s:base02 ] ]
145 | let s:p.insert.right = s:insert[1:2] + s:insert[4:4]
146 | let s:p.replace.right = s:replace[1:2] + s:replace[4:4]
147 | let s:p.visual.right = s:visual[1:2] + s:visual[4:4]
148 |
149 | let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
150 | let s:p.inactive.middle = [ [ s:base01, s:base02 ] ]
151 | let s:p.insert.middle = s:insert[5:5]
152 | let s:p.replace.middle = s:replace[5:5]
153 | let s:p.visual.middle = s:visual[5:5]
154 |
155 | let s:p.tabline.left = [ [ s:base03, s:base00 ] ]
156 | let s:p.tabline.tabsel = [ [ s:base03, s:base1 ] ]
157 | let s:p.tabline.middle = [ [ s:base0, s:base02 ] ]
158 | let s:p.tabline.right = copy(s:p.normal.right)
159 |
160 | let s:p.normal.error = s:normal[4:4]
161 | let s:p.insert.error = s:insert[6:6]
162 | let s:p.replace.error = s:replace[6:6]
163 | let s:p.visual.error = s:visual[6:6]
164 | let s:p.normal.warning = s:normal[5:5]
165 | let s:p.insert.warning = s:insert[6:6]
166 | let s:p.replace.warning = s:replace[6:6]
167 | let s:p.visual.warning = s:visual[6:6]
168 | let s:p.normal.ok = s:normal[6:6]
169 | let s:p.insert.ok = s:insert[6:6]
170 | let s:p.replace.ok = s:replace[6:6]
171 | let s:p.visual.ok = s:visual[6:6]
172 |
173 | function! lightline#delphinus#colorscheme#solarized_improved#palette() abort
174 | return substitute(string(lightline#colorscheme#flatten(s:p)), ' ', '', 'g')
175 | endfunction
176 |
--------------------------------------------------------------------------------
/autoload/lightline/delphinus/components.vim:
--------------------------------------------------------------------------------
1 | " =============================================================================
2 | " Filename: autoload/lightline/delphinus/components.vim
3 | " Author: delphinus
4 | " License: MIT License
5 | " Last Change: 2020-04-21T18:42:08+0900.
6 | " =============================================================================
7 |
8 | scriptencoding utf-8
9 |
10 | if g:lightline_delphinus_use_nerd_fonts_glyphs
11 | let s:mo_glyph = "\uf040 " "
12 | let s:help_glyph = "\uf128" "
13 | let s:ale_linting_glyph = " \uf250 " "
14 | else
15 | let s:mo_glyph = '+'
16 | let s:help_glyph = '?'
17 | let s:ale_linting_glyph = '....'
18 | endif
19 |
20 | if g:lightline_delphinus_use_powerline_glyphs
21 | let s:ro_glyph = "\ue0a2" "
22 | let s:branch_glyph = "\ue0a0" "
23 | else
24 | let s:ro_glyph = 'RO'
25 | let s:branch_glyph = ''
26 | endif
27 |
28 | " s:is_using_dein is used for detecting tagbar is enabled
29 | let s:is_using_dein = exists('*dein#is_sourced')
30 |
31 | function! lightline#delphinus#components#modified() abort
32 | return &buftype ==# 'terminal' ? '' :
33 | \ &filetype =~# 'help\|vimfiler\|gundo\|fzf\|tagbar\|denite' ? '' :
34 | \ &modified ? s:mo_glyph : &modifiable ? '' :
35 | \ '-'
36 | endfunction
37 |
38 | function! lightline#delphinus#components#readonly() abort
39 | return &buftype ==# 'terminal' ? '' :
40 | \ &filetype ==# 'help' ? s:help_glyph :
41 | \ &filetype !~# 'vimfiler\|gundo\|fzf\|tagbar\|denite' && &readonly ? s:ro_glyph :
42 | \ ''
43 | endfunction
44 |
45 | function! lightline#delphinus#components#filepath() abort
46 | if &buftype ==# 'terminal' || &filetype ==# 'tagbar' || &filetype ==# 'denite-filter'
47 | return ''
48 | endif
49 | if &filetype ==# 'denite'
50 | return denite#get_status('input')
51 | endif
52 | let ro_glyph = lightline#delphinus#components#readonly()
53 | let ro_string = '' !=# ro_glyph ? ro_glyph . ' ' : ''
54 | if get(b:, 'fugitive_type', '') !=# ''
55 | let fugitive_status = fugitive#statusline()[1:-2] " remove square brackets: [...]
56 | return ro_string . fugitive_status
57 | endif
58 | if &filetype =~# 'vimfilter\|unite\|fzf' || winwidth(0) < 70
59 | let path_string = ''
60 | else
61 | if exists('+shellslash')
62 | let saved_shellslash = &shellslash
63 | set shellslash
64 | endif
65 | let path_string = substitute(expand('%:h'), fnamemodify(expand($HOME),''), '~', '')
66 | if winwidth(0) < 120 && len(path_string) > 30
67 | let path_string = substitute(path_string, '\v([^/])[^/]*%(/)@=', '\1', 'g')
68 | endif
69 | if exists('+shellslash')
70 | let &shellslash = saved_shellslash
71 | endif
72 | endif
73 |
74 | return ro_string . path_string
75 | endfunction
76 |
77 | function! lightline#delphinus#components#filename() abort
78 | return (&buftype ==# 'terminal' ? has('nvim') ? b:term_title . ' (' . b:terminal_job_pid . ')' : '' :
79 | \ &buftype ==# 'quickfix' ? (getwininfo(win_getid())[0].loclist ? '[Location List] ' : '[Quick Fix] ')
80 | \ . get(w:, 'quickfix_title', '') :
81 | \ &filetype ==# 'vimfiler' ? vimfiler#get_status_string() :
82 | \ &filetype ==# 'unite' ? unite#get_status_string() :
83 | \ &filetype ==# 'denite' ? denite#get_status('sources') :
84 | \ &filetype ==# 'denite-filter' ? '' :
85 | \ &filetype ==# 'fzf' ? get(g:lightline, 'fname', '') :
86 | \ &filetype ==# 'tagbar' ? get(g:lightline, 'fname', '') :
87 | \ '' !=# expand('%:t') ? expand('%:t') : '[No Name]') .
88 | \ ('' !=# lightline#delphinus#components#modified() ? ' ' . lightline#delphinus#components#modified() : '')
89 | endfunction
90 |
91 | function! lightline#delphinus#components#fugitive() abort
92 | if &buftype ==# 'terminal' || &filetype =~# 'denite' || winwidth(0) < 100
93 | return ''
94 | endif
95 | try
96 | if &filetype !~? 'vimfiler\|gundo\|tagbar' && get(g:, 'loaded_fugitive')
97 | let head = FugitiveHead()
98 | if head !=? ''
99 | let head = s:branch_glyph . head
100 | endif
101 | return head
102 | endif
103 | catch
104 | endtry
105 | return ''
106 | endfunction
107 |
108 | function! lightline#delphinus#components#fileformat() abort
109 | return &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar' ? '' :
110 | \ winwidth(0) > 120 ? &fileformat . (exists('*WebDevIconsGetFileFormatSymbol') ? ' ' . WebDevIconsGetFileFormatSymbol() : '') : ''
111 | endfunction
112 |
113 | function! lightline#delphinus#components#filetype() abort
114 | return &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar' ? '' :
115 | \ winwidth(0) > 120 ? (strlen(&filetype) ? &filetype . (exists('*WebDevIconsGetFileTypeSymbol') ? ' ' . WebDevIconsGetFileTypeSymbol() : '') : 'no ft') : ''
116 | endfunction
117 |
118 | function! lightline#delphinus#components#fileencoding() abort
119 | return &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar' ? '' :
120 | \ winwidth(0) > 120 ? (strlen(&fileencoding) ? &fileencoding : &encoding) : ''
121 | endfunction
122 |
123 | function! lightline#delphinus#components#mode() abort
124 | let fname = expand('%:t')
125 | return fname =~# 'unite' ? 'Unite' :
126 | \ fname =~# 'vimfiler' ? 'VimFilter' :
127 | \ fname =~# '__Gundo__' ? 'Gundo' :
128 | \ fname =~# 'fzf' ? 'FZF' :
129 | \ &filetype =~# 'denite' ? 'Denite' :
130 | \ &filetype ==# 'tagbar' ? 'Tagbar' :
131 | \ winwidth(0) > 60 ? lightline#mode() : ''
132 | endfunction
133 |
134 | function! lightline#delphinus#components#charcode() abort
135 | if &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar'
136 | return ''
137 | endif
138 | if winwidth(0) <= 120
139 | return ''
140 | endif
141 | let tmp = ''
142 | " if char on cursor is `Λ̊`, :ascii returns below.
143 | " <Λ> 923, 16進数 039b, 8進数 1633 < ̊> 778, 16進数 030a, 8進数 1412
144 | redir => tmp | silent! ascii | redir END
145 | let chars = []
146 | call substitute(tmp, '<.>\s\+\d\+,\s\+\S\+ \x\+,\s\+\S\+ \d\+', '\=add(chars, submatch(0))', 'g')
147 | if len(chars) == 0
148 | return ''
149 | endif
150 | let ascii = []
151 | for c in chars
152 | let m = matchlist(c, '<\(.\)>\s\+\d\+,\s\+\S\+ \(\x\+\)')
153 | if len(m) > 0
154 | call add(ascii, printf('%s %s', m[1], m[2]))
155 | endif
156 | endfor
157 | return join(ascii, ', ')
158 | endfunction
159 |
160 | let s:ale_linting = 0
161 |
162 | function! lightline#delphinus#components#ale_pre() abort
163 | let s:ale_linting = 1
164 | call lightline#update()
165 | endfunction
166 |
167 | function! lightline#delphinus#components#ale_post() abort
168 | let s:ale_linting = 0
169 | call lightline#update()
170 | endfunction
171 |
172 | function! lightline#delphinus#components#ale_error() abort
173 | return s:ale_string(0)
174 | endfunction
175 |
176 | function! lightline#delphinus#components#ale_warning() abort
177 | return s:ale_string(1)
178 | endfunction
179 |
180 | function! lightline#delphinus#components#ale_ok() abort
181 | return s:ale_string(2)
182 | endfunction
183 |
184 | function! s:ale_string(mode)
185 | if !get(g:, 'loaded_ale') || &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar'
186 | return ''
187 | endif
188 | if s:ale_linting
189 | " it shows an icon in linting with the `warning` color.
190 | return a:mode == 1 ? s:ale_linting_glyph : ''
191 | endif
192 |
193 | let buffer = bufnr('%')
194 | let counts = ale#statusline#Count(buffer)
195 | let [error_format, warning_format, no_errors] = g:ale_statusline_format
196 |
197 | if a:mode == 0 " Error
198 | let errors = counts.error + counts.style_error
199 | return errors ? printf(error_format, errors) : ''
200 | elseif a:mode == 1 " Warning
201 | let warnings = counts.warning + counts.style_warning
202 | return warnings ? printf(warning_format, warnings) : ''
203 | endif
204 |
205 | return counts.total ? '' : no_errors
206 | endfunction
207 |
208 | function! lightline#delphinus#components#lineinfo() abort
209 | if &filetype ==# 'denite'
210 | return printf('%3d/%-2d', line('.'), denite#get_status('line_total'))
211 | elseif &filetype ==# 'tagbar' || &filetype ==# 'denite-filter'
212 | return ''
213 | endif
214 | let c = col('.')
215 | let vc = virtcol('.')
216 | if c != vc
217 | return printf('%3d:%d-%d', line('.'), c, vc)
218 | endif
219 | return printf('%3d:%-2d', line('.'), c)
220 | endfunction
221 |
222 | function! lightline#delphinus#components#percent() abort
223 | if &filetype ==# 'tagbar'
224 | return ''
225 | endif
226 | let total = &filetype ==# 'denite' ? denite#get_status('line_total') : line('$')
227 | return total ? printf('%d%%', 100 * line('.') / total) : '0%'
228 | endfunction
229 |
230 | function! lightline#delphinus#components#currenttag() abort
231 | if !g:lightline_delphinus_tagbar_enable || !lightline#delphinus#components#is_tagbar_enabled() || &buftype ==# 'terminal' || &filetype =~# 'denite\|tagbar'
232 | return ''
233 | endif
234 | let now = localtime()
235 | if get(s:, 'currenttag_last_lookup') != now
236 | let s:currenttag_last_lookup = now
237 | let s:currenttag_last_seen = tagbar#currenttag('%s', '')
238 | endif
239 | return get(s:, 'currenttag_last_seen', '')
240 | endfunction
241 |
242 | function! lightline#delphinus#components#is_tagbar_enabled() abort
243 | return s:is_using_dein ? dein#is_sourced('tagbar') : get(g:, 'loaded_tagbar')
244 | endfunction
245 |
246 | function! lightline#delphinus#components#tagbar_status(current, sort, fname, ...) abort
247 | let g:lightline.fname = a:fname
248 | return lightline#statusline(0)
249 | endfunction
250 |
251 | function! lightline#delphinus#components#gitgutter_pre() abort
252 | let g:lightline_delphinus_gitgutter_context = get(g:, 'gitgutter_hook_context', {})
253 | call lightline#update()
254 | endfunction
255 |
256 | function! lightline#delphinus#components#gitgutter() abort
257 | if !g:lightline_delphinus_gitgutter_enable || !get(g:, 'loaded_gitgutter') || &filetype =~# 'gundo\|fzf\|tagbar\|denite' || winwidth(0) < 120
258 | return ''
259 | endif
260 | let ctx = get(g:, 'lightline_delphinus_gitgutter_context', {})
261 | let nr = get(ctx, 'bufnr', -9999)
262 | if nr == -9999 || nr != bufnr('%')
263 | return ''
264 | endif
265 | let hunks = gitgutter#hunk#hunks(nr)
266 | if len(hunks) == 0
267 | return ''
268 | endif
269 | let gitgutter_status = {'added': 0, 'modified': 0, 'removed': 0, 'modified_removed': 0}
270 | for [line1, num1, line2, num2] in hunks
271 | if num1 == 0
272 | let gitgutter_status['added'] += num2
273 | elseif num1 < num2
274 | let gitgutter_status['added'] += num2 - num1
275 | let gitgutter_status['modified'] += num1
276 | elseif num1 == num2
277 | let gitgutter_status['modified'] += num1
278 | elseif num2 == 0
279 | let gitgutter_status['removed'] += num1
280 | else
281 | let gitgutter_status['modified_removed'] += num1 - num2
282 | endif
283 | endfor
284 | return printf('%s %d %s %d %s %d %s %d',
285 | \ g:gitgutter_sign_added, gitgutter_status['added'],
286 | \ g:gitgutter_sign_modified, gitgutter_status['modified'],
287 | \ g:gitgutter_sign_removed, gitgutter_status['removed'],
288 | \ g:gitgutter_sign_modified_removed, gitgutter_status['modified_removed'])
289 | endfunction
290 |
291 | function! lightline#delphinus#components#signify() abort
292 | if !g:lightline_delphinus_signify_enable || !get(g:, 'loaded_signify') || &filetype =~# 'gundo\|fzf\|tagbar\|denite' || winwidth(0) < 120
293 | return ''
294 | endif
295 | let [added, modified, removed] = sy#repo#get_stats()
296 | " this means signify does not recognize diffs.
297 | if added == -1
298 | return ''
299 | endif
300 | return printf('%s %d %s %d %s %d',
301 | \ g:signify_sign_add, added,
302 | \ g:signify_sign_change, modified,
303 | \ g:signify_sign_delete, removed)
304 | endfunction
305 |
--------------------------------------------------------------------------------
/bin/dump.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | from pathlib import Path
3 | from subprocess import run
4 | from textwrap import dedent
5 |
6 | NORD1 = "#3B4252"
7 |
8 |
9 | def nord_improved() -> None:
10 | filename = (
11 | Path(__file__).resolve().parent.parent
12 | / "autoload/lightline/colorscheme/nord_improved.vim"
13 | )
14 | func = "lightline#delphinus#colorscheme#nord_improved#palette"
15 | script = f'call writefile([{func}()], "{filename}")'
16 | run(f"vim +'{script}' +q", shell=True)
17 | colors = filename.read_text().strip()
18 | filename.write_text(
19 | dedent(
20 | f"""
21 | " DO NOT EDIT THIS FILE
22 | " generated by bin/dump.py
23 | let g:lightline#colorscheme#nord_improved#palette={colors}
24 | if get(g:, 'nord_uniform_status_lines')
25 | let g:lightline#colorscheme#nord_improved#palette.inactive.middle[0][1]='{NORD1}'
26 | endif
27 | """
28 | )
29 | )
30 | print("write successfully nord_improved")
31 |
32 |
33 | def solarized_improved() -> None:
34 | filename = (
35 | Path(__file__).resolve().parent.parent
36 | / "autoload/lightline/colorscheme/solarized_improved.vim"
37 | )
38 | func = "lightline#delphinus#colorscheme#solarized_improved#palette"
39 | script = f'call writefile([{func}()], "{filename}", "a")'
40 | filename.write_text(
41 | dedent(
42 | """
43 | " DO NOT EDIT THIS FILE
44 | " generated by bin/dump.py
45 | if &background ==# 'dark'
46 | let g:lightline#colorscheme#solarized_improved#palette="""
47 | ).strip()
48 | )
49 | run(f"vim +'set bg=dark' +'{script}' +q", shell=True)
50 | with open(filename, "a", encoding="utf-8") as f:
51 | f.write(
52 | dedent(
53 | """
54 | else
55 | let g:lightline#colorscheme#solarized_improved#palette="""
56 | ).strip()
57 | )
58 | run(f"vim +'set bg=light' +'{script}' +q", shell=True)
59 | with open(filename, "a", encoding="utf-8") as f:
60 | f.write("endif")
61 | print("write successfully solarized_improved")
62 |
63 |
64 | if __name__ == "__main__":
65 | nord_improved()
66 | solarized_improved()
67 |
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/delphinus/lightline-delphinus/7a8fb34cfd2baedbbf5ae2b94982f6c7fb8c3c6e/demo.gif
--------------------------------------------------------------------------------
/plugin/lightline_delphinus.vim:
--------------------------------------------------------------------------------
1 | " =============================================================================
2 | " Filename: plugin/lightline_delphinus.vim
3 | " Author: delphinus
4 | " License: MIT License
5 | " Last Change: 2019-10-03T17:36:26+0900.
6 | " =============================================================================
7 |
8 | scriptencoding utf-8
9 |
10 | if exists('g:loaded_lightline_delphinus')
11 | finish
12 | endif
13 | let g:loaded_lightline_delphinus = 1
14 |
15 | let s:save_cpo = &cpoptions
16 | set cpoptions&vim
17 |
18 | let g:lightline_delphinus_use_powerline_glyphs = get(g:, 'lightline_delphinus_use_powerline_glyphs', 0)
19 | let g:lightline_delphinus_use_nerd_fonts_glyphs = get(g:, 'lightline_delphinus_use_nerd_fonts_glyphs', 0)
20 |
21 | if g:lightline_delphinus_use_powerline_glyphs
22 | let s:separator = {'left': '', 'right': ''}
23 | let s:subseparator = {'left': '', 'right': ''}
24 | else
25 | let s:separator = {'left': '', 'right': ''}
26 | let s:subseparator = {'left': '|', 'right': '|'}
27 | endif
28 |
29 | let g:lightline_delphinus_colorscheme = get(g:, 'lightline_delphinus_colorscheme', 'solarized_improved')
30 | if g:lightline_delphinus_colorscheme !=# 'solarized_improved' && g:lightline_delphinus_colorscheme !=# 'nord_improved'
31 | call lightline#error('g:lightline_delphinus_colorscheme must be solarized_improved (default) or nord_improved')
32 | endif
33 |
34 | let g:lightline_delphinus_tagbar_enable = get(g:, 'lightline_delphinus_tagbar_enable', 0)
35 | let g:tagbar_status_func = 'lightline#delphinus#components#tagbar_status'
36 |
37 | let g:lightline_delphinus_gitgutter_enable = get(g:, 'lightline_delphinus_gitgutter_enable', 0)
38 |
39 | let g:lightline_delphinus_signify_enable = get(g:, 'lightline_delphinus_signify_enable', 0)
40 |
41 | let g:lightline = get(g:, 'lightline', {
42 | \ 'colorscheme': g:lightline_delphinus_colorscheme,
43 | \ 'active': {
44 | \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'gitgutter', 'signify' ], [ 'filepath' ], [ 'filename', 'currenttag', 'ale_error', 'ale_warning', 'ale_ok' ] ],
45 | \ 'right': [
46 | \ [ 'lineinfo' ],
47 | \ [ 'percent' ],
48 | \ [ 'char_code', 'fileformat', 'fileencoding', 'filetype' ],
49 | \ ],
50 | \ },
51 | \ 'inactive': {
52 | \ 'left': [ [ 'filepath' ], [ 'filename' ] ],
53 | \ 'right': [ [ 'lineinfo' ], [ 'percent' ] ],
54 | \ },
55 | \ 'component_function': {
56 | \ 'modified': 'lightline#delphinus#components#modified',
57 | \ 'readonly': 'lightline#delphinus#components#readonly',
58 | \ 'fugitive': 'lightline#delphinus#components#fugitive',
59 | \ 'filepath': 'lightline#delphinus#components#filepath',
60 | \ 'filename': 'lightline#delphinus#components#filename',
61 | \ 'fileformat': 'lightline#delphinus#components#fileformat',
62 | \ 'filetype': 'lightline#delphinus#components#filetype',
63 | \ 'fileencoding': 'lightline#delphinus#components#fileencoding',
64 | \ 'mode': 'lightline#delphinus#components#mode',
65 | \ 'char_code': 'lightline#delphinus#components#charcode',
66 | \ 'lineinfo': 'lightline#delphinus#components#lineinfo',
67 | \ 'percent': 'lightline#delphinus#components#percent',
68 | \ 'currenttag': 'lightline#delphinus#components#currenttag',
69 | \ 'gitgutter': 'lightline#delphinus#components#gitgutter',
70 | \ 'signify': 'lightline#delphinus#components#signify',
71 | \ },
72 | \ 'component_function_visible_condition': {
73 | \ 'mode': 1,
74 | \ 'currenttag': 0,
75 | \ 'char_code': 0,
76 | \ 'fileformat': 0,
77 | \ 'filetype': 0,
78 | \ 'fileencoding': 0,
79 | \ },
80 | \ 'component_expand': {
81 | \ 'ale_error': 'lightline#delphinus#components#ale_error',
82 | \ 'ale_warning': 'lightline#delphinus#components#ale_warning',
83 | \ 'ale_ok': 'lightline#delphinus#components#ale_ok',
84 | \ },
85 | \ 'component_type': {
86 | \ 'ale_error': 'error',
87 | \ 'ale_warning': 'warning',
88 | \ 'ale_ok': 'ok',
89 | \ },
90 | \ 'separator': s:separator,
91 | \ 'subseparator': s:subseparator,
92 | \ })
93 |
94 | augroup LightLineOnALE
95 | autocmd!
96 | autocmd User ALEFixPre call lightline#delphinus#components#ale_pre()
97 | autocmd User ALEFixPost call lightline#delphinus#components#ale_post()
98 | autocmd User ALELintPre call lightline#delphinus#components#ale_pre()
99 | autocmd User ALELintPost call lightline#delphinus#components#ale_post()
100 | autocmd User GitGutter call lightline#delphinus#components#gitgutter_pre()
101 | autocmd User Signify call lightline#delphinus#components#signify()
102 | augroup end
103 |
104 | let &cpoptions = s:save_cpo
105 | unlet s:save_cpo
106 |
--------------------------------------------------------------------------------