3 ms·
> overhead when pasting code No sure I get what you mean. I pasted a lot of code in PHP and Python, and in both case you have to select the pasted block and ad
by gbog 15y ago
> overhead when pasting code
No sure I get what you mean. I pasted a lot of code in PHP and Python, and in both case you have to select the pasted block and adjust left or right according to the change of depth level.
> people being unhappy with being "forced" to [indent]
Well, then why the Hell would these people be happy to be forced to write { and } around their blocks?
For me, there is one little annoyance with indent as syntax in Python, it is that it is harder for my editor (Vim) to let me jump from def to the end of the function, and the reverse. (Or there is a conf, a plugin I missed? I know about indent folding, but I just want % to behave like if I had curlies.)
- parfe 15y ago>I pasted a lot of code in PHP and Python, and in both case you have to select the pasted block and adjust left or right according to the change of depth level. Yes, you readjust the PHP for aesthetics. Not for correctness of execution. In vim, if I recall(emacs for a while now), =G auto formats bracketed code without issue. Pasting code, deleting enclosing block, adding an enclosing block, or highlighting a mismatched bracket (when formatting goes horribly wrong) can be handled automatically.
- gbog 15y ago> Yes, you readjust the PHP for aesthetics Here we differ. A code uncorrectly indented is wrong for me, and must be corrected right now. I don't care at all if it runs or not.
- parfe 15y agoif user_set_delete: logger.info("User set flag to delete file") delete_file() vs if($user_set_delete===True){ log("User set flag to delete file"); delete_file(); } "Correct" and "looks good" can have very different consequences. Acting like proper indentation for looks is on the same level as proper indentation for execution is ignoring the real dangers of improperly indented python. I know copying that php block will not change the execution, no matter how it is formatted vs copying python where I need to guarantee I've got it right. Hence "some overhead".
- headhuntermdk 15y agoActually if user_set.delete: logger.info("User set flag to delete file") delete_file() Becomes: if ($user_set_delete==True){ log("user set flag to delete file") } delete_file();
- Pewpewarrows 15y ago[[ and ]] will jump to the start of the previous and next block, respectively. This gets you most of the way there. If you want true % movement for Python, look no further than: http://www.vim.org/scripts/script.php?script_id=386 http://www.vim.org/scripts/script.php?script_id=386 But really the plugin you should get and master is EasyMotion. Like vim in general, using it is going to feel painful for the first day or so. Between that plugin and auto-folding, I've never needed to use another movement command again.