From 3ada6b4267f29a09c8bc240c2a75b194d51ff008 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 10 Jan 2023 11:03:17 +0100 Subject: feat: remove more after config plugins --- after/plugin/dbui.lua | 49 --------------------------------- after/plugin/feline.lua | 69 ----------------------------------------------- after/plugin/iron.lua | 61 ----------------------------------------- after/plugin/mind.lua | 11 -------- after/plugin/notify.lua | 8 ------ after/plugin/trouble.lua | 11 -------- lua/alpha/database.lua | 50 ++++++++++++++++++++++++++++++++++ lua/alpha/lsp/servers.lua | 9 ++++--- lua/alpha/plugins.lua | 30 +++++++++++++++++++-- 9 files changed, 83 insertions(+), 215 deletions(-) delete mode 100644 after/plugin/dbui.lua delete mode 100644 after/plugin/feline.lua delete mode 100644 after/plugin/iron.lua delete mode 100644 after/plugin/mind.lua delete mode 100644 after/plugin/notify.lua delete mode 100644 after/plugin/trouble.lua create mode 100644 lua/alpha/database.lua diff --git a/after/plugin/dbui.lua b/after/plugin/dbui.lua deleted file mode 100644 index 7715875..0000000 --- a/after/plugin/dbui.lua +++ /dev/null @@ -1,49 +0,0 @@ -vim.g.db_ui_use_nerd_fonts = 1 -vim.g.db_ui_show_database_icon = 1 -vim.g.db_ui_force_echo_notifications = 1 -vim.g.db_ui_win_position = 'right' -vim.g.db_ui_winwidth = 80 - -vim.g.db_ui_table_helpers = { - mysql = { - Count = "select count(1) from {optional_schema}{table}", - Explain = "EXPLAIN {last_query}" - }, - sqlite = { - Describe = "PRAGMA table_info({table})" - } -} - -vim.g.db_ui_icons = { - expanded = { - db = '▾ ', - buffers = '▾ ', - saved_queries = '▾ ', - schemas = '▾ ', - schema = '▾ פּ', - tables = '▾ 藺', - table = '▾ ', - }, - collapsed = { - db = '▸ ', - buffers = '▸ ', - saved_queries = '▸ ', - schemas = '▸ ', - schema = '▸ פּ', - tables = '▸ 藺', - table = '▸ ', - }, - saved_query = '', - new_query = '璘', - tables = '離', - buffers = '﬘', - add_connection = '', - connection_ok = '✓', - connection_error = '✕', -} - --- opening it in a new tab -vim.keymap.set('n', 'db', ':tab DBUI', {}) - --- just close the tab, but context related of the keybinding -vim.keymap.set('n', 'tq', ':tabclose') diff --git a/after/plugin/feline.lua b/after/plugin/feline.lua deleted file mode 100644 index 3b6c6c6..0000000 --- a/after/plugin/feline.lua +++ /dev/null @@ -1,69 +0,0 @@ -local ok, feline = pcall(require, "feline") -if not ok then - return -end - -local my_theme = { - bg = "#131a24", - bg1 = "#192330", - black = "#131a24", - skyblue = "#719cd6", - cyan = "#63cdcf", - fg = "#aeafb0", - green = "#81b29a", - magenta = "#9d79d6", - orange = "#f4a261", - red = "#c94f6d", - white = "#dfdfe0", - yellow = "#dbc074", - oceanblue = "#39506d", -} - -feline.setup() -feline.use_theme(my_theme) - - --- Winbar -local winbar_fileinfo_component = { - provider = { - name = "file_info", - opts = { - type = "relative", - file_modified_icon = "", - }, - }, - hl = { - bg = "bg1", - fg = "skyblue", - }, -} - -local winbar_fileinfo_component_inactive = { - provider = { - name = "file_info", - opts = { - type = "relative", - file_modified_icon = "", - }, - }, - hl = { - bg = "bg1", - fg = "fg", - }, -} - -local winbar_components = { - active = {}, - inactive = {}, -} - --- add a section to each one -table.insert(winbar_components.active, {}) -table.insert(winbar_components.inactive, {}) - -table.insert(winbar_components.active[1], winbar_fileinfo_component) -table.insert(winbar_components.inactive[1], winbar_fileinfo_component_inactive) - -feline.winbar.setup({ - components = winbar_components, -}) diff --git a/after/plugin/iron.lua b/after/plugin/iron.lua deleted file mode 100644 index 972ccbc..0000000 --- a/after/plugin/iron.lua +++ /dev/null @@ -1,61 +0,0 @@ -local ok, iron = pcall(require, "iron.core") - -if not ok then - return -end - -iron.setup({ - config = { - should_map_plug = false, - -- Whether a repl should be discarded or not - scratch_repl = true, - close_window_on_exit = true, - -- Your repl definitions come here - repl_definition = { - sh = { - command = { "zsh" }, - }, - javascript = { - command = { "node" }, - }, - php = { - command = { "psysh" }, - }, - tinker = { - command = { "php", "artisan", "tinker" }, - }, - sail = { - command = { "sail", "tinker" }, - }, - }, - repl_open_cmd = "rightbelow vertical 100 split", - -- how the REPL window will be opened, the default is opening - -- a float window of height 40 at the bottom. - }, - keymaps = { - send_motion = "sc", - visual_send = "sc", - send_file = "sf", - send_line = "sl", - send_mark = "sm", - mark_motion = "mc", - mark_visual = "mc", - remove_mark = "md", - cr = "s", - interrupt = "s", - exit = "sq", - clear = "cl", - }, - highlight = { - italic = true, - }, -}) - --- Idea --- create a menu to ask which console wants to start --- for php example we have --- psysh | tinker | tinker on sail --- base on that save the expected filetype on a buffer variable --- add the parameter to the command for the IronRepl and all commands to send --- or beter use my own functions useing the core.* functions --- not all functions takes the ft as parameter diff --git a/after/plugin/mind.lua b/after/plugin/mind.lua deleted file mode 100644 index 8457cdb..0000000 --- a/after/plugin/mind.lua +++ /dev/null @@ -1,11 +0,0 @@ -local ok, mind = pcall(require, "mind") -if not ok then - return -end - -mind.setup({ - persistence = { - state_path = "/mnt/nas/alpha/mind/mind.json", - data_dir = "/mnt/nas/alpha/mind/data" - }, -}) diff --git a/after/plugin/notify.lua b/after/plugin/notify.lua deleted file mode 100644 index 7a9f79c..0000000 --- a/after/plugin/notify.lua +++ /dev/null @@ -1,8 +0,0 @@ -local ok, notify = pcall(require, "notify") -if not ok then - return -end - -notify.setup({ - background_colour = "#000000", -}) diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua deleted file mode 100644 index 7d137d5..0000000 --- a/after/plugin/trouble.lua +++ /dev/null @@ -1,11 +0,0 @@ -local ok, trouble = pcall(require, "trouble") - -if not ok then - return -end - -trouble.setup({ - mode = "document_diagnostics", -}) - -vim.keymap.set('n', 'oo', ':TroubleToggle') diff --git a/lua/alpha/database.lua b/lua/alpha/database.lua new file mode 100644 index 0000000..df1586b --- /dev/null +++ b/lua/alpha/database.lua @@ -0,0 +1,50 @@ +P("loading this") +vim.g.db_ui_use_nerd_fonts = 1 +vim.g.db_ui_show_database_icon = 1 +vim.g.db_ui_force_echo_notifications = 1 +vim.g.db_ui_win_position = 'right' +vim.g.db_ui_winwidth = 80 + +vim.g.db_ui_table_helpers = { + mysql = { + Count = "select count(1) from {optional_schema}{table}", + Explain = "EXPLAIN {last_query}" + }, + sqlite = { + Describe = "PRAGMA table_info({table})" + } +} + +vim.g.db_ui_icons = { + expanded = { + db = '▾ ', + buffers = '▾ ', + saved_queries = '▾ ', + schemas = '▾ ', + schema = '▾ פּ', + tables = '▾ 藺', + table = '▾ ', + }, + collapsed = { + db = '▸ ', + buffers = '▸ ', + saved_queries = '▸ ', + schemas = '▸ ', + schema = '▸ פּ', + tables = '▸ 藺', + table = '▸ ', + }, + saved_query = '', + new_query = '璘', + tables = '離', + buffers = '﬘', + add_connection = '', + connection_ok = '✓', + connection_error = '✕', +} + +-- opening it in a new tab +vim.keymap.set('n', 'db', ':tab DBUI', {}) + +-- just close the tab, but context related of the keybinding +vim.keymap.set('n', 'tq', ':tabclose') diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua index 921a628..de05e0b 100644 --- a/lua/alpha/lsp/servers.lua +++ b/lua/alpha/lsp/servers.lua @@ -1,11 +1,12 @@ return { + "emmet_ls", + "gopls", + "html", + "jsonls", + "marksman", "phpactor", "rust_analyzer", - "gopls", "sumneko_lua", - "emmet_ls", - "jsonls", - "html", "tsserver", "volar", } diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index 1c46d96..b8037ed 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -152,6 +152,12 @@ return require("packer").startup(function(use) use({ "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons", + config = function () + require('trouble').setup({mode = "document_diagnostics"}) + vim.keymap.set('n', 'oo', ':TroubleToggle') + end, + cmd = {"Trouble", "TroubleToggle"}, + keys = "oo", }) use("vim-test/vim-test") @@ -185,7 +191,12 @@ return require("packer").startup(function(use) -- Style use("stevearc/dressing.nvim") - use("rcarriga/nvim-notify") + use({ + "rcarriga/nvim-notify", + config = function () + require('notify').setup({background_colour = "#000000"}) + end + }) use("xiyaowong/nvim-transparent") use("Raimondi/delimitMate") @@ -226,6 +237,11 @@ return require("packer").startup(function(use) "kristijanhusak/vim-dadbod-completion", "tpope/vim-dotenv", }, + cmd = "DBUI", + keys = "db", + config = function () + require('alpha.database') + end }) -- Rest client @@ -247,7 +263,17 @@ return require("packer").startup(function(use) "phaazon/mind.nvim", branch = "v2.2", requires = { "nvim-lua/plenary.nvim" }, - cmd = { "MindOpenMain", "MindOpenProject" } + cmd = { "MindOpenMain", "MindOpenProject" }, + config = function () + local dirs = {} + if vim.fn.isdirectory("/mnt/nas/alpha/mind/data") then + dirs = { + state_path = "/mnt/nas/alpha/mind/mind.json", + data_dir = "/mnt/nas/alpha/mind/data", + } + end + require('mind').setup({ persistence = dirs}) + end }) use { -- cgit v1.2.3