Skip to content

Commit

Permalink
docs: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VidocqH authored Oct 22, 2023
1 parent bf6e4b0 commit c4a6e9d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# AutoIndent.nvim

A simple util providing auto indent when cursor at the first column and press <TAB>
A simple util providing auto indent when cursor at the first column and press <tab> like VSCode


https://github.com/VidocqH/auto-indent.nvim/assets/16725418/f90b9209-ecde-4f41-9f97-329f5b7ced12


## Installation

Expand All @@ -15,23 +19,28 @@ requir("lazy").setup({
})
```

### Configuration
## Configuration

### Default Config

```lua
{
lightmode = true -- Lightmode assumes tabstop and indentexpr not change within buffer's lifetime
indentexpr = nil
lightmode = true, -- Lightmode assumes tabstop and indentexpr not change within buffer's lifetime
indentexpr = nil,
}
```

### Custom Indent Evaluate Method

`indentexpr` should be a function returns a number of indents

example using [treesitter.indent](https://github.com/nvim-treesitter/nvim-treesitter#indentation) module

```lua
{
-- lnum: line number
indentexpr = function (lnum)
---@param lnum: number
---@return number
indentexpr = function(lnum)
return require("nvim-treesitter.indent").get_indent(lnum)
end
}
Expand Down

0 comments on commit c4a6e9d

Please sign in to comment.