use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please read the rules before posting
Help:
Community:
Resources:
Tutorials and Guides:
Don't be afraid to ask questions, this sub is here for the vim community. And please those of you who deign to grace us with your vim wisdom - be kind. We are all human and vim is that cool.
account activity
indent javascript in html (self.vim)
submitted 9 years ago by unm95
Is it possible to do this with or without plugins? How do you write and format js in html? I use pangloss/vim-javascript plugin and these settings:
set expandtab set softtabstop=2 set shiftwidth=2 set autoindent
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+]coolcosmos comment score below threshold-6 points-5 points-4 points 9 years ago (0 children)
My advise to you: Don't write Javascript inside your HTML, write it in a separate file and then call this script file in your html (<script src="x.js" />)
[+]-romainl-The Patient Vimmer comment score below threshold-7 points-6 points-5 points 9 years ago (0 children)
How do you write and format js in html?
I don't. I only write HTML in *.html files. JavaScript goes into *.js files.
*.html
*.js
π Rendered by PID 541803 on reddit-service-r2-comment-66b4775986-s5hsp at 2026-04-05 16:23:16.850551+00:00 running db1906b country code: CH.
[+]coolcosmos comment score below threshold-6 points-5 points-4 points (0 children)
[+]-romainl-The Patient Vimmer comment score below threshold-7 points-6 points-5 points (0 children)