Web Development workflow

58 views
Skip to first unread message

Sayth Renshaw

unread,
Aug 4, 2012, 1:41:13 AM8/4/12
to vim...@googlegroups.com
Looking for some basic advice tips on how you manage a web development workflow in vim. Do you start and manage your server from within vim to debug and preview your pages as you edit them.

Besides the obvious HTML & CSS I also use JQuery. At TAFE/college I have been using visual studio. I want to rebuild this site open source. 

Cheers

Sayth

Tim Chase

unread,
Aug 4, 2012, 8:35:32 AM8/4/12
to vim...@googlegroups.com, Sayth Renshaw
It may depend largely on your web-dev framework. If it's just raw
HTML/CSS/jQuery, I'd likely just have the files checked out of
revision control (you are planning to use revision control, right?)
and edit them, refreshing the browser in another window as-needed.

I happen to do my web development in the Python framework Django
which offers a development server that notices most changes and
automatically refreshes, making development almost as easy as the
static-file method. I just have one terminal in which I've got my
development server (I can look over there for debugging output as
well), one terminal/window running Vim, and one window for my
browser which I can refresh as-needed. I don't know Rails, but I
think it offers a similar dev-server for testing locally.

For things like PHP or other languages, I'd advise setting up a
local PHP server (whether Apache, nginx, etc) and then every time I
save to the local PHP project's directory, refresh against the local
server.


That said, once I have things working on my local machine, the good
version gets checked into source control. I happen to use git, but
would also recommend Bazaar or Mercurial; so I've been
check-pointing all along into a "development" branch, and then merge
the good version into the "master" release branch. I can then
manually (or automatically, if I've set up some
continuous-integration machine to test/deploy) perform a checkout of
the release branch on the actual server to pull down all the latest
updates without releasing intermediate versions.

So the setup is

- one terminal/window for Vim
- one terminal/window for administrative/VCS stuff
- one window for the browser
- optionally a window for your dev-server if needed

Occasionally, I'll multiplex the 3 terminal windows with "screen"
(others use tmux) into one actual terminal window.

-tim




flebber

unread,
Aug 5, 2012, 9:39:01 PM8/5/12
to vim...@googlegroups.com, Sayth Renshaw
On Saturday, 4 August 2012 22:35:32 UTC+10, Tim Chase wrote:
> On 08/04/12 00:41, Sayth Renshaw wrote: > Looking for some basic advice tips on how you manage a web > development workflow in vim. Do you start and manage your server > from within vim to debug and preview your pages as you edit > them. > > Besides the obvious HTML & CSS I also use JQuery. At TAFE/college > I have been using visual studio. I want to rebuild this site open > source. It may depend largely on your web-dev framework. If it's just raw HTML/CSS/jQuery, I'd likely just have the files checked out of revision control (you are planning to use revision control, right?) and edit them, refreshing the browser in another window as-needed. I happen to do my web development in the Python framework Django which offers a development server that notices most changes and automatically refreshes, making development almost as easy as the static-file method. I just have one terminal in which I've got my development server (I can look over there for debugging output as well), one terminal/window running Vim, and one window for my browser which I can refresh as-needed. I don't know Rails, but I think it offers a similar dev-server for testing locally. For things like PHP or other languages, I'd advise setting up a local PHP server (whether Apache, nginx, etc) and then every time I save to the local PHP project's directory, refresh against the local server. That said, once I have things working on my local machine, the good version gets checked into source control. I happen to use git, but would also recommend Bazaar or Mercurial; so I've been check-pointing all along into a "development" branch, and then merge the good version into the "master" release branch. I can then manually (or automatically, if I've set up some continuous-integration machine to test/deploy) perform a checkout of the release branch on the actual server to pull down all the latest updates without releasing intermediate versions. So the setup is - one terminal/window for Vim - one terminal/window for administrative/VCS stuff - one window for the browser - optionally a window for your dev-server if needed Occasionally, I'll multiplex the 3 terminal windows with "screen" (others use tmux) into one actual terminal window. -tim


Thanks Tim.

I initially was going to use git. I have recently joined Ubuntu Accomplishments and they use bazaar which i have no idea on at the moment so may proceed to use bazaar so I can reduce the number of new things i need to learn currently and come back to git later.

As for frameworks I am still reviewing, I did like the looks of Pyramid http://www.pylonsproject.org/ but I haven't dismissed Django. Pyramid being already python 3 compliant and its modularity and apparent freedom to let the user pick and choose its components seesms attractive.

I installed Xampp to handle the server. Of course being on ubuntu I could have done this individually but thought that it provided a good consistent option if i was working on windows as well.

I know pyramid features an overlay debugging toolbar on the rendered webpage, how would you handle debuging?

Sayth

Tim Chase

unread,
Aug 6, 2012, 7:19:47 AM8/6/12
to vim...@googlegroups.com, flebber
> I initially was going to use git. I have recently joined Ubuntu
> Accomplishments and they use bazaar which i have no idea on at
> the moment so may proceed to use bazaar so I can reduce the
> number of new things i need to learn currently and come back to
> git later.

Both are worth learning. If you already know Subversion or CVS,
then Bazaar and Mercurial are a bit easier to learn, IMHO. I find
git a bit more powerful (particularly the ease with which you can
make sub-file commits; this was what finally made git's "index"
click for me as something valuable rather than something to grouse
about).

I've not probed the edges of it, but you may want to try the
vcsplugin for Vim which facilitates using any of them.

> As for frameworks I am still reviewing, I did like the looks of
> Pyramid http://www.pylonsproject.org/ but I haven't dismissed
> Django. Pyramid being already python 3 compliant and its
> modularity and apparent freedom to let the user pick and choose
> its components seesms attractive.

Both are good frameworks. As you've picked up, Pylons/Pyramid was
much more a-la-carte where you pick your various components; while
Django is more monolithic (though, just being Python, nothing stops
you from using other components).

> I know pyramid features an overlay debugging toolbar on the
> rendered webpage, how would you handle debuging?

Both have debugging toolbars which are helpful. I tend to do the
"print" style debugging to dump stuff to my devserver's console, but
the debugging toolbars and Python's "logging" module are both
helpful too. I used to try "import pdb; pdb.set_trace()" at areas
of interest, but older versions of Django's runserver had problems
(raw terminal control issues) with it--I don't know if that's improved.

-tim





Reply all
Reply to author
Forward
0 new messages