diff options
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/database.lua | 44 | ||||
| -rw-r--r-- | lua/plugins/rest.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/test.lua | 25 |
3 files changed, 66 insertions, 5 deletions
diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua index 5c0bddf..4ffb064 100644 --- a/lua/plugins/database.lua +++ b/lua/plugins/database.lua @@ -7,6 +7,48 @@ return { }, keys = { { "<leader><leader>db", ":tab DBUI<cr>", desc = "Open Database client" } }, init = function() - require "alpha.database" + 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 = "left" + 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 = "✕", + } end, } diff --git a/lua/plugins/rest.lua b/lua/plugins/rest.lua index 2eca102..b716eec 100644 --- a/lua/plugins/rest.lua +++ b/lua/plugins/rest.lua @@ -1,5 +1,6 @@ return { "NTBBloodbath/rest.nvim", + enabled = false, dependencies = { "nvim-lua/plenary.nvim" }, ft = "http", config = function() @@ -10,6 +11,7 @@ return { result_split_horizontal = false, -- Skip SSL verification, useful for unknown certificates skip_ssl_verification = false, + encode_url = false, -- Highlight request on run highlight = { enabled = true, diff --git a/lua/plugins/test.lua b/lua/plugins/test.lua index aa9cba7..e2cfb59 100644 --- a/lua/plugins/test.lua +++ b/lua/plugins/test.lua @@ -7,21 +7,36 @@ return { config = function() local hydra = require "hydra" - vim.g["test#preserve_screen"] = 1 - vim.cmd [[ let test#php#pest#executable = './vendor/bin/sail test' - let test#strategy = 'neovim' + let test#strategy = 'harpoon' let test#neovim#term_position = 'vert' - let g:test#preserve_screen = 1 + let g:test#preserve_screen = 0 + let g:test#harpoon_term = 3 + let g:test#harpoon#gototerminal= 0 ]] local hint = [[ Vim Tests _n_: Near test _f_: Current file _s_: Test Suit ^ _l_: Test Last _g_: Visit + _w_: Watch last Test _p_: stop watch ^ ^ _<Esc>_ ^ ]] + local auto_cmd_id = nil + local stopAutoCommand = function() + if auto_cmd_id ~= nil then + vim.api.nvim_del_autocmd(auto_cmd_id) + auto_cmd_id = nil + end + end + local startAutoCommand = function() + stopAutoCommand() + auto_cmd_id = vim.api.nvim_create_autocmd({"BufWritePost"}, { + pattern = {"*.php", "*.feature", "*.yaml"}, + command = "TestLast", + }) + end hydra { name = "vimtest", @@ -42,6 +57,8 @@ return { { "s", ":TestSuit<CR>" }, { "l", ":TestLast<CR>" }, { "g", ":TestVisit<CR>" }, + { "w", startAutoCommand }, + { "p", stopAutoCommand }, { "<Esc>", nil, { exit = true } }, }, } |