Skip to content

Commit

Permalink
Add formatter.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Apr 16, 2021
1 parent fd68818 commit 8ca2942
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,7 @@
path = pack/plugins/start/hop.nvim
url = git@github.com:phaazon/hop.nvim.git
ignore = dirty
[submodule "pack/plugins/start/formatter.nvim"]
path = pack/plugins/start/formatter.nvim
url = git@github.com:mhartington/formatter.nvim.git
ignore = dirty
5 changes: 5 additions & 0 deletions .lua-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
indent_width: 2
continuation_indent_with: 2
keep_simple_control_block_one_line: false
keep_simple_function_one_line: false
double_quote_to_single_quote: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ call firenvim#install(0) " To enable embedding in browsers via firenvim
**Arch Linux**

```bash
yay -S ripgrep nerd-fonts-fira-code xkb-switch lua-language-server clang
yay -S ripgrep nerd-fonts-fira-code xkb-switch lua-language-server clang lua-format
```

**Windows**
Expand Down
1 change: 1 addition & 0 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ require('plugins.settings.bufferline')
require('plugins.settings.cmake')
require('plugins.settings.compe')
require('plugins.settings.dap')
require('plugins.settings.formatter')
require('plugins.settings.gitsigns')
require('plugins.settings.lsp')
require('plugins.settings.lualine')
Expand Down
19 changes: 19 additions & 0 deletions lua/plugins/settings/formatter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require('formatter').setup({
filetype = {
lua = {
function()
return {exe = 'lua-format'}
end
},
markdown = {
function()
return {exe = 'prettier'}
end
},
cpp = {
function()
return {exe = 'clang-format'}
end
}
}
})
1 change: 1 addition & 0 deletions pack/plugins/start/formatter.nvim
Submodule formatter.nvim added at 85f6da

0 comments on commit 8ca2942

Please sign in to comment.