Comments (33)
phew - thanks for helping make falcon better 👍
from falcon.
Yeah I really need to add in a bit more detail on how to set this up as it's a bit fiddly.
So to get the whole inactive / active thing going you need:
- NeoVim (not supported in Vim)
- 24-bit color working inside of tmux, inside of vim
- the latest version of falcon which makes this stuff configurable:
Line 22 in b9b186b
- in your tmux config somewhere:
set -g window-style "bg=#151521"
set -g window-active-style "bg=#020221"
- in your NeoVim config:
"24bit color
set termguicolors
let g:falcon_lightline = 1
let g:lightline.colorscheme='falcon'
let g:falcon_background = 0
let g:falcon_inactive = 1
colorscheme falcon
(the lightline stuff is optional)
Let me know if you have all of the above and how you go.
from falcon.
So I updated my NeoVim (built from source, latest commit) and checked for truecolor:
Everything seems to be ok. (Left is Terminal inside NeoVim and right is pure shell)
echo exists('+winhighlight')
returns 1 and g:falcon_inactive
is equal 1 (and g:falcon_background
is 0);
I've imported the falcon theme into iTerm as mentioned in the Wiki. The Tmux Panes seem ok.
from falcon.
Oh, that was the other thing, need to be on a recent version of NeoVim (note to self). I am on v0.3.1.
from falcon.
I'm guessing my colors might be a bit off. Comparing my screenshot to the one on the README, I've noticed the current active tmux window should be orange and mine is grey (on TMUX, that is):
Mine | README |
---|---|
My NeoVim is v0.3.2:
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20180822-82772-1ggjmf4/build/config -I/tmp/neovim-20180822-82772-1ggjmf4/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180822-82772-1ggjmf4/build/src/nvim/auto -I/tmp/neovim-20180822-82772-1ggjmf4/build/include
Compiled by filipekiss@urbosa
Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-012cd35/share/nvim"
Run :checkhealth for more info
from falcon.
hah, sorry, screenshot is slightly behind - I have gone back to grey.
from falcon.
in my tmux conf I currently have this:
source-file ~/Documents/Work/internal/vim/colors/falcon/tmux/falcon.tmux.conf
# the following is falcon colour specific
set -g status-left "#[fg=white] #S #[fg=#57575e]│ "
set -g status-right "#(~/.config/tmux/itunes_current_track.zsh) #[fg=#57575e]│ #(~/.config/tmux/tw_status.sh) #[fg=#57575e]│ #[fg=white]%d/%m/%Y %H:%M "
set -g status-right-length 200
from falcon.
So I am importing the falcon one then overwriting the status a bit since I have a script to show the itunes track and a taskwarrior script.
from falcon.
Yeah, I'm starting to guess it's more a NeoVim issue than a Falcon one.
Can you confirm something for me? Open a Tmux window, split it in two and open an empty Buffer on NeoVim and then focus the other pane. Does NeoVim change the bg color to the Inactive one?
from falcon.
Yeah, it works perfectly for me.
The key to the way it works is that NeoVim should only set the background for inactive buffers and leave the background unset otherwise, thus taking it's colour from Tmux which will be either the Tmux inactive colour or the Tmux active colour.
It used to be that there was no background set anywhere in falcon, however, I noted that had some issues in certain places so now, the background is set for Normal
and NonText
but is then unset via the plugin/falcon.vim
file which looks at the settings.
So the tests I would run, would be:
- open up NeoVim just in iTerm2, no Tmux - does the active inactive thing work?
- open up three iTerm2 instances, check that the background colour in NeoVim, Tmux inside of Neovim and iTerm2 all match
- open up Tmux inside of iTerm2, make some splits, check that the colours change as expected
- open up NeoVim inside of Tmux (no extra splits), check that the colours changes as expected
- open up NeoVim inside of Tmux, two splits (one NeoVim, one shell), create two splits in NeoVim, check that moving between NeoVim splits and Tmux works as expected re active / inactive
from falcon.
I remember I had some interesting issues at one stage due to iTerm2 background being wrong (I have sinced moved away from iTerm2 for performance reasons).
from falcon.
Actually I have this in my config:
"turn off the cursorline when not in a window
autocmd InsertLeave,WinEnter * set cursorline
autocmd InsertEnter,WinLeave * set nocursorline
from falcon.
maybe that is forcing an extra redraw?
from falcon.
And also this for reloading files, probably not relevant:
" Reload when gaining focus
autocmd FocusGained,BufEnter * :silent! !
from falcon.
So, here's the deal:
Opened nvim
outside tmux, just iTerm and split in 3 (Active Pane is bottom-right):
Then, I manually ran hi ActiveWindow guibg=NONE | hi InactiveWindow guibg=#151521
and it becomes like this (Active Pane is bottom-right):
Better, but if the bottom-right pane is the inactive one, only the first line stays inactive
(Active Pane is top):
Same thing if I ran this inside tmux
from falcon.
Also I should note that I copied the autocmds you suggested before trying this, so they're definetely not the responsibles for doing this
from falcon.
can you possibly post a link to your nvim config?
from falcon.
it looks like to me that the falcon plugin (vs the colorscheme) isn't doing it's thing
from falcon.
essentially this code:
" NeoVim has support for changing background colour depending on active or not
if !exists('g:falcon_inactive')
let g:falcon_inactive = 0
endif
if exists('+winhighlight') && g:falcon_inactive == 1
hi ActiveWindow guibg=NONE | hi InactiveWindow guibg=#151521
set winhighlight=Normal:ActiveWindow,NormalNC:InactiveWindow
endif
" Put in a background colour for gui
if !exists('g:falcon_background')
let g:falcon_background = 1
endif
if !has("gui_running") || g:falcon_background == 0
hi NonText guifg=#36363a ctermfg=237 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
hi Normal guifg=#b4b4b9 ctermfg=249 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
endif
from falcon.
My vim config is kinda huge. I've disabled all plugins to see if something was conflicting but still no luck. I'm loading it via vim-plug. I'll try to run the plugin code manually and see if it works, hang on.
from falcon.
thanks
from falcon.
I am using plug, but I am just including it ala:
Plug '~/Documents/Work/internal/vim/colors/falcon'
from falcon.
I've put just this on my .vimrc
:
set termguicolors
hi ActiveWindow guibg=NONE | hi InactiveWindow guibg=#151521
and of course it works!. It's surely something I'm not setting up properly. Time to dive down the rabbit hole and try to find it!
Thank you for you help @fenetikm! As soon as I find out what's causing this I'll post a comment!
from falcon.
Great - progress!
If you look in the falcon repo, you will see that there is plugin/falcon.vim
- my suggestion would be to check if that is being called and when. Also what the values are of the global variables, especially if it is hitting that line that you have just manually added in. Maybe pepper the code with echom
statements or what have you.
Would be great if you can post back here and so I can write up a separate wiki page on getting this all working.
from falcon.
So, a few things I've picked up (and I wasn't really able to determine the issue yet):
- If I do not load my
plugin/color.vim
file, the whole inactive thing works as expected - If I load the file mentioned above, the "dimming" of the background color stops working
- Weirdly enough, what makes the whole thing stops working is
colorscheme falcon
I'll try to run the colorscheme command somewhere else and see if it's the loading order that's causing this.
Ran :scriptnames
and the plugin/falcon.vim
is being loaded way before the color.vim
and the color scheme itself
from falcon.
So I've managed to get it working by making the background check run at VimEnter
:
diff --git i/plugin/falcon.vim w/plugin/falcon.vim
index d128335..fda9487 100644
--- i/plugin/falcon.vim
+++ w/plugin/falcon.vim
@@ -1,3 +1,8 @@
+if exists('g:loaded_falcon')
+ finish
+endif
+let g:loaded_falcon=1
+
" required as colors will come from terminal without
let g:fzf_colors =
\ { 'fg': ['fg', 'Comment'],
@@ -29,11 +34,16 @@ if !exists('g:falcon_background')
let g:falcon_background = 1
endif
-if !has("gui_running") || g:falcon_background == 0
+function! s:setColors(...)
hi NonText guifg=#36363a ctermfg=237 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
hi Normal guifg=#b4b4b9 ctermfg=249 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
+endfunction
+
+if !has("gui_running") || g:falcon_background == 0
+ autocmd VimEnter,FocusGained * call s:setColors()
endif
+
" NeoVim terminal colors
if has ("nvim")
let g:terminal_color_0 = '#000004'
This makes everything working as expected inside TMUX, but still not working outside TMUX. I'll let you know if I find anything else.
from falcon.
hrm, what is currently in your color.vim
file?
I just made a minimal .vimrc
:
set nocompatible " disable compatibility with vi
syntax enable "enable syntax highlighting
" Assumes vim-plug is installed.
call plug#begin()
Plug 'fenetikm/falcon'
call plug#end()
"enable 24bit support.
set termguicolors
" enables the active / inactive functionality.
let g:falcon_background = 0
let g:falcon_inactive = 1
colorscheme falcon
... and everything works fine. It's sounding like something clobbering the falcon plugin code... and so expected behaviour of sorts.
from falcon.
My color.vim
has only this:
if has('termguicolors')
set termguicolors
end
try
colorscheme falcon
catch
colorscheme ron
endtry
So here's the thing: In tmux it works fine but outside tmux it does not. My understanding is that TMUX is able to set the inactive pane BG to a certain color (and when the vim pane has it's BG set to NONE you see that color) whereas iTerm isn't able to do that. I really don't care about this since I never work outside TMUX but I'd be happy to continue debugging if you think it's worth.
from falcon.
Oh when you say it doesn't work outside of Tmux in iTerm - are you referring to iTerm splits? If that's the case then yeah, that isn't supported AFAIK.
I'll try modifying my falcon plugin to use an autocmd approach like you have above and then hopefully we can call it day ;)
from falcon.
No, I actually mean vim splits:
I'm guessing the command sare depending on it being loaded on a specific order. I've tried the vim syntax test and the groups for ActiveWindow and InactiveWindow were not being set properly withouth the autocmd
(Just to be clear: If I make autocmd
for both color setting options we have in the plugin, it works flawlessly).
If you wish I can open a pull-request with the autocmd
patch :)
Thank you so much for your patience!
from falcon.
Ok, cool, thanks for the clarification.
All good re the PR - no need to bother.
I want to see it with my own eyes first ;)
from falcon.
Ok, develop
branch now has the autocmd version. Also added in your guard statement which is always a good idea. I removed FocusGained - felt that might be a bit much.
Let me know what you think.
from falcon.
develop
is hella fine! Working perfectly! Thank you. 🙏
from falcon.
Related Issues (20)
- Nvim-cmp support
- Nvim-Notify support
- Telescope support
- LSP Highlighting broken on 0.6.0 HOT 1
- LS_COLORS settings
- Falcon color-scheme is just black and white. Cant get the appropriate colorscheme. HOT 2
- [v3] Migrate to Lush - Base HOT 1
- QT and GTK theme created with omoox [enhancement]
- [v3] Pull in plugin settings to Lush HOT 1
- [v3] Pull in language syntax settings to Lush HOT 1
- [v3] Output kitty conf via Lush HOT 1
- [v3] Neovim terminal colours, treesitter colours and misc. HOT 1
- [v3] settings for text styles, italic, bold etc. HOT 1
- [v3] Output vim file via shipwright HOT 1
- [v3] Shipwright runner for iterm HOT 1
- [v3] update documentation
- [v3] Check hsl vs original colours for sameness
- set guibg when termguicolors is enabled?
- Update falcon colorscheme to remove obsolete TS* highlight groups HOT 3
- Invalid character in group name HOT 6
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 falcon.