Comments (5)
I don't support such custom color modes, because it might force lightline colorscheme creators to support endless request for each window types. Having said that, you can use lightline#link
to change the colors to a Vim mode from component functions, and there is an example in the help for CtrlP plugin to make the statusline look like insert/replace mode even if it is actually in the normal mode. The argument of lightline#link
should be one of the Vim modes, but configuring the internal g:lightline._mode_
might work as you expected.
from lightline.vim.
Thanks. I feel this fear might be a bit unfounded, especially considering that many colorschemes don't even support all the modes (I'm seeing that terminal is quite underused), but obviously I won't push.
Also given this, I've decided to add some colors to the terminal mode to the wombat
colorscheme, and opt them in for my preview window. I have then added a new function in place of the default 'mode'
; hopefully what I did is correct:
function! PreviewWindowMode()
if &previewwindow
call lightline#link('t')
return "PREVIEW [" . lightline#mode() . "]"
else
return lightline#mode()
endif
endfunction
Thanks again for the help!
from lightline.vim.
@itchyny Sorry to bother you again; I was wondering (since I wasn't able to figure it out) if there was a way to also override the inactive
state?
from lightline.vim.
That's impossible unfortunately, there is only one mode for the active window. Although the modes and inactive are both keys for the colorscheme palette, they are totally different concept. Three "mode" (active
, inactive
, tabline
) to switch the components and colors, and lightline#link
links the colors of the active
window statusline to that for the Vim modes (normal
, insert
, etc).
from lightline.vim.
I see. In a bit of a hacking attempt I have made the following patch to lightline#update()
:
for n in range(1, winnr('$'))
let z = (n!=w)
if has_key(s:lightline, 'inactive_override') && z == 1
let z = eval(s:lightline['inactive_override'] . '(' . n . ')')
endif
call setwinvar(n, '&statusline', s[z])
endfor
It seems to work in my case by setting:
function! MyOverride(n)
return !getwinvar(a:n, '&previewwindow')
endfunction
let g:lightline = {
\ ...
\ 'inactive_override': 'MyOverride'
\ }
Do you think I'm risking lightline breaking horribly with this? Thanks again for the help!
from lightline.vim.
Related Issues (20)
- [Feature request] Formal arguments in component_function HOT 5
- Calling lua function from `g:lightline` config HOT 9
- Powerline transparent colorscheme
- bug : Undefined variable: g:lightline HOT 2
- Calling 'vim.diagnostic.goto_next()' inactivates lightline HOT 7
- Update tabline color on mode change HOT 3
- Lineinfo column doesn't match cursor column position HOT 2
- incorrect branch name on Gsplit HOT 4
- `component_function` does not accept vim9 function HOT 1
- `laststatus=2` doesn't seem to be working HOT 1
- extra spaces from lightline-problem-12 HOT 1
- All Highlighted/Selected Character Count? HOT 6
- middle active/inactive items missing from statusline HOT 7
- Using `vim.lsp.buf.hover()` breaks lightline. HOT 8
- How to use Catppuccin theme on lightline?
- Returning a statusline item from a component function HOT 2
- theme support for grubbox HOT 2
- How do I ignore certain filetypes? HOT 2
- Changing the color of modified file symbol HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightline.vim.