A gift for frequent print debuggers who use vim:
type ! and insert a line with print(LINE NUMBER)
au FileType rust nmap ! :s/^/\=printf("println!(\"%d\");\n", line('.'))<CR>
au FileType go nmap ! :s/^/\=printf("fmt.Println(\"%d\")\n", line('.'))<CR>
etc...
#vim #debugging
-
Show this thread
-
for prepending the filename, too: au FileType rust nmap ! :s/^/\=printf("println!(\"%s:%d\");\n", expand('%'), line('.'))<CR>
1 reply 2 retweets 2 likesShow this thread
Replying to @sadisticsystems
Just realized that with rustfmt the indentation issues are also solved. Super neat!
10:01 AM - 11 Apr 2018
from Berlin, Germany
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.