From 178572db889dca9a86d8380fb90bca28d6dee49a Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Thu, 22 Feb 2024 16:05:51 +0800 Subject: [PATCH] add sql support --- btop/btop.conf | 2 +- nvim/lua/custom/configs/null-ls.lua | 7 +++++++ nvim/lua/custom/configs/rust.lua | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/btop/btop.conf b/btop/btop.conf index 5148cc3..1058e73 100644 --- a/btop/btop.conf +++ b/btop/btop.conf @@ -54,7 +54,7 @@ update_ms = 500 #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. -proc_sorting = "cpu direct" +proc_sorting = "memory" #* Reverse sorting order, True or False. proc_reversed = False diff --git a/nvim/lua/custom/configs/null-ls.lua b/nvim/lua/custom/configs/null-ls.lua index af5f74d..185a309 100644 --- a/nvim/lua/custom/configs/null-ls.lua +++ b/nvim/lua/custom/configs/null-ls.lua @@ -50,6 +50,13 @@ local opts = { code_actions.shellcheck, formatting.shellharden, formatting.shfmt, + -- sql + diagnostics.sqlfluff.with { + extra_args = { "--dialect", "postgres" }, -- change to your dialect + }, + formatting.sqlfluff.with { + extra_args = { "--dialect", "postgres" }, -- change to your dialect + }, }, on_attach = function(client, bufnr) if client.supports_method "textDocument/formatting" then diff --git a/nvim/lua/custom/configs/rust.lua b/nvim/lua/custom/configs/rust.lua index c1c24c1..53f0837 100644 --- a/nvim/lua/custom/configs/rust.lua +++ b/nvim/lua/custom/configs/rust.lua @@ -14,12 +14,16 @@ vim.g.rustaceanvim = function() local cfg = require "rustaceanvim.config" return { - tools = {}, + tools = { + hover_actions = { + replace_builtin_hover = false, + }, + }, server = { settings = { ["rust-analyzer"] = { standalone = true, - cargo = { + --[[ cargo = { allFeatures = true, loadOutDirsFromCheck = true, runBuildScripts = true, @@ -27,7 +31,7 @@ vim.g.rustaceanvim = function() checkOnSave = { allFeatures = true, command = "clippy", - }, + }, ]] files = { excludeDirs = { ".flatpak-builder", @@ -54,6 +58,11 @@ vim.g.rustaceanvim = function() }, }, }, + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, check = { command = "clippy", features = "all",