博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vim常用的方法
阅读量:7243 次
发布时间:2019-06-29

本文共 427 字,大约阅读时间需要 1 分钟。

hot3.png

1 vim下格式整个代码文件

从别的编辑器里粘贴到vim里的代码经常由于不正常的缩进变得格式混乱。在vim的官方FAQ ()找到的:

格式化全文: gg=G

自动缩进当前行: ==

这个是原文节选:

14.6. How do I format/indent an entire file?

You can format/indent an entire file using the gg=G command, where
     gg - Goto the beginning of the file
     =   - apply indentation
     G   - till end of file
For more information, read
     :help gg
     :help =
     :help G
     :help 'formatprg'
     :help C-indenting

转载于:https://my.oschina.net/u/1024767/blog/372860

你可能感兴趣的文章
PostgreSQL 如何潇洒的处理每天上百TB的数据增量
查看>>
架构师画像
查看>>
一分钟了解阿里云产品:消息队列
查看>>
(二十三)变量名的命名
查看>>
如何保证摘除公网EIP的容器服务VPC集群可以正常访问公网
查看>>
linux进程状态浅析
查看>>
【JavaScript】DOM节点常用方法介绍02
查看>>
非官方统计2018微信年度账单实现
查看>>
微信小程序练手 demo 之天气小程序总结(流水账)
查看>>
异步操作系列之Generator函数与Async函数
查看>>
水平无限循环弹幕的实现
查看>>
老前端出坑小程序(一)
查看>>
别躲了,机器知道你们的关系
查看>>
mac配置完ssh依然提示"Enter passphrase for key"解决方法
查看>>
java面试
查看>>
前端日刊君来也
查看>>
20190119杂七杂八
查看>>
Here are some practical JavaScript objects that have encapsulation (翻译)
查看>>
C# 通过反射创建实例
查看>>
Android Lifecycle结合RxJava&Retrofit实现安全的网络回调
查看>>