]> git.lizzy.rs Git - micro.git/blobdiff - internal/config/settings.go
Add linter plugin support
[micro.git] / internal / config / settings.go
index 2d0787a9fb10f72fe5a7cf1c5ff3b6d46fc8f814..a775a1c0fd519db83feba6d162882e5d4d781d7e 100644 (file)
@@ -140,7 +140,6 @@ func DefaultCommonSettings() map[string]interface{} {
                "eofnewline":     false,
                "fastdirty":      true,
                "fileformat":     "unix",
-               "hidehelp":       false,
                "ignorecase":     false,
                "indentchar":     " ",
                "keepautoindent": false,
@@ -153,10 +152,12 @@ func DefaultCommonSettings() map[string]interface{} {
                "scrollbar":      false,
                "scrollmargin":   float64(3),
                "scrollspeed":    float64(2),
-               "softwrap":       false,
                "smartpaste":     true,
+               "softwrap":       false,
                "splitbottom":    true,
                "splitright":     true,
+               "statusformatl":  "$(filename) $(modified)($(line),$(col)) $(opt:filetype) $(opt:fileformat) $(opt:encoding)",
+               "statusformatr":  "$(bind:ToggleKeyMenu): show bindings, $(bind:ToggleHelp): toggle help",
                "statusline":     true,
                "syntax":         true,
                "tabmovement":    false,
@@ -193,14 +194,27 @@ func DefaultGlobalSettings() map[string]interface{} {
        return common
 }
 
+// LocalSettings is a list of the local only settings
+var LocalSettings = []string{"filetype", "readonly"}
+
 // DefaultLocalSettings returns the default local settings
 // Note that filetype is a local only option
 func DefaultLocalSettings() map[string]interface{} {
        common := DefaultCommonSettings()
        common["filetype"] = "unknown"
+       common["readonly"] = false
        return common
 }
 
+func DefaultAllSettings() map[string]interface{} {
+       global := DefaultGlobalSettings()
+       local := DefaultLocalSettings()
+       for k, v := range global {
+               local[k] = v
+       }
+       return local
+}
+
 func GetNativeValue(option string, realValue interface{}, value string) (interface{}, error) {
        var native interface{}
        kind := reflect.TypeOf(realValue).Kind()