X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=internal%2Fconfig%2Fsettings.go;h=a775a1c0fd519db83feba6d162882e5d4d781d7e;hb=4027081e0e31ec90050f51209c4888def57ac1cb;hp=2d0787a9fb10f72fe5a7cf1c5ff3b6d46fc8f814;hpb=7cd5024e34e99a5d53e7d6beaec7810d9948df6b;p=micro.git diff --git a/internal/config/settings.go b/internal/config/settings.go index 2d0787a9..a775a1c0 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -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()