Torill,
My standard practice is to create an app for each of my widget development efforts and open the widget from that apps widgets folder in my IDE (i.e. C:\web-appbuilder-1.2\server\apps\3\widgets\eSearch).
But as you are asking for a way to not do this then you would do exactly what you are doing but you would have to manually add your widget to the sample-configs/config-demo.json or create your own folder and json for your widget development like widget-dev/config.json. The down side to your approach is as a good widget developer you should be developing the widget settings UI at the same time you are developing the widgets UI and when using the webappviewer you are only testing the actual widget UI and you will not see or access the widgets setting UI.