cours/vim plugin braceless.md
oscar.plaisant@icloud.com 38fbb1938d from github to this gitea
2023-10-23 23:09:51 +02:00

2.5 KiB

up::vim plugins link::https://github.com/tweekmonster/braceless.vim title::"pour les langages à indentation sémantique" #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

braceless-motions

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

braceless-movement

Folding

  • intelligent folding by adding +fold
    • exciting details in :h braceless-folds

braceless-fold

Indent guide

  • enable with +highlight
  • enable colorcolumn so the guide can span the height of the window
  • for other filetypes : vim plugin local-indent

braceless-highlight

Somewhat intelligent auto-indent

  • intelligent autoindent when adding +indent
    • pep8 indentation built-in
    • temporarily the vim plugin delimitMate expand_cr when messing with block arguments (multi-line arguments)

braceless-autoindent

(The backspace key was never used in the image above)

EasyMotion

  • Built-in support for EasyMotion
    • search for important blocks (def, class)

braceless-easymotion

Not just Python!

Braceless can simply recognize indentation.

braceless-others

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