Let $m\geq 0,n\geq 1$ be fixed integers. I want to compute the determinant of the $(2n+m)\times (2n+m)$ matrix given by $$a_{ij}=\left\{\begin{array}{cl}n+m & \text{if }i=j\leq 2n,\\ 2n& \text{if }i=j> 2n,\\ 0 & \text{if $i\neq j$ and $i,j\leq n$, $n< i, j\leq2n$ or $2n<i,j$,}\\ -1 &\text{otherwise.}\end{array}\right.$$ So, it's the sum of a matrix with diagonal blocks $0$ and every other block $-1$, and a diagonal matrix with the first $2n$ elements being $n+m$ and the rest $2n$.
Or just: $$\begin{bmatrix}D_n({n+m}) & -1 & -1\\ -1 & D_{n}(n+m) & -1\\ -1 & -1 & D_m({2n}) \end{bmatrix}$$
where $D_r(s)$ denotes the diagonal $r\times r$ matrix with diagonal $s$.
I'd like to use something like this, but here the blocks have different sizes and there are some rectangular ones, too.
For the context, I was trying to compute the number of spanning trees of the tripartite graph $K_{n,n,m}$ using the Matrix-Tree Theorem and ended up with that.
One detail is that in the problem I have to remove a row and a column corresponding to one vertex, which I choose to be the last one, but the resulting matrix is still with the same form. Also, for the case of $m=0$ ($m=1$ in the problem) this can be easily solved by this (or any) method since there are only 4 blocks, all of which have the same size, commute and are very simple.
If you're using the matrix tree theorem, then you've forgotten to delete one row and one column; the determinant of your current matrix is $0$, because the all-ones vector is in the null space.
But in general, we can compute the determinant of an $(m+n+p)\times (m+n+p)$ matrix of the form $$ \begin{bmatrix}aI_m & -1 & -1 \\ -1 & bI_n & -1 \\ -1 & -1 & cI_p\end{bmatrix} $$ by looking at the eigenvalues.
First of all, $a$, $b$, and $c$ are each eigenvalues with multiplicity $m-1,n-1,p-1$ respectively. (Or, if $a=b$ as in this case, we add the multiplicities.) To see this, just subtract the appropriate multiple of the identity matrix and look at the rank.
The remaining three eigenvalues come from the block structure. The block matrix acts on a vector of the form $(x,x,\dots,x, y,y,\dots, y,z,z,\dots,z)$ in exactly the same way that the $3\times 3$ matrix $$ \begin{bmatrix} a & -n & - p \\ -m & b & -p \\ -m & -n & c \end{bmatrix} $$ acts on the vector $(x,y,z)$. So just compute the determinant of this $3\times 3$ matrix, multiply by $a^{m-1}b^{n-1}c^{p-1}$, and you get the determinant of the original block matrix.