Skip to content

Commit

Permalink
Merge pull request #9 from alpha2phi/08-flutter-kotlin
Browse files Browse the repository at this point in the history
08 flutter kotlin
  • Loading branch information
mengwangk authored Jul 15, 2023
2 parents dfd63dc + 67b3571 commit 5e381e2
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 16 deletions.
9 changes: 8 additions & 1 deletion lua/base/coding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,14 @@ _s_: Stop
{
"echasnovski/mini.hipatterns",
event = "BufReadPre",
opts = {},
opts = function()
local hi = require "mini.hipatterns"
return {
highlighters = {
hex_color = hi.gen_highlighter.hex_color { priority = 2000 },
},
}
end,
},
{
"echasnovski/mini.ai",
Expand Down
6 changes: 5 additions & 1 deletion lua/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ return {
angular = true,
cpp = true,
csharp = false,
flutter = true,
docker = true,
elixir = true,
flutter = false,
go = false,
html = true,
java = false,
Expand All @@ -16,11 +18,13 @@ return {
python = true,
r = true,
react = true,
ruby = true,
rust = true,
scala = true,
solidity = true,
svelte = true,
tailwind = true,
terraform = true,
typescript = true,
vuejs = true,
},
Expand Down
40 changes: 40 additions & 0 deletions lua/pde/docker.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
if not require("config").pde.docker then
return {}
end

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "dockerfile" })
end
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
local nls = require "null-ls"
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
nls.builtins.diagnostics.hadolint,
})
end,
dependencies = {
"mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "hadolint" })
end,
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
dockerls = {},
docker_compose_language_service = {},
},
},
},
}
36 changes: 36 additions & 0 deletions lua/pde/elixir.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
if not require("config").pde.elixir then
return {}
end

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"elixir",
"heex",
"eex",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
elixirls = {},
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"jfpedroza/neotest-elixir",
},
opts = {
adapters = {
["neotest-elixir"] = {},
},
},
},
}
35 changes: 25 additions & 10 deletions lua/pde/flutter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,51 @@ return {
},
{
"akinsho/flutter-tools.nvim",
event = "VeryLazy",
opts = function()
local line = { "🭽", "", "🭾", "", "🭿", "", "🭼", "" }
return {
ui = { border = line },
debugger = {
enabled = true,
enabled = false,
run_via_dap = false,
exception_breakpoints = {},
},
outline = { auto_open = false },
decorations = {
statusline = { device = true, app_version = true },
},
widget_guides = { enabled = true, debug = true },
dev_log = { enabled = false, open_cmd = "tabedit" },
widget_guides = { enabled = true, debug = false },
dev_log = { enabled = true, open_cmd = "tabedit" },
lsp = {
color = {
enabled = true,
background = true,
virtual_text = false,
},
settings = {
showTodos = true,
renameFilesWithClasses = "prompt",
showTodos = false,
renameFilesWithClasses = "always",
updateImportsOnRename = true,
completeFunctionCalls = true,
lineLength = 100,
},
-- TODO:
on_attach = require("config.lsp").on_attach,
capabilities = require("config.lsp").capabilities,
},
}
end,
config = function(_, opts)
require("flutter-tools").setup(opts)
dependencies = {
{ "RobertBrunhage/flutter-riverpod-snippets" },
},
},
{
"nvim-neotest/neotest",
dependencies = {
{ "sidlatau/neotest-dart" },
},
opts = function(_, opts)
vim.list_extend(opts.adapters, {
require "neotest-dart" { command = "flutter" },
})
end,
},
}
8 changes: 4 additions & 4 deletions lua/pde/html.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ return {
opts = {
defaults = {
["<leader>z"] = { name = "+System" },
["<leader>zc"] = { name = "+Color" },
["<leader>zC"] = { name = "+Color" },
},
},
},
Expand All @@ -62,9 +62,9 @@ return {
opts = {},
cmd = { "CccPick", "CccConvert", "CccHighlighterEnable", "CccHighlighterDisable", "CccHighlighterToggle" },
keys = {
{ "<leader>zcp", "<cmd>CccPick<cr>", desc = "Pick" },
{ "<leader>zcc", "<cmd>CccConvert<cr>", desc = "Convert" },
{ "<leader>zch", "<cmd>CccHighlighterToggle<cr>", desc = "Toggle Highlighter" },
{ "<leader>zCp", "<cmd>CccPick<cr>", desc = "Pick" },
{ "<leader>zCc", "<cmd>CccConvert<cr>", desc = "Convert" },
{ "<leader>zCh", "<cmd>CccHighlighterToggle<cr>", desc = "Toggle Highlighter" },
},
},
}
44 changes: 44 additions & 0 deletions lua/pde/ruby.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
if not require("config").pde.ruby then
return {}
end

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"ruby",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
solargraph = {},
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
"suketa/nvim-dap-ruby",
config = function()
require("dap-ruby").setup()
end,
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"olimorris/neotest-rspec",
},
opts = {
adapters = {
["neotest-rspec"] = {},
},
},
},
}
33 changes: 33 additions & 0 deletions lua/pde/terraform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
if not require("config").pde.terraform then
return {}
end

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"terraform",
"hcl",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
terraformls = {},
},
},
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
local null_ls = require "null-ls"
vim.list_extend(opts.sources, {
null_ls.builtins.formatting.terraform_fmt,
null_ls.builtins.diagnostics.terraform_validate,
})
end,
},
}

0 comments on commit 5e381e2

Please sign in to comment.