599 reputation
512
bio website patrickoscity.de
location Germany
age
visits member for 3 years, 3 months
seen Dec 2 at 12:36

Oct
13
awarded  Good Answer
Feb
10
awarded  Notable Question
Feb
8
awarded  Yearling
Jan
9
revised oh-my-zsh history completion
spelling
Dec
15
comment Removing the useless space at the end of the right prompt of zsh ($RPROMPT)
Thanks for posting the link. Looking forward to the next release!
Dec
14
answered Removing the useless space at the end of the right prompt of zsh ($RPROMPT)
Nov
2
comment Vim: auto-comment in new line
I accepted your answer because you were very helpful! I want to improve on this steadily, so I made it a plugin and hosted it on Github github.com/padde/UncommEnter.vim. It fixes the remapping problem (caused by Pope's Endwise plugin). You're probably right that &commentstring may not be the way to go. I will search for alternatives. Thanks for all the effort!
Nov
2
accepted Vim: auto-comment in new line
Nov
2
comment Vim: auto-comment in new line
Works great, except: The languages I mentioned were only examples, it should work with any language. I implemented this with &commentstring, see my own answer. Unfortunately, Vim won't let me remap <CR> for reasons i do not understand. Other mappings, e.g. <CR><CR> work fine. Would you maybe know where to look for errors?
Nov
2
answered Vim: auto-comment in new line
Nov
1
comment Vim: auto-comment in new line
I mean in C it should match // and /* and * (multiline comments) and in ruby # and so on
Nov
1
comment Vim: auto-comment in new line
Thanks looks great! Will try when i get home. Do you know a way to extend the regex to match comment markers language independently? The information should be there in the syntax files or something. Maybe i can leverage the syntax feature for this...
Nov
1
comment Vim: auto-comment in new line
Ok this has another problem, it will prevent adding any newline if the line is empty. A general solution is to use <Esc>S inside the mapping which will not delete the line if it is empty.
Nov
1
comment Vim: auto-comment in new line
I tried inoremap <CR><CR> <CR><C-u> but the delay is very annoying, unfortunately :(
Nov
1
comment Vim: auto-comment in new line
Well additionally, it should only trigger if the commented line is empty. A noticeable delay when hitting <Enter> is also unacceptable.
Nov
1
comment Vim: auto-comment in new line
@EtanReisner that's actually better, but still one keystroke too much for me since it is such a common use case :)
Nov
1
comment Vim: auto-comment in new line
I actually want Vim to add the comment markers for me, I love this. But i also want a quick way to exit the comment. Thanks for your answer though.
Nov
1
asked Vim: auto-comment in new line
Nov
1
awarded  Commentator
Oct
30
accepted Tmux copy-pipe with mouse selection