惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
V
V2EX
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
F
Full Disclosure
Y
Y Combinator Blog
V
V2EX - 技术
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
SecWiki News
SecWiki News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
量子位
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AWS News Blog
AWS News Blog
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
K
Kaspersky official blog
B
Blog
A
Arctic Wolf
Hacker News: Ask HN
Hacker News: Ask HN
L
LangChain Blog
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
Lohrmann on Cybersecurity
D
Docker
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy International News Feed
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - ScorpioLove

一个小题目 [面试]内存泄漏查找位置 1000 的阶乘有几位数? - 后续, 求解 终于又能登录了 ASCII Table 排列组合 模拟"九连环"的小算法 1000 的阶乘有几位数? 总结一下最近做得事 Debian 下安装 Java 开发环境 Debian etch 下安装配置支持 CJK 的 tex 系统 行频、场频与分辨率、刷新率 一些 Java 语言的基础细节 Some good articles for me Vim 命令 Big Integer Multiplication [转]Debian/Ubuntu下tetex3的gbk字体配置方法 - giv@kyxk.net [转]FVWM的配置文件 - archerC@kyxk.net I do
[转] vim 中关于 tab 的使用技巧
ScorpioLove · 2006-11-06 · via 博客园 - ScorpioLove

原文链接:http://blog.rogerz.cn/archives/375

1. 设定 tab 的位置

:set tabstop=4

2. 输入 tab 时自动将其转化为空格

:set expandtab

如果此时需要输入真正的 tab,则输入 Ctrl+V, tab,在 Windows 下是 Ctrl+Q, tab

3. 将已存在的 tab 都转化为空格

:retab

4. 设定编辑模式下 tab 的视在宽度

:set softtabstop

这不改变 tabstop,但让编辑的时候 tab 看起来是指定的宽度,输入 tab 时会插入的 tab 和空格的混合,比如 tabstop=4softtabstop=10,那么插入 tab 时会将光标移动 10 个字符,可能会是两个 tab 加两个空格,这对 backspace 也有效。

5. 解决 shiftwidth 和 tabstop 不等时的麻烦

:set smarttab

在行首输入 tab 时插入宽度为 shiftwidth 的空白,在其他地方按 tabstop 和 softtabstop 处理

6. 将 tab 显示为可见字符

:set list listchars=tab:>-

tab 将被显示为 >—- 的形式

7. 只在编辑特定类型的文件时展开 tab

将如下代码加入 ~/.vimrc

autocmd FileType * set tabstop=4|set shiftwidth=4|set noexpandtab
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab

参考文章:

  1. VIM Tip#12
  2. :help tabstop