Skip to content

Commit e828aee

Browse files
committed
indent: README update
1 parent 5f8fa16 commit e828aee

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,39 @@ With Vundle
2323
" inside .vimrc
2424
Plugin 'pboettch/vim-cmake-syntax'
2525

26+
## Indentation
27+
28+
There is also an indent file which does some intelligent alignment.
29+
30+
For control-keywords (`if`, `while`, `foreach`, `macro`, etc) it automatically adds a
31+
`shiftwidth()` (and substracts it for a `end`-keyword).
32+
33+
For commands (so everything which has arguments between parenthesis `(...)`) is tries to do the following.
34+
35+
Either it aligns all arguments on a new line in the same column as the opening parenthesis if the first argument is on the
36+
same line as the command:
37+
38+
```cmake
39+
add_custom_target(TARGET name
40+
DEPENDS target
41+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
42+
```
43+
44+
or it indents it with one additional `shiftwidth()` if the first argument is on a new line
45+
46+
```cmake
47+
add_custom_target(
48+
TARGET name
49+
DEPENDS target
50+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
51+
```
52+
2653
## Test
2754

2855
There is a ever growing test-suite based on ctest located in test/
2956

3057
cd <build-dir-where-ever-located>
3158
cmake path/to/this/repo/test
3259
ctest
60+
61+

0 commit comments

Comments
 (0)