Home  >  Q&A  >  body text

vimrc - How to set gvim to automatically indent and start a new line when the cursor wraps in an html tag?

This is the effect inside brackets

This is the effect after gvim line break. How to set it up to look like brackets.

巴扎黑巴扎黑2712 days ago950

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 16:36:37

    If the effect is as shown in the picture below, please refer to the code and set the .vimrc file

    set tabstop=4
    
    set expandtab
    set softtabstop=4  "表示在编辑模式的时候按退格键的时候退回缩进的长度,当使用 expandtab 时特别有用。
    set shiftwidth=4   "表示每一级缩进的长度一般设置成跟 softtabstop 一样。 当设置成 expandtab 时,缩进用空格来表示,noexpandtab 则是用制表符表示一个缩进。
    
    set autoindent
    set cindent  "针对C语言自动缩进
    

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 16:36:37

    https://github.com/othree/htm...

    This will be the case by default when using this plug-in,

    let g:html_exclude_tags = ['html', 'style', 'script', 'body']
    

    Use this variable to control tags that do not require indentation

    reply
    0
  • Cancelreply