I am editing my markdown files which contain some code examples (like here). Is there any way to tell vim, when it is editing markdown files, to set textwidth=80 to everything except where I keep my code syntax? So for example:
Here is a text within a markdown file // textwidth=80
puts 'Hello World' // textwidth is not specified

puts 'Hello World'is code in Markdown?