Here is a quick example of how to recreate weighted regression without needing the weights=... part of lm(). It also shows how to set up your own intercept in R.
x0=rep(1,100) #specify the intercept because they multiply by the weights
summary(lm(y~0+X)) # this is to show a different way of setting up the intercept in R
summary(lm(y~0+X, weights=w)) #with weights=....
summary(lm(y2~0+X2)) #without weights=...