Skip to content

Commit

Permalink
✨ Support dart
Browse files Browse the repository at this point in the history
- Add completion
- Add formatter
  • Loading branch information
Nguyen-Hoang-Nam committed Feb 13, 2022
1 parent 91741bc commit ac35fd6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _Kitty with Fira, Cascadia, and Mini-File-Icons_
| C | | 👍 | | | | |
| CPP | 👍 | 👍 | 👍 | | | |
| CSS | 👍👍👍 | 👍 | 👍 | | | |
| Dart | | 👍 | | | | 👍👍 |
| Dart | 👍 | 👍 | 👍 | | | 👍👍 |
| Dockerfile | 👍 | 👍 | | 👍 | | |
| Go | 👍 | 👍 | 👍👍 | 👍 | 👍 | 👍 |
| Haskell | 👍 | 👍 | | | | 👍 |
Expand Down
10 changes: 10 additions & 0 deletions after/ftplugin/dart.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vim.opt_local.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.indentexpr = 'nvim_treesitter#indent()'

require('cmp').setup.buffer({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
})
8 changes: 2 additions & 6 deletions lua/languages/dart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ local M = {}

M.efm = {
{
formatCommand = 'goimports',
formatStdin = true,
},
{
formatCommand = 'gofumpt',
formatCommand = [[dart format -o show . | sed '$d']],
formatStdin = true,
},
}

M.all_format = { efm = 'Goimports Gofumpt' }
M.all_format = { efm = '' }

M.default_format = 'efm'

Expand Down
2 changes: 2 additions & 0 deletions lua/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ return {
filetypes = {
'css',
'cpp',
'dart',
'dockerfile',
'go',
'html',
Expand Down Expand Up @@ -59,6 +60,7 @@ return {
'cmake',
'css',
'cpp',
'dart',
'dockerfile',
'go',
'html',
Expand Down
1 change: 1 addition & 0 deletions lua/utils/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ M.map_filetype_filename = {
cmake = 'CMakeLists.txt',
css = '*.css',
cpp = '*.cpp,*.hpp',
dart = '*.dart',
dockerfile = 'Dockerfile',
go = '*.go',
html = '*.html',
Expand Down

0 comments on commit ac35fd6

Please sign in to comment.