Supplementing Benjamin Lindqvist's answer with the details of how this can be shown in this case from first principles. All this assuming that the codes are to be binary for larger field alphabets the claim is false.
Assume that a binary linear code $C$ of length $n=k+2$, dimension $k$ and minimum distance $d\ge3$ exists. The code is defined by two check equations, so its parity check matrix $H$ has type $2\times n$. In particular its columns consist of two bits each, so they all are one of $\binom 0 0$, $\binom 0 1$, $\binom 1 0$, $\binom 1 1$.
Obviously $H$ cannot contain a column $\binom 0 0$. For if column $i$ were all zeros, then the code $C$ would have a word of weight one, with the sole $1$ at position $i$. Less obvious but still not difficult to see is that $H$ cannot have two equal columns. For if the columns $i$ and $j$ were equal, then the vector $x$ of weight two with ones at positions $i$ and $j$ would satisfy the equation $Hx^T=\binom 0 0$. Meaning that $x\in C$, in violation of the assumption that the minimum weight of $C$ is $\ge3$.
So all the $n$ columns of $H$ are non-zero and distinct. Therefore there can be at most three of them. In other words $3\ge n=k+2$ and $1\ge k$.