Detecting the alternate lfrc
files in text editors - a common file name extension?
#1944
Replies: 2 comments 2 replies
-
As a collaborator and someone who is quite involved in maintaining the project these days, I'll add my thoughts here. Regarding the extension itself, I think I prefer
Since users are actually allowed to name their config file whatever they want (can be specified using the diff --git a/os.go b/os.go
index ff3669e..7007779 100644
--- a/os.go
+++ b/os.go
@@ -92,7 +92,9 @@ func init() {
gConfigPaths = []string{
filepath.Join("/etc", "lf", "lfrc"),
+ filepath.Join("/etc", "lf", "config.lf"),
filepath.Join(config, "lf", "lfrc"),
+ filepath.Join(config, "lf", "config.lf"),
}
gColorsPaths = []string{
diff --git a/os_windows.go b/os_windows.go
index dac8f44..60f15f8 100644
--- a/os_windows.go
+++ b/os_windows.go
@@ -78,7 +78,9 @@ func init() {
gConfigPaths = []string{
filepath.Join(os.Getenv("ProgramData"), "lf", "lfrc"),
+ filepath.Join(os.Getenv("ProgramData"), "lf", "config.lf"),
filepath.Join(data, "lf", "lfrc"),
+ filepath.Join(data, "lf", "config.lf"),
}
gColorsPaths = []string{ Apart from that the only other things that needs changing is updating the documentation and renaming the files in the In any case, this kind of change is big in terms of the fundamental design, and also low-priority. So I would prefer to keep this as a discussion for now before making any changes. |
Beta Was this translation helpful? Give feedback.
-
Seems like the
|
Beta Was this translation helpful? Give feedback.
-
Discussion raised related to this PR for plugin that provides the lf configuration file (
lfrc
) syntax highlighting in Vim and Neovim:Match all files ending with lfrc by DusanLesan · Pull Request #11 · andis-sprinkis/lf-vim
There is a demand for storing, editing and loading different
lfrc
files than the$HOME/.config/lfrc
file.Any of these files should be handled in a text editor as an
lfrc
format file (highlighting, toggling comments, LSP etc.).The most typical way to detect text file formats are by their file name extension.
The Vim highlighting plugin I currently look after only checks for a full file name
lfrc
.This can be added at the top of the
lf
config filesfor Vim, Neovim and such, but most other text editors and syntax highlighters don't check for these headers.
Besides the currently used file name
lfrc
, I suggest having an agreed-upon file format extension for the alternate lf configuration files e.g.windows.lfrc
orwindows.lf
.@gokcehan what are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions