diff --git a/after/sql.lua b/after/sql.lua new file mode 100644 index 00000000..8ef0ac3c --- /dev/null +++ b/after/sql.lua @@ -0,0 +1,10 @@ +vim.api.nvim_create_autocmd('FileType', { + pattern = 'sql', + callback = function() + vim.lsp.start { + name = 'sqls', + cmd = { 'sqls', 'stdio' }, + root_dir = vim.fn.getcwd(), + } + end, +}) diff --git a/init.lua b/init.lua index ea12c0d1..e2980fc8 100644 --- a/init.lua +++ b/init.lua @@ -91,6 +91,8 @@ I hope you enjoy your Neovim journey, -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) P.S. You can delete this when you're done too. It's your config now! :) --]] +vim.lsp.config('sqls', {}) +vim.lsp.enable('sqls') vim.g.db_ui_env_variable_url = 'postgres' vim.g.db_ui_env_variable_name = 'test' @@ -588,20 +590,37 @@ require('lazy').setup({ { -- Main LSP Configuration 'neovim/nvim-lspconfig', - -- opts = { - -- servers = { eslint = {} }, - -- setup = { - -- eslint = function() - -- require('lazyvim.util').lsp.on_attach(function(client) - -- if client.name == 'eslint' then - -- client.server_capabilities.documentFormattingProvider = true - -- elseif client.name == 'tsserver' then - -- client.server_capabilities.documentFormattingProvider = false - -- end - -- end) - -- end, - -- }, - -- }, + opts = { + servers = { + eslint = {}, + -- sqls = { + -- on_attach = function(client, bufnr) + -- client.supports_method('textDocument/formatting') = true + -- vim.api.nvim_create_autocmd('BufWritePre', { + -- buffer = bufnr, + -- callback = function() + -- vim.lsp.buf.format { + -- filter = function(c) + -- return c.name == 'sqls' + -- end, + -- } + -- end, + -- }) + -- end, + -- }, + }, + -- setup = { + -- eslint = function() + -- require('lazyvim.util').lsp.on_attach(function(client) + -- if client.name == 'eslint' then + -- client.server_capabilities.documentFormattingProvider = true + -- elseif client.name == 'tsserver' then + -- client.server_capabilities.documentFormattingProvider = false + -- end + -- end) + -- end, + -- }, + }, dependencies = { 'saghen/blink.cmp', -- Automatically install LSPs and related tools to stdpath for Neovim @@ -618,7 +637,11 @@ require('lazy').setup({ } local lspconfig = require 'lspconfig' - + -- lspconfig.sqls.setup { + -- on_attach = function(client, bufnr) + -- require('sqls').on_attach(client, bufnr) + -- end, + -- } -- Setup tsserver lspconfig.ts_ls.setup {} end, @@ -934,6 +957,13 @@ require('lazy').setup({ typescript = { 'prettier', stop_after_first = true }, typescriptreact = { 'prettier', stop_after_first = true }, javascriptreact = { 'prettier', stop_after_first = true }, + sql = { 'sqlfluff' }, + }, + formatters = { + sqlfluff = { + command = 'sqlfluff', + args = { 'format', '--dialect', 'postgres', '-' }, + }, }, }, }, @@ -1066,10 +1096,9 @@ require('lazy').setup({ { -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. - -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. + -- priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields require('tokyonight').setup { @@ -1077,17 +1106,17 @@ require('lazy').setup({ comments = { italic = false }, -- Disable italics in comments }, } - -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- vim.cmd.colorscheme 'tokyonight-night' -- vim.cmd.colorscheme 'kanagawa' - -- vim.cmd.colorscheme 'material-deep-ocean' + -- vim.cmd.colorscheme 'material-darker' + vim.cmd.colorscheme 'material-darker' -- vim.cmd.colorscheme 'obscure' -- vim.cmd.colorscheme 'rose-pine' - -- vim.cmd.colorscheme 'e-ink' + -- vim.cmd.colorscheme 'nordfox' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' end, diff --git a/lua/custom/plugins/e-ink.lua b/lua/custom/plugins/e-ink.lua index 12a44191..18c97ff5 100644 --- a/lua/custom/plugins/e-ink.lua +++ b/lua/custom/plugins/e-ink.lua @@ -1,19 +1,19 @@ return { 'alexxGmZ/e-ink.nvim', - priority = 1000, config = function() -- Set background BEFORE applying colorscheme - vim.opt.background = 'light' -- or 'dark' - local mono = require('e-ink.palette').mono() - vim.api.nvim_set_hl(0, 'Cursor', { bg = mono[16] }) - vim.api.nvim_set_hl(0, 'Cursor', { fg = mono[1], bg = mono[16] }) - require('e-ink').setup() - vim.cmd.colorscheme 'e-ink' + -- vim.opt.background = 'light' -- or 'dark' + -- local mono = require('e-ink.palette').mono() + -- vim.api.nvim_set_hl(0, 'Cursor', { bg = mono[16] }) + -- vim.api.nvim_set_hl(0, 'Cursor', { fg = mono[1], bg = mono[16] }) + -- require('e-ink').setup() -- Get palette AFTER colorscheme setup - local everforest = require('e-ink.palette').everforest() + -- local everforest = require('e-ink.palette').everforest() -- Target a VALID highlight group - -- vim.api.nvim_set_hl(0, 'Comment', { fg = everforest.purple }) + -- vim.api.nvim_set_hl(0, 'CursorColumn', { fg = mono[16] }) + -- vim.api.nvim_set_hl(0, 'CursorLine', { fg = mono[16] }) end, } + diff --git a/lua/custom/plugins/ir_black.lua b/lua/custom/plugins/ir_black.lua new file mode 100644 index 00000000..f6acc5c5 --- /dev/null +++ b/lua/custom/plugins/ir_black.lua @@ -0,0 +1 @@ +return { 'kemiller/vim-ir_black' } diff --git a/lua/custom/plugins/material.lua b/lua/custom/plugins/material.lua index 7d341ded..9441997c 100644 --- a/lua/custom/plugins/material.lua +++ b/lua/custom/plugins/material.lua @@ -94,11 +94,11 @@ return { -- -- Add more groups as necessary -- }, -- }, - -- config = function(_, opts) - -- require('material').setup(opts) - -- vim.cmd 'colorscheme material-palenight' - -- end, - -- priority = 1000, + -- config = function(_, opts) + -- require('material').setup(opts) + -- vim.cmd 'colorscheme material-darker' + -- end, + -- priority = 1000, -- }, } -- ... other plugins ... diff --git a/lua/custom/plugins/nightfox.lua b/lua/custom/plugins/nightfox.lua new file mode 100644 index 00000000..8f693c2a --- /dev/null +++ b/lua/custom/plugins/nightfox.lua @@ -0,0 +1,3 @@ +return { + 'EdenEast/nightfox.nvim', +} diff --git a/lua/custom/plugins/nordic.lua b/lua/custom/plugins/nordic.lua index d430ee29..756e59cc 100644 --- a/lua/custom/plugins/nordic.lua +++ b/lua/custom/plugins/nordic.lua @@ -1,2 +1,24 @@ -return { 'AlexvZyl/nordic.nvim' } +return { + 'AlexvZyl/nordic.nvim', + -- lazy = false, + -- priority = 1000, + -- config = function() + -- require('nordic').load() + -- require('nordic').setup({ + -- italic_comments = false, + -- italics = false + -- }) + -- end, + -- styles = { + -- + -- comments = { italic = false }, -- Ensure no italics are set here + -- strings = { italic = false }, -- Ensure no italics are set here + -- keywords = { italic = false }, -- Ensure no italics are set here + -- functions = { italic = false }, -- Ensure no italics are set here + -- variables = { italic = false }, + -- operators = { italic = false }, + -- types = { italic = false }, + -- }, + -- +} diff --git a/lua/custom/plugins/tairiki.lua b/lua/custom/plugins/tairiki.lua new file mode 100644 index 00000000..d7a676cd --- /dev/null +++ b/lua/custom/plugins/tairiki.lua @@ -0,0 +1 @@ +return { 'deparr/tairiki.nvim'} diff --git a/lua/custom/plugins/tomorrow-night.lua b/lua/custom/plugins/tomorrow-night.lua new file mode 100644 index 00000000..a495dff9 --- /dev/null +++ b/lua/custom/plugins/tomorrow-night.lua @@ -0,0 +1 @@ +return { 'chriskempson/vim-tomorrow-theme' }