zed
zed copied to clipboard
Option to disable auto-indentation
Check for existing issues
- [X] Completed
Describe the feature
I would like to disable auto-indentation either entirely for the whole editor or per language.
I generally prefer no auto-indentation but having this option would also allow for a straight forward workaround in case of issues with the auto-indentation logic (like here #10832).
If applicable, add mockups / screenshots to help present your vision of the feature
No response
If you need a reason or a test - try pasting in yaml files. Holy smokes, is this annoying.
What's the status on this? I literally jump back-and-forth between IDEs because of the (hella annoying) auto-indentation... T_T
Got the same behavior for Haskell: Trying to paste
write2log :: Monad m => String -> LoggT m ()
write2log = undefined
to the beginning of the line where the cursor is
instance (MonadFail m) => MonadFail (LoggT m) where
fail = LoggT . fail
^ here
to get it like:
instance (MonadFail m) => MonadFail (LoggT m) where
fail = LoggT . fail
write2log :: Monad m => String -> LoggT m ()
write2log = undefined
but the editor pastes it here:
instance (MonadFail m) => MonadFail (LoggT m) where
fail = LoggT . fail
write2log :: Monad m => String -> LoggT m ()
write2log = undefined
The behavior is similar to this: https://github.com/zed-industries/zed/issues/13338#issue-2365404299
Basically, I want to paste my code wherever the cursor is.
Sublime text solves it like this:
- Just paste your content like it is: ctrl + v
- Paste your content with automatic identation: ctrl + shift + v
really convinient
Just to add, I am not entirely sure we are all asking about the same. In principle, I was asking about a way to disable auto-indentation while editing. The fact that this would be a workaround for issues with indention upon pasting was meant as a bonus.
Same issue with auto-indent being applied when pasting, albeit I can only get it to reproduce with TypeScript files. I tried YAML, but it was not reproducible there.
Any movement on this?
It's becoming incredibly frustrating when writing Makefiles, eg:
all:
$(HIDE)| <-- automatically dedents here
side-note: this particular situation could be a problem with the Make extension? but afaik it contains no code, only language *.scm stuff, which is over my head.
Same problem in Python
Seems like a duplicate of https://github.com/zed-industries/zed/issues/11780, which was fixed in https://github.com/zed-industries/zed/pull/36259.
"auto_indent": false
in my settings.json works like a charm.
Since this is closed, is there another open issue for the ctrl+v/ctrl+shift+v difference for automatic indentation when pasting? Turning off auto-indent completely isn't a solution for some of the cases folks have commented here about.