Open caleb531 opened 7 years ago
Any update on this subject ? This really anoying when using dotfiles to sync atom configs between devices. Thanks!
@jeannnemelanie Fortunately, I've discovered a clever workaround by using some git config:
First, create a file called .gitattributes
in the same directory as your atom config.cson
# Ignore linter-ui-default's panelHeight setting in Atom config
config.cson filter=strip-panel-height
Secondly, add the following lines to your global .gitconfig
# Ignore linter-ui-default's panelHeight setting in Atom config
[filter "strip-panel-height"]
clean = sed '/ panelHeight:/d'
You can also set this from the Terminal if you don't have a global gitconfig already managed in your dotfiles:
git config --global filter.strip-panel-height.clean "sed '/ panelHeight:/d'"
Git should now ignore changes to any line containing panelHeight
in config.cson.
Currently, panelHeight is editable when you resize it. This is a config that is set by you. If we don't store this in the config.cson, it will become only a local value. Is this desirable?
@caleb531 thanks for the tip! I've never used .gitattributes
. I will give it a try for sure!
@aminya in my case, I never decided to set panelHeight
. I actually ticked alwaysTakeMinimumSpace
and hidePanelWhenEmpty
. Of course alwaysTakeMinimumSpace
and hidePanelWhenEmpty
should be stored in config.cson
but I don't think it's relevant for panelHeight
whose value is changing all the time (depending on the file I'm working on and even the errors/warnings on the files). As @caleb531 said, storage
directory (or something like that) looks like a better solution for this special case.
OK. Thanks for providing more context.
We should use LocalStorage instead.
@caleb531 Thanks for that git config! That's almost exactly what I was looking for. I just wanted to point out two things:
Quote the clean
command. I tried to add a semicolon to the sed
script, but it wouldn't work and it took me a while to figure out the problem.
[filter "strip-panel-height"]
clean = "sed '/ panelHeight:/d'"
I noticed that the showPanel
setting is also volatile (FYI @aminya), so I excluded it as well like this:
in the same directory as config.cson
config.cson filter=strip-Atom-config-volatile-settings
in .git/config
[filter "strip-Atom-config-volatile-settings"]
# Ignore linter-ui-default's panelHeight and showPanel settings in Atom config
clean = "sed '/\\spanelHeight:/d; /\\sshowPanel:/d'"
# Based on caleb531's comment on GitHub:
# https://github.com/steelbrain/linter-ui-default/issues/435#issuecomment-778731834
(I also switched the spaces to \s
(whitespace) just in case of hard tabs in config.cson.)
Hi, @steelbrain.
I am a frequent Atom and Linter user. I have all of my
~/.atom
config (*.cson
files) stored in my dotfiles repository for easy management and syncing across my two machines. However, I am often committing changes toconfig.cson
because thepanelHeight
forlinter-ui-default
has changed:I suspect this happens because my panel height on one machine differs from the panel height on my other machine. Regardless, I'd much prefer if the value for this field was stored outside of
config.cson
(maybe in thestorage/
directory or something).config.cson
should really only be for non-volatile configuration, butpanelHeight
definitely feels like a volatile (i.e. easily-changing) field.Thanks, Caleb