Shortcuts/Snippets to select a block of code
Using Autohotkey, I was able to develop a solution to select a block of code and here is the script I have:

!b::

send ^f

sendraw ^\r$

send {F3}

send +{F3}

send {Esc}

send {down}

send ^{=}

return


Specifically, pressing Alt + B will invoke this script, and the script will select the block of code where the cursor is in. Note that the block of code has to be separated from other blocks of code by blank lines, and the block of code cannot have blank of lines inside itself.

The key steps of the about script are 


using regular expression "^\r$
" to locate the blank lines above and below the cursor
moving the cursor to these two blank lines one by one
using ctrl + = to select the block of code between these two blank lines.


Note that !/^/+ are alt/ctrl/shift separately.