zoukankan      html  css  js  c++  java
  • vim tab转换成space

    在Vim中,有时需要将tab转换成space。

    使用ret命令(replace tab)。

    [range]ret[ab]! [new-tabstop]

    举例:将第一行到文件尾的tab转换成space,每个tab用4个space替代。

    :set expandtab
    :%ret! 4

    如果没有给定4,则用当前的tab宽度设定替换为space。

    相关配置文件命令:

    :set tabstop=4 设定tab宽度为4个字符

    :set shiftwidth=4 设定自动缩进为4个字符

    :set expandtab 用space替代tab的输入

    :set noexpandtab 不用space替代tab的输入

    WARNING: No any other purpose,keeping reminded! So sorry to offended,if necessary, contact me and I do change what I had done to protect your privileges!
  • 相关阅读:
    表连接问题
    public interface Serializable?标记/标签接口
    4.21
    第十周周记
    测试
    第九周周记
    第七周周记
    fighting.
    fighting
    作业一
  • 原文地址:https://www.cnblogs.com/MimiSnowing/p/13436865.html
Copyright © 2011-2022 走看看