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 --- lua/alpha/database.lua | 50 +++++++++++++++++++++++++++++++++++++++++++++++ lua/alpha/lsp/servers.lua | 9 +++++---- lua/alpha/plugins.lua | 30 ++++++++++++++++++++++++++-- 3 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 lua/alpha/database.lua (limited to 'lua') 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