https://github.com/pinaki82/indent-code
A Vim plugin to indent code.
https://github.com/pinaki82/indent-code
Last synced: 5 months ago
JSON representation
A Vim plugin to indent code.
- Host: GitHub
- URL: https://github.com/pinaki82/indent-code
- Owner: Pinaki82
- License: cc0-1.0
- Created: 2021-01-05T09:29:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-26T13:25:50.000Z (almost 5 years ago)
- Last Synced: 2025-10-17T12:18:14.931Z (9 months ago)
- Language: Vim script
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# indent-code
A Vim plugin to indent code. Indents code while saving a file.
Write the following lines to your .vimrc for convenience.
```
filetype plugin indent on
set autoindent
set smartindent
set copyindent " copy the previous indentation on autoindenting
set preserveindent " save as much indent structure as possible
set tabstop=2 " a tab is two spaces
set shiftwidth=2 " number of spaces to use for autoindenting
set softtabstop=2
```
Vim can indent lines of codes from the Normal mode with a key sequence.
In Normal mode:
Type
```
gg
```
Then type
```
=G
```
To indent code from the Command mode using this plugin, type:
```
:IndentCode
```
Or access it from the menu bar option.