3 ms·
I'm intrigued. How do you search and replace in nano and how can it be better than `:%s/<regex>/<replacement>/gc`? I thought search and replacement was one of t
by aflag 5y ago
I'm intrigued. How do you search and replace in nano and how can it be better than `:%s/<regex>/<replacement>/gc`? I thought search and replacement was one of the killer features of vim.
- bear8642 5y agoSearch replace in nano via "Where is" (^W), "Replace" (^R), "Regexp"(M-R).
- edoceo 5y agoI can't remember how but nano has the bottom two lines showing common actions and their key-commands, so the answer is on screen.
- aflag 5y agoNano is definitely more friendly for the untrained user, but I thought they were saying it was better for a user that is well versed in both.
- tpoacher 5y agoIn nano the equivalent command (as keystrokes) would be: '^\' (or 'M-R') to enter 'replace' mode <search term> (M-R to toggle 'regex' mode on off) <replacement> 'A' to 'replace all' (or you can replace interactively) And if you really want to shave off the extra 2 keystrokes for the 'M-R' toggle and 'A' option, you can always create a new macro in your config file that does just that.