69 lines
2.5 KiB
Markdown
69 lines
2.5 KiB
Markdown
up::[[vim plugins]]
|
|
link::https://github.com/tweekmonster/braceless.vim
|
|
title::"pour les langages à indentation sémantique"
|
|
#s/informatique/vim
|
|
|
|
----
|
|
Plugin pour mieux gérer les langages où l'indentation est sémantique (python...)
|
|
|
|
- Meilleurs motions (`[[` pour les définitions python etc.)
|
|
- text objects intelligents (blocks de codes plutôt que par indentation)
|
|
|
|
# Features
|
|
You can use `:BracelessEnable +feature` to enable `feature`
|
|
|
|
## Text objects
|
|
- more intelligent than indented blocks
|
|
- actual code blocks using `iP` and `aP`
|
|
|
|

|
|
|
|
## Object motions
|
|
- move between blocks : `[[` and `]]` (any keyword)
|
|
- move to `def` and `class`
|
|
- `]m` and `[m` : beginning of these blocks
|
|
- `]M` and `[M` : end of these blocks
|
|
|
|

|
|
|
|
## Folding
|
|
- intelligent folding by adding `+fold`
|
|
- **exciting** details in `:h braceless-folds`
|
|
|
|

|
|
|
|
## Indent guide
|
|
- enable with `+highlight`
|
|
- enable `colorcolumn` so the guide can span the height of the window
|
|
- for other filetypes : [[vim plugin local-indent]]
|
|
|
|

|
|
|
|
## Somewhat intelligent auto-indent
|
|
- intelligent autoindent when adding `+indent`
|
|
- pep8 indentation built-in
|
|
- temporarily the [[vim plugin delimitMate|delimitMate]] `expand_cr` when messing with block arguments (multi-line arguments)
|
|
|
|

|
|
|
|
(The backspace key was never used in the image above)
|
|
|
|
## EasyMotion
|
|
- Built-in support for EasyMotion
|
|
- search for important blocks (`def`, `class`)
|
|
|
|

|
|
|
|
## Not just Python!
|
|
Braceless can simply recognize indentation.
|
|
|
|

|
|
|
|
The above GIF was using:
|
|
|
|
```
|
|
autocmd FileType haml,yaml,coffee BracelessEnable +indent +fold +highlight
|
|
```
|
|
|
|
You can extend Braceless to give full support to other indented languages. See `:h braceless-custom`
|