• Stars
    star
    210
  • Rank 186,552 (Top 4 %)
  • Language
    Vim Script
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

A Vim plugin for indent-level based motion.

IndentWise

Description

IndentWise is a Vim plugin that provides for motions based on indent depths or levels in normal, visual, and operator-pending modes.

Movements by Relative Indent-Depth

The following key-mappings provide motions to go to lines of lesser, equal, or greater indent than the line that the cursor is currently on:

  • [- : Move to previous line of lesser indent than the current line.
  • [+ : Move to previous line of greater indent than the current line.
  • [= : Move to previous line of same indent as the current line that is separated from the current line by lines of different indents.
  • ]- : Move to next line of lesser indent than the current line.
  • ]+ : Move to next line of greater indent than the current line.
  • ]= : Move to next line of same indent as the current line that is separated from the current line by lines of different indents.

The above all take a {count}, so that, e.g., 4[- will move to the previous line that is 4 indent-depths less than the current one. An "indent-depth" is simply the indentation of the line, and thus any line with a smaller amount of indentation relative to current line is considered at a lesser indent depth, and, conversely, any line with a greater indentation than the current line is considered to be at a greater indent-depth.

Movements by Absolute Indent-Levels

In addition, you can navigate directly to a line of a particular indent-level, with the level specified by a (mandatory) {count} directive, using:

  • {count}[_ : Move to previous line with indent-level of {count}.
  • {count}]_ : Move to next line with indent-level of {count}.

An "indent-level" of a line is the number of shiftwidth units that the line is indented (as opposed to the "indent-depth", which is just the indentation amount of a line).

Movements by Indent-Block Scope

The following key-mappings provide motions based on indent-block scope boundaries, with an optional {count} directive specifying the number of levels of scope to include:

  • [% : Move to beginning of indent-block scope (i.e., move to the line just after the previous line of lesser indent); repeat for {count} outer scopes.
  • ]% : Move to end of indent-block scope (i.e., move to the line just before the next line of lesser indent); repeat for {count} outer scopes.

Customization

If you are unhappy with the default key-mappings you can provide your own by defining custom mappings in your .vimrc. For example to replicate the default mappings, you would define the following:

map [- <Plug>(IndentWisePreviousLesserIndent)
map [= <Plug>(IndentWisePreviousEqualIndent)
map [+ <Plug>(IndentWisePreviousGreaterIndent)
map ]- <Plug>(IndentWiseNextLesserIndent)
map ]= <Plug>(IndentWiseNextEqualIndent)
map ]+ <Plug>(IndentWiseNextGreaterIndent)
map [_ <Plug>(IndentWisePreviousAbsoluteIndent)
map ]_ <Plug>(IndentWiseNextAbsoluteIndent)
map [% <Plug>(IndentWiseBlockScopeBoundaryBegin)
map ]% <Plug>(IndentWiseBlockScopeBoundaryEnd)

Installation

pathogen.vim

$ cd ~/.vim/bundle
$ git clone git://github.com/jeetsukumaran/vim-indentwise.git

Vundle

:BundleInstall jeetsukumaran/vim-indentwise

Add the line below into your .vimrc.

Bundle 'jeetsukumaran/vim-indentwise'

Manually

Copy the plugin/indentwise.vim file to your .vim/plugin directory and the doc/indentwise.txt file to your .vim/doc directory.

Acknowledgements

IndentWise is based on the following:

More Repositories

1

vim-buffergator

Vim plugin to list, select and switch between buffers.
Vim Script
497
star
2

vim-pythonsense

A Vim plugin that provides text objects and motions for Python classes, methods, functions, and doc strings.
Vim Script
211
star
3

DendroPy

A Python library for phylogenetic scripting, simulation, data processing and manipulation.
Python
204
star
4

Syrupy

System Resource Usage Profiler
Python
194
star
5

vim-filebeagle

A VINE-spired (Vim Is Not Emacs) file system explorer.
Vim Script
162
star
6

vim-markology

Vim mark visualization, navigation and management
Vim Script
72
star
7

vim-buffersaurus

Vim plugin to search, index, and navigate buffer content using regular expression patterns.
Vim Script
42
star
8

cmake-pandocology

Compile documents using Pandoc under the CMake build system
CMake
38
star
9

vim-nefertiti

Dark-background Vim Color Scheme with Dynamic Brightness Control (GUI-only)
Vim Script
31
star
10

fuzzysnake

Find, list, filter, and edit or otherwise act on files from the terminal using fuzzy-matching or regular expressions.
Python
28
star
11

GitCommandsDashboardWidget

OS X Dashboad Widget listing Git commands and usage.
JavaScript
18
star
12

vim-filesearch

Vim plugin for searching the local filesystem for files by name or content, using glob or regular expression patterns.
Vim Script
14
star
13

vim-gazetteer

Semantic location information for Vim.
Vim Script
10
star
14

YonderGit

Simplified Git Remote Repository Management
Python
9
star
15

vim-python-indent-black

Vim Script
8
star
16

quickfix-rex.nvim

Lua
8
star
17

delineate

Package for species delimitation analysis
Python
7
star
18

promptitude

A shell prompt with an attitude: enhanced (BASH) shell prompt with VCS (Git) branch and status information.
Shell
7
star
19

telescope-grab-lines.nvim

Lua
6
star
20

ToggleCrypt

AES/Rijndael encryption/decryption of files; provides for temporary unlocking of files for editing.
Python
6
star
21

2015-SSB-AnnArbor-Biogeography

R
5
star
22

telescope-rtp

Lua
5
star
23

telescope-buffer-lines.nvim

Find lines from across all open buffers and insert selected into current buffer.
Lua
5
star
24

GDBCommandsDashboardWidget

OS X Dashboard Widget for GNU Debugger Commands
JavaScript
5
star
25

obsidian-bibliosidian

TypeScript
5
star
26

obsidian-impresario

TeX
5
star
27

treeshrew

C++
3
star
28

Archipelago1

Simulation of island diversification patterns using a spatially-explicit birth-death branching process in a virtual landscape with islands, carrying capacities, different dispersal probabilities, etc.
Python
3
star
29

distriscopia

Probability distribution visualization
JavaScript
3
star
30

vim-linearly

A Vim plugin providing operators to manipulate line units: split text into natural language sentence lines or on arbitrary regular expressions; join lines with optional delimiters.
Vim Script
2
star
31

PySeqGen

Wrapper around Seq-Gen molecular sequence generator
Python
2
star
32

tutorials_cheatsheets

Collection of cheatsheets and tutorials for various software and tools
R
2
star
33

jdalias

Jump to Aliased Directory: An aliased-directory command-line navigation system. Manages a set of user-specified aliases pointing to directories tha allow the user to "jump" from one directory to another using very quickly and efficiently.
Python
2
star
34

Ginkgo

Forward-time spatially-explicit agent-based simulations of phylogeographic history over dynamic landscapes and environments.
C++
2
star
35

ctrlp-pythonic.vim

Python code navigation extension for the CtrlP Vim plugin
Vim Script
1
star
36

possum

Multi-population molecular population genetic summary statistic calculation utility
Shell
1
star
37

archipelago

R
1
star
38

obsidian-vault-configuration

JavaScript
1
star
39

pikun

An information theoretic toolkit for analysis and visualization of species delimitation model space.
Python
1
star
40

nexmlvalidator

Stand-alone Self-contained NeXML Validation Utility
Java
1
star
41

vim-pandoctitude

Equipping Your Vim With a Pandoc Attitude!
Vim Script
1
star
42

piikun

Species delimitation partition model space analysis and visualization.
Python
1
star
43

Arroyo-of-Sun-and-Moon

CSS
1
star