Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Mar 29, 2024
1 parent f00df19 commit d2ba250
Show file tree
Hide file tree
Showing 25 changed files with 166 additions and 109 deletions.
18 changes: 0 additions & 18 deletions lua/dotvim/legacy/packages/coding/init.lua

This file was deleted.

11 changes: 0 additions & 11 deletions lua/dotvim/legacy/packages/treesitter/init.lua

This file was deleted.

14 changes: 0 additions & 14 deletions lua/dotvim/legacy/packages/ui/init.lua

This file was deleted.

19 changes: 19 additions & 0 deletions lua/dotvim/pkgs/coding/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---@type dotvim.utils
local Utils = require("dotvim.utils")

---@type dotvim.core.package.PackageOption
return {
name = "coding",
depends = { "treesitter" },
plugins = Utils.tbl.flatten_array {
require("dotvim.pkgs.coding.plugins.comment"),
require("dotvim.pkgs.coding.plugins.conform"),
require("dotvim.pkgs.coding.plugins.luasnip"),
require("dotvim.pkgs.coding.plugins.neogen"),
require("dotvim.pkgs.coding.plugins.nvim-cmp"),
require("dotvim.pkgs.coding.plugins.nvim-lint"),
require("dotvim.pkgs.coding.plugins.nvim-surround"),
require("dotvim.pkgs.coding.plugins.nvim-ts-context-commentstring"),
require("dotvim.pkgs.coding.plugins.ultimate-autopair"),
},
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"numToStr/Comment.nvim",
gui = "all",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"stevearc/conform.nvim",
gui = "all",
Expand Down Expand Up @@ -43,8 +43,8 @@ return {
end
end

---@type dora.utils
local utils = require("dora.utils")
---@type dotvim.utils
local Utils = require("dotvim.utils")

local custom_formatters = {}
for _, formatter in ipairs(used_formatters) do
Expand All @@ -62,7 +62,7 @@ return {
if command == nil then
error("Formatter " .. formatter .. " does not have a command")
end
local resolved_command = utils.which_binary(command)
local resolved_command = Utils.which(command)
if resolved_command ~= command then
custom_formatters[formatter] = vim.tbl_extend("force", formatter_opts, {
command = resolved_command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"TwIStOy/luasnip-snippets",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"danymat/neogen",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"mfussenegger/nvim-lint",
event = { "BufReadPost", "BufNewFile" },
Expand All @@ -19,14 +19,14 @@ return {
end
end

---@type dora.utils
local utils = require("dora.utils")
---@type dotvim.utils
local Utils = require("dotvim.utils")
for _, name in pairs(used_linters) do
local linter = require("lint").linters[name]
if linter == nil then
error("Linter " .. linter .. " not found")
end
linter.cmd = utils.which_binary(linter.cmd)
linter.cmd = Utils.which(linter.cmd)
end

vim.api.nvim_create_autocmd("BufWritePost", {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"kylechui/nvim-surround",
gui = "all",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"JoosepAlviste/nvim-ts-context-commentstring",
gui = "all",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"altermo/ultimate-autopair.nvim",
gui = "all",
Expand Down
13 changes: 13 additions & 0 deletions lua/dotvim/pkgs/treesitter/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---@type dotvim.utils
local Utils = require("dotvim.utils")

---@type dotvim.core.package.PackageOption
return {
name = "treesitter",
plugins = Utils.tbl.flatten_array {
require("dotvim.pkgs.treesitter.plugins.nvim-treesitter"),
require("dotvim.pkgs.treesitter.plugins.just"),
require("dotvim.pkgs.treesitter.plugins.others"),
},
setup = function() end,
}
17 changes: 17 additions & 0 deletions lua/dotvim/pkgs/treesitter/plugins/just.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---@type dotvim.core.plugin.PluginOption
return {
"IndianBoy42/tree-sitter-just",
gui = "all",
lazy = true,
config = function()
require("nvim-treesitter.parsers").get_parser_configs().just = {
install_info = {
url = "https://github.com/IndianBoy42/tree-sitter-just", -- local path or git repo
files = { "src/parser.c", "src/scanner.cc" },
branch = "main",
use_makefile = true, -- this may be necessary on MacOS (try if you see compiler errors)
},
maintainers = { "@IndianBoy42" },
}
end,
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption
---@type dotvim.core.plugin.PluginOption
return {
"nvim-treesitter/nvim-treesitter",
gui = "all",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"IndianBoy42/tree-sitter-just",
gui = "all",
lazy = true,
config = function()
require("nvim-treesitter.parsers").get_parser_configs().just = {
install_info = {
url = "https://github.com/IndianBoy42/tree-sitter-just", -- local path or git repo
files = { "src/parser.c", "src/scanner.cc" },
branch = "main",
use_makefile = true, -- this may be necessary on MacOS (try if you see compiler errors)
},
maintainers = { "@IndianBoy42" },
}
end,
},
{
"windwp/nvim-ts-autotag",
gui = "all",
Expand Down
26 changes: 26 additions & 0 deletions lua/dotvim/pkgs/ui/dashboard.lua
Original file line number Diff line number Diff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$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"]],
}

return M
14 changes: 14 additions & 0 deletions lua/dotvim/pkgs/ui/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---@type dotvim.utils
local Utils = require("dotvim.utils")

---@type dotvim.core.package.PackageOption
return {
name = "ui",
plugins = Utils.tbl.flatten_array {
require("dotvim.pkgs.ui.plugins._others"),
require("dotvim.pkgs.ui.plugins.alpha"),
require("dotvim.pkgs.ui.plugins.bufferline"),
require("dotvim.pkgs.ui.plugins.lualine"),
require("dotvim.pkgs.ui.plugins.noice"),
},
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"rcarriga/nvim-notify",
Expand Down Expand Up @@ -66,17 +66,17 @@ return {
vim.defer_fn(function()
require("notify").setup(opts)

---@type dora.core.registry
local registry = require("dora.core.registry")
---@type dotvim.utils
local Utils = require("dotvim.utils")

if registry.has("telescope.nvim") then
if Utils.lazy.has("telescope.nvim") then
require("telescope").load_extension("notify")
end
end, 30)
end,
actions = function()
---@type dora.core.action
local action = require("dora.core.action")
---@type dotvim.core.action
local action = require("dotvim.core.action")

return action.make_options {
from = "nvim-notify",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"goolord/alpha-nvim",
Expand All @@ -14,10 +14,8 @@ return {
"nvim-lua/plenary.nvim",
},
opts = function()
---@type dora.lib
local lib = require("dora.lib")
---@type dora.config
local config = require("dora.config")
---@type dotvim.utils
local Utils = require("dotvim.utils")

local redraw_alpha_autocmd = nil

Expand All @@ -34,7 +32,7 @@ return {
---@param opts? table
local function make_button(sc, txt, callback, opts)
opts = opts or {}
local on_press = lib.func.normalize_callback(
local on_press = Utils.fn.normalize_callback(
callback,
vim.F.if_nil(opts.feedkeys, true)
)
Expand Down Expand Up @@ -234,13 +232,13 @@ return {

local function make_recent_project_buttons()
local function _build_buttons()
local recent_projects = lib.func.require_then(
local recent_projects = Utils.fn.require_then(
"project_nvim",
function(project_nvim)
return project_nvim.get_recent_projects()
end
) or {}
lib.tbl.list_reverse(recent_projects)
Utils.tbl.list_reverse(recent_projects)

local buttons = {}
local special_shortcuts = { "a", "s", "d" }
Expand Down Expand Up @@ -302,7 +300,9 @@ return {

local function make_header_liens()
local lines = {}
for i, line in ipairs(config.ui.dashboard_header) do
for i, line in
ipairs(require("dotvim.pkgs.ui.dashboard").dashboard_header_winnee)
do
lines[i] = {
type = "text",
val = line,
Expand All @@ -315,7 +315,7 @@ return {
end
lines[#lines + 1] = {
type = "text",
val = "dora.version: " .. require("dora.version").version(),
val = "dotvim.version: " .. require("dotvim.version").version(),
opts = {
hl = "SpecialComment",
position = "center",
Expand Down Expand Up @@ -343,7 +343,9 @@ return {
buttons[#buttons + 1] =
make_button("e", "󱪝 New File", ":ene <BAR> startinsert <CR>")

if lib.vim.current_gui() ~= nil then
local cwd = vim.fn.getcwd()

if cwd == "/" then
buttons[#buttons + 1] =
make_button("p", " Projects", "PickRecentProject", {
feedkeys = false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@type dora.core.plugin.PluginOption[]
---@type dotvim.core.plugin.PluginOption[]
return {
{
"akinsho/bufferline.nvim",
Expand Down Expand Up @@ -51,8 +51,8 @@ return {
},
},
actions = function()
---@type dora.core.action
local action = require("dora.core.action")
---@type dotvim.core.action
local action = require("dotvim.core.action")

return action.make_options {
from = "bufferline.nvim",
Expand Down
Loading

0 comments on commit d2ba250

Please sign in to comment.