diff options
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua | 2 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua | 42 | ||||
| -rw-r--r-- | global/.ssh/config | 1 | ||||
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua | 1 | ||||
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua | 42 |
5 files changed, 70 insertions, 18 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua index ab7099a..7d4fb9e 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua @@ -19,6 +19,8 @@ return { -- librewolf = "sqlite://" .. home .. "/.librewolf/si.default/places.sqlite", mysql = "mariadb://ms:password@localhost:5432/mysql", postsql = "postgresql://ps:password@localhost:5432/postgresql", + dts = "postgresql://dts:dujinDTS2@localhost:5432/evcp", + dts_aws = "postgresql://dts:dujinDTS2@127.0.0.1:15432/evcp", -- qutebrowser = "sqlite://" .. home .. "/.local/share/qutebrowser/history.sqlite", -- sqlite = "sqlite://" .. home .. "/.local/share/db/sqlite.db", } diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua index 8beb058..da49976 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua @@ -84,7 +84,11 @@ return { }, }) - require("mason").setup() + require("mason").setup({ + pip = { + use_python3_host_prog = true, + }, + }) require("mason-lspconfig").setup({ ensure_installed = { "bashls", @@ -94,12 +98,13 @@ return { "jdtls", "jsonls", "lua_ls", - "mutt_ls", + -- "mutt_ls", "pyright", "ruff", + "sqls", "ts_ls", }, - automatic_installation = true, + automatic_enable = true, handlers = { function(server_name) -- default handler (optional) require("lspconfig")[server_name].setup({ @@ -208,6 +213,11 @@ return { -- }, }) end, + ["sqls"] = function() + lspconfig.sqls.setup({ + capabilities = capabilities, + }) + end, ["ts_ls"] = function() lspconfig.ruff.setup({ capabilities = capabilities, @@ -220,12 +230,13 @@ return { lint.linters_by_ft = { dockerfile = { "hadolint" }, javascript = { "eslint_d" }, - typescript = { "eslint_d" }, javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - svelte = { "eslint_d" }, python = { "pylint" }, sh = { "shellcheck" }, + sql = { "sqlfluff" }, + svelte = { "eslint_d" }, + typescript = { "eslint_d" }, + typescriptreact = { "eslint_d" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) @@ -242,7 +253,7 @@ return { "black", -- python formatter "debugpy", -- python debuger "eslint_d", -- eslint linter - "hadolint", -- docker linter + -- "hadolint", -- docker linter "isort", -- python formatter "java-debug-adapter", -- java debugger "java-test", -- java test @@ -253,6 +264,8 @@ return { "ruff", -- python formatter "shellcheck", -- bash lint "shfmt", -- sh formatter + "sqlfluff", -- sql linter + "sql-formatter", -- sql formatter "stylua", -- lua formatter }, integrations = { @@ -331,6 +344,7 @@ return { markdown = { "prettier" }, python = { "ruff", "isort", "black" }, sh = { "shfmt" }, + sql = { "sql-formatter" }, svelte = { "prettier" }, typescript = { "prettier" }, typescriptreact = { "prettier" }, @@ -344,7 +358,19 @@ return { if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end - return { lsp_format = "fallback", timeout_ms = 1000, async = false } + local ft = vim.bo[bufnr].filetype + local off = { + javascript = true, + typescript = true, + javascriptreact = true, + typescriptreact = true, + json = true, + css = true, + } + if off[ft] then + return false + end + return { lsp_fallback = true, timeout_ms = 1000, async = false } end, }) diff --git a/global/.ssh/config b/global/.ssh/config index 7483e7f..c2e42f7 100644 --- a/global/.ssh/config +++ b/global/.ssh/config @@ -38,6 +38,7 @@ Host evcp HostName 43.203.251.114 User ec2-user IdentityFile ~/.ssh/keys/evcp-LightsailDefaultKey-ap-northeast-2.pem + LocalForward 15432 127.0.0.1:5432 Host evcp-m HostName 13.125.209.49 diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua index c33d37d..7d4fb9e 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua @@ -20,6 +20,7 @@ return { mysql = "mariadb://ms:password@localhost:5432/mysql", postsql = "postgresql://ps:password@localhost:5432/postgresql", dts = "postgresql://dts:dujinDTS2@localhost:5432/evcp", + dts_aws = "postgresql://dts:dujinDTS2@127.0.0.1:15432/evcp", -- qutebrowser = "sqlite://" .. home .. "/.local/share/qutebrowser/history.sqlite", -- sqlite = "sqlite://" .. home .. "/.local/share/db/sqlite.db", } diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua index b7b5812..da49976 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua @@ -101,6 +101,7 @@ return { -- "mutt_ls", "pyright", "ruff", + "sqls", "ts_ls", }, automatic_enable = true, @@ -212,6 +213,11 @@ return { -- }, }) end, + ["sqls"] = function() + lspconfig.sqls.setup({ + capabilities = capabilities, + }) + end, ["ts_ls"] = function() lspconfig.ruff.setup({ capabilities = capabilities, @@ -224,12 +230,13 @@ return { lint.linters_by_ft = { dockerfile = { "hadolint" }, javascript = { "eslint_d" }, - typescript = { "eslint_d" }, javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - svelte = { "eslint_d" }, python = { "pylint" }, sh = { "shellcheck" }, + sql = { "sqlfluff" }, + svelte = { "eslint_d" }, + typescript = { "eslint_d" }, + typescriptreact = { "eslint_d" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) @@ -257,6 +264,8 @@ return { "ruff", -- python formatter "shellcheck", -- bash lint "shfmt", -- sh formatter + "sqlfluff", -- sql linter + "sql-formatter", -- sql formatter "stylua", -- lua formatter }, integrations = { @@ -324,20 +333,21 @@ return { require("conform").setup({ formatters_by_ft = { bash = { "shfmt" }, - -- css = { "prettier" }, + css = { "prettier" }, graphql = { "prettier" }, html = { "prettier" }, - -- javascript = { "prettier" }, - -- javascriptreact = { "prettier" }, - -- json = { "prettier" }, + javascript = { "prettier" }, + javascriptreact = { "prettier" }, + json = { "prettier" }, liquid = { "prettier" }, lua = { "stylua" }, markdown = { "prettier" }, python = { "ruff", "isort", "black" }, sh = { "shfmt" }, + sql = { "sql-formatter" }, svelte = { "prettier" }, - -- typescript = { "prettier" }, - -- typescriptreact = { "prettier" }, + typescript = { "prettier" }, + typescriptreact = { "prettier" }, vimwiki = { "prettier" }, yaml = { "prettier" }, zsh = { "beautysh" }, @@ -348,7 +358,19 @@ return { if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end - return { lsp_format = "fallback", timeout_ms = 1000, async = false } + local ft = vim.bo[bufnr].filetype + local off = { + javascript = true, + typescript = true, + javascriptreact = true, + typescriptreact = true, + json = true, + css = true, + } + if off[ft] then + return false + end + return { lsp_fallback = true, timeout_ms = 1000, async = false } end, }) |
