6 ms·
I tried CoPilot a while and my biggest gripe was tab for accepting the suggestion. I very often got a ton of AI garbage when I was just trying to indent some co
by boxed 2y ago
I tried CoPilot a while and my biggest gripe was tab for accepting the suggestion. I very often got a ton of AI garbage when I was just trying to indent some code.
Tab just doesn't seem like the proper interface for something like this.
- MaikuMori 2y agoDoesn't exactly fix the issue, bout you can cancel the suggestion with ESC and then press Tab. Changing the shortcut should be possible, but I haven't tried.
- boxed 2y agoIt's a timing issue too. Your hand can be travelling to the keyboard and between that and registering in the OS the AI suggestion inserted itself inbetween.
- fstephany 2y agoYou are not alone!
- ljm 2y agoI actually wish more editors had emacs style indenting where hitting tab anywhere on the line would re-indent it or otherwise cycle through indent levels if it was unclear, especially because you’re unlikely to get copilot suggestions in the middle of a word. Plus, it doesn’t break if there’s a syntax error elsewhere in the file.
- fhd2 2y agoIt's one of those weird Emacs things that you get _so_ used to that everything else seems to waste your time. Using code formatters and formatting on save or with a shortcut is OK, but not really the same to me. That's probably why I'm stuck with Emacs: 1. No need to use the mouse. 2. Extremely efficient keyboard usage (maybe not the most efficient, but compared with common IDEs, certainly). Makes it feel like I'm actually using a brain computer interface. The somewhat regular yak shaving is a bit of a bummer though. I like that I can modify everything to be exactly how I like it, but I wouldn't mind sensible defaults. Haven't found a distribution yet that works well without tinkering.
- ljm 2y agoExactly, and sometimes I don't want to save a file just for indentation to happen as a side-effect, especially if I can do `C-x H TAB` to correctly re-indent the entire thing. That's particularly more helpful when some formatters will actually rewrite your code to either break lines up or squish things back into a one-liner.
- boxed 2y agoOh, didn't know about that. That makes a lot of sense. Reminds me of how hitting cmd+c on a line in PyCharm copies the entire line if there is no selection. Because what else would make sense?
- yencabulator 2y agoI thought that was a great feature. Now I'm writing mostly languages with well-defined formatting rules and simply never need tab. This is even better.
- janaagaard 2y agoAfter using Prettier to format my code and turning on format-on-save, I pretty much don’t use the tab key anymore. This doesn’t invalidate your point, - I am merely guessing as to why the tab key seemingly has been reassigned.
- moritzruth 2y agoCtrl+Return works quite well for me in IntelliJ.
- Mashimo 2y ago> to indent some code. Why are you manually indenting code? I don't remember ever doing that in IDEA or VS Code for ~~python,~~ java or ts. Edit: I borked about python, my bad.
- rfoo 2y agoFor example, you have if check_something(): wall_of_text = textwrap.dedent(""" this is a multiline string """.strip("\n")) I hope you agree it's ugly. And you want to make it if check_something(): wall_of_text = textwrap.dedent("""\ this is a multiline string """.strip("\n")) But I don't know any formatter which does this automatically. Because the change here not only changes the looking, it changes semantic. The formatter has to understand that after `textwrap.dedent(_.strip("\n"))` the result does not change and that's hard. So formatter just leave it alone. But it's extremely obvious to a human. Or maybe extremely obvious to a LLM too.
- Mashimo 2y agoYeah, string """ blocks I also have to do manually. Though that example never interfered with AI autocomplete in my experience.
- oneeyedpigeon 2y agoIsn't indentation 'non deterministic' in Python? E.g. if I have the following: if (foo): bar() hum() how can anything other than a human decide if that 3rd line should be indented as it is or by one more level?
- saghm 2y agoEven humans have trouble with that sometimes: https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html https://www.blackduck.com/blog/understanding-apple-goto-fail...
- 2y ago
- madmulita 2y agoDon't give them ideas! I can already see the useless AI key next to Fn in my next keyboard.
- card_zero 2y agoThat already happened, just over a year ago, we have Copilot keys now. I guess it invokes the AI rather than controling it, maybe there'll be another key soon.
- yencabulator 2y agoSee, you're thinking of Microsoft Copilot, but code completion is provided by Github Copilot, so it'll need its own key. Which will also be labeled Copilot.
- as-cii 2y agoHey! Zed founder here. We totally agree with this and that's why Zed will switch the keybinding for accepting an edit prediction to `alt-tab` when the cursor is in the leading whitespace of a line. This way you can keep using `tab` for indenting in that situation. Also, when there's both an edit prediction and and LSP completion, Zed switches the keybinding to `alt-tab` to prevent the conflict with accepting an LSP completion. Curious to hear what you think!
- maxloh 2y agoHi. Could you explain how you plan to make money with the model while open-sourcing it? It seems contradicting to me.
- recov 2y agoNot everyone can, or wants to set up running a local model. And it'll probably be slower on most users GPUs then what zed runs it on.
- danielsamuels 2y agoFor reasons that should be obvious, that's not going to work on Windows.
- as-cii 2y agoSorry, I assumed macOS: but you're right! For Linux (and Windows, once we ship support for it) the keybinding is alt-l to avoid conflicting with tab switching.
- deleted 2y ago[deleted]
- VWWHFSfQ 2y agoIs there way to change this key binding (tab for accept) right now? Because otherwise I have to stop using this program. It is absolutely obnoxious.
- 2y ago
- daliusd 2y agoYes, copilot's tab in vim is that made me think that AI is useless. However next iteration of AI coding tools made me rethink this (I am using https://github.com/olimorris/codecompanion.nvim https://github.com/olimorris/codecompanion.nvim with nvim now).
- windward 2y agoAI coding tool implementers seem to be fans of novel editor fonts.
- marcosdumay 2y agoIt's way better than the other Microsoft favorites of space and enter... It's as if people developing autocomplete doesn't really code.
- relistan 2y agoYeah, IMO tab makes no sense for this as the default. Since I code in Go and use tabs regularly, I remapped my auto-complete AI key for Supermaven in Neovim to ctrl-L which I have no other occasion to use regularly. Now tab works properly and I can get auto-complete.