diff --git a/cmd/micro/search.go b/cmd/micro/search.go index 734c0712..227e3af9 100644 --- a/cmd/micro/search.go +++ b/cmd/micro/search.go @@ -84,6 +84,9 @@ func Search(searchStr string, v *View, down bool) { str = text[:searchStart] } r, err := regexp.Compile(searchStr) + if settings["ignorecase"].(bool) { + r, err = regexp.Compile("(?i)" + searchStr) + } if err != nil { return } diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index 7283694d..bc0d4d17 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -75,6 +75,7 @@ func DefaultSettings() map[string]interface{} { "colorscheme": "default", "tabsize": float64(4), "indentchar": " ", + "ignorecase": false, "autoindent": true, "syntax": true, "tabsToSpaces": false, diff --git a/runtime/help/help.md b/runtime/help/help.md index 853a00e2..4a9d113a 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -182,6 +182,10 @@ Here are the options that you can set: default value: ` ` +* `ignorecase`: perform case-insensitive searches + + default value: `off` + * `syntax`: turns syntax on or off default value: `on`