1. I am not doing this and have never done that.

2. When I was working and looking outside the window.

I have made up these examples. I want to know if the first sentence is grammatical or do we need "I" before "have" in the first sentence. And does the second sentence mean "when I was working and I was looking outside the window"? Is the second sentence idiomatic?

  • 1
    2) is not a sentence. You can google complex relative clauses and sentences. – Lambie Jun 6 at 23:01

Both of those examples mean what you thought, and they are more idiomatic when they don't repeat the "I" unnecessarily. Example 2 is a clause, not a sentence.
A complete sentence would be:
"It happened when I was working and looking out the window."

| improve this answer | |
  • Well Jack someone did not like our answers for some unexplained reason.. I think yours is a perfectly good answer, and I am upvoting it. – Jeff Morrow Jun 7 at 3:12
  • +1 thanks for answering :-) – user116295 Jun 7 at 6:37
  • @JeffMorrow Likewise. – Jack O'Flaherty Jun 7 at 19:32

They are idiomatic. There is no necessity to repeat the subject if the same subject applies to multiple verbs in the same clause. This can get confusing if a sentence or clause gets lengthy so you may repeat the subject and should do so if you think there may be uncertainty about the subject. But in short sentences or clauses like your examples, it is much more common to avoid the repetition.

| improve this answer | |
  • +1 :-), thanks for answering. – user116295 Jun 7 at 6:36
  • Yes, they also downvoted my question for no reasons. – user116295 Jun 7 at 6:37
  • 1
    @Acash I see no reason whatsoever to downvote your question. It is clear and on topic. I'll upvote it. – Jeff Morrow Jun 7 at 14:03
  • @JeffMorrow Likewise again. – Jack O'Flaherty Jun 7 at 19:33