• Stars
    star
    392
  • Rank 109,735 (Top 3 %)
  • Language
    Vim Script
  • Created almost 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐍 Text objects, folding, and more for Python and other indented languages.

Braceless Build Status

Text objects, folding, and more for Python and other indented languages. CoffeeScript support is already baked in, but mainly as an incomplete proof of concept.

Usage

Use your favorite plugin plugin of choice to install tweekmonster/braceless.vim, then add a line like this to your vimrc file:

autocmd FileType python BracelessEnable +indent

The command arguments are:

Option Description
+indent Enable indent handling
+fold Enable folding
+fold-slow Enable indentexpr folding, which is depreciated and slow
+highlight Enable indent guide
+highlight-cc Enable indent guide, but use colorcolumn
+highlight-cc2 Enable indent guide and use colorcolumn

The default motion of interest is P. It can be used for things like vaP, ciP, >iP, etc. :h braceless Covers the details of this plugin.

Text objects

Braceless doesn't give you similarly indented blocks as text objects. You get actual code blocks using iP and aP.

braceless-motions

Object motions

Moving to recognized blocks is done with [[ and ]]. In Python, [m and ]m moves to def and class blocks, while [M and ]M moves to the end of those blocks.

braceless-movement

Folding

Get useful code folding by adding +fold. Unfortunately, this can be a little slow on large scripts. Folding is now much faster! Read the boring exciting details in :h braceless-folds!

braceless-fold

Indent guide

See what indent level you're operating on with +highlight. You can also enable colorcolumn so the guide can span the height of the window. If you would like this kind of indent highlighting in other files that don't need Braceless, take a look at local-indent.vim

braceless-highlight

Somewhat intelligent auto-indent

Ever wished for autoindent that didn't make you fix the indent? Wish no more, pal. Just add +indent. It's not perfect, but it's definitely better. There is even PEP 8 indentation built in, and if you use delimitMate with the expand_cr option enabled, Braceless will disable it temporarily when you're messing with block arguments.

braceless-autoindent

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

EasyMotion

Built-in support for EasyMotion.

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

License

MIT

More Repositories

1

tmux2html

🐈 Render full tmux windows or individual panes as HTML
Python
692
star
2

startuptime.vim

Breakdown Vim's --startuptime output
Vim Script
284
star
3

django-plus.vim

🎸 Improvements to the handling of Django related files in Vim
Vim Script
178
star
4

helpful.vim

πŸ““ Display vim version numbers in docs
Vim Script
177
star
5

nmux

A multiplexer for Neovim processes
Objective-C
110
star
6

fzf-filemru

File MRU with fzf.vim
Shell
91
star
7

deoplete-clang2

Python
90
star
8

moult

A utility for finding Python packages that may not be in use.
Python
50
star
9

nvim-python-doctor

πŸš‘ Display diagnostic information about Python installations for Neovim
Shell
45
star
10

impsort.vim

Sort and highlight Python imports in Vim
Vim Script
36
star
11

local-indent.vim

Display a guide for the current line's indent level.
Vim Script
32
star
12

hammerspoon-vimouse

Control the mouse with Hammerspoon in a Vim-ish way
Lua
28
star
13

Developer-Profile

A Google Chrome extension that deletes browser data when all windows in a profile are closed.
HTML
25
star
14

exception.vim

Vim plugin for tracing exceptions thrown by VimL scripts.
Vim Script
24
star
15

gofmt.vim

A Vim plugin that runs gofmt when you save
Vim Script
19
star
16

dootfiles

🎡 dootfiles beep boop deet doot 🎡
Vim Script
18
star
17

spellrotate.vim

Cycles spelling suggestions under the cursor
Vim Script
17
star
18

wstrip.vim

Strip trailing whitespace only on changed lines
Vim Script
16
star
19

nvim-api-viewer

Display Neovim API functions in a buffer for reference.
Vim Script
14
star
20

sshclip

Sever/client clipboard over SSH for Neovim
Shell
13
star
21

dyslexic.vim

😭 Find mistyped text by searching for word permutations
Vim Script
13
star
22

haunted.vim

πŸ‘» Scripted automation in Vim using ghosts
Vim Script
13
star
23

osx-autoclean

πŸ—‘οΈ Automatic Directory Cleaning on macOS
Shell
12
star
24

auto_rsync

Automatically rsync a directory watched by fswatch
Shell
11
star
25

anyline.vim

πŸš₯ A highly customizable statusline for Vim
Vim Script
11
star
26

colorpal.vim

Vim theming plugin
Vim Script
10
star
27

hl-goimport.vim

Highlights imported packages in Go
Vim Script
9
star
28

gitbusy.vim

🐝 Stash your Vim session using `git stash` before switching to another branch.
Vim Script
6
star
29

headlines.vim

πŸ“° Quickly edit the top of your source files
Vim Script
5
star
30

luser

Drop-in replacement for os/user in Go
Go
5
star
31

ubuntu-vims

Docker container for builds of Vim from different versions of Ubuntu
5
star
32

nanofish

oh-my-zsh theme
3
star
33

deoplete-server

[WIP] Deoplete server
3
star
34

nvim-checkhealth

:CheckHealth command for older Neovim versions
Vim Script
2
star
35

wstrip-changed.vim

Strip trailing whitespace only on changed lines.
Vim Script
2
star
36

pdfpop

A very simple macOS command line utility for creating PDFs from an existing PDF
Objective-C
2
star
37

zsh-duckduckgo

Get very simple responses from DuckDuckGo in your z-shell
Shell
1
star
38

django-userjs

userjs is a Django application that produces javascript that represents a User object.
Python
1
star
39

shellcolors

Utility for displaying shell colors and finding a close match
Python
1
star