hiyang

对于已保存的文件,可以使用下面的方法进行空格和TAB的替换


TAB替换为空格:
:set ts=4
:set expandtab
:%retab!

空格替换为TAB:
:set ts=4
:set noexpandtab
:%retab!

 

在linux环境下,作为python开发环境,设置的.vimrc

set autoindent     " 换行自动缩进
set shiftwidth=4   " 自动缩进时的宽度
set ts=4           " tabstop的宽度
set expandtab      " tab换成空格  
set softtabstop=4  " 退格键
set paste          " 粘贴时不自动换行
View Code

 

分类:

技术点:

相关文章:

  • 2021-11-09
  • 2021-11-09
  • 2022-12-23
  • 2021-11-09
  • 2021-10-15
  • 2022-12-23
  • 2021-10-18
  • 2021-11-20
猜你喜欢
  • 2021-08-14
  • 2021-11-09
  • 2022-01-25
  • 2021-12-12
  • 2022-01-19
相关资源
相似解决方案