Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
Visual Studio how to stop indentation formatting on select javascript code?

I'm keen to know whether there is a way to stop Visual Studio Cntl + K + D hot function from resetting the indentation of my code for certain code sections?

Example is when I write html in javascript code, to make it more readable i like to apply my own indentations, as shown below:

let html =
    '<div class="d-flex flex-column" style="height: 100%">' +
        '<div class="d-flex">' +
            '<div class="icon-heading">' +
                '<i class="fa-solid fa-clipboard-list fa-1x"></i>' +
                '<h6 class="ms-2 mt-2">User Ack Notes</h6>' +
                '<!-- spinner = see layout.cshtml file -->' +
            '</div>' +
        '</div>' +
    '</div>;

But as soon as i hiy Cntrl + K + D then VS will automatically remove these indentations, as shown below:

enter image description here

This is very annoying and would be great if some kind of a js tag could be added to stop VS from applying the removal of indentations. I often use Cntrl + K + D to tidy up all other code blocks so I couldnt afford to simply remove the code tidy up feature.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda