Closed matthias-t closed 5 years ago
That's intended behavior. I'm trying to keep the few keybindings simple and essentially emulate the behavior of nano's ^O
in this case.
I'm certainly willing to add new keybinds if they make sense (a Ctrl
+f
would certainly be in scope), but not just to save one RET
keystroke.
If there has to be one shortcut for saving, then in my opinion it shouldn't be save as. I've probably saved a million things in my life, but I've only used save as once or twice. As I see it Smith is a minimal editor, with a carefully selected set of features, that doesn't cover every edge case; and saving to another file is an edge case. If it ever occurs, all it takes is a cp
.
We're veering into bike-shedding territory here, but I tried to give the idea a fair hearing.
So I've been taking a look back at some of the text editors that share the scope, and using the latest micro I've found that I quite like the ^S
to save or prompt if we don't know the filename. It does break my flow a little less than nano when editing multiple files.
Ultimately the goal is to be unsurprising with the keybinds, and looking at the software I have around ^S
is indeed usually an immediate save.
So I guess in the end I do agree with this change.
If I run
smith file.rs
, make some changes and hit Ctrl+s a prompt appears asking where to save to. Maybe there could be a separate shortcut for Save As, like Ctrl+Shift+S?