diff --git a/after/ftplugin/c.lua b/after/ftplugin/c.lua new file mode 100644 index 0000000..db9b490 --- /dev/null +++ b/after/ftplugin/c.lua @@ -0,0 +1,3 @@ +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 +vim.opt_local.softtabstop = 4 diff --git a/after/ftplugin/sshconfig.lua b/after/ftplugin/sshconfig.lua new file mode 100644 index 0000000..7c8fdcc --- /dev/null +++ b/after/ftplugin/sshconfig.lua @@ -0,0 +1,3 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 diff --git a/after/plugin/snips/c.lua b/after/plugin/snips/c.lua new file mode 100644 index 0000000..13f730b --- /dev/null +++ b/after/plugin/snips/c.lua @@ -0,0 +1,61 @@ +if not pcall(require, "luasnip") then + return +end + +local ls = require("luasnip") +local s = ls.snippet +local i = ls.insert_node +local f = ls.function_node +local fmt = require("luasnip.extras.fmt").fmt + +local shared = require("solo.snips") +local same = shared.same +local year = shared.year +local date = shared.date + +ls.add_snippets("c", { + s( + "auth", + fmt( + [[ + // Copyright {} + // Author - Kristiāns Francis Cagulis, kc22015 + // {} + // Created: {} + ]], + { + year(), + i(1), + date(), + } + ) + ), + s( + "fn", + fmt( + [[ + // {}; + // Funkcija {}({}) - + // {} + {} {{ + }} + ]], + { + same(1), + f(function(function_name) + if not function_name[1][1] then + function_name[1][1] = "" + end + local words = {} + for word in function_name[1][1]:gmatch("%w+") do + table.insert(words, word) + end + return words[2] or "" + end, { 1 }), + i(2), + i(0), + i(1), + } + ) + ), +}) diff --git a/lua/plugins/bigfile.lua b/lua/plugins/bigfile.lua index 33e3847..789cf06 100644 --- a/lua/plugins/bigfile.lua +++ b/lua/plugins/bigfile.lua @@ -1,5 +1,6 @@ return { "LunarVim/bigfile.nvim", + event = "BufReadPre", opts = { filesize = 1, -- size of the file in MiB, the plugin round file sizes to the closest MiB pattern = { "*" }, -- autocmd pattern or function see <### Overriding the detection of big files> diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index ba88aa6..8f92650 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -4,7 +4,7 @@ return { dependencies = { "hrsh7th/cmp-buffer", -- buffer completions "hrsh7th/cmp-cmdline", - "FelipeLema/cmp-async-path", -- path completionsplu + "FelipeLema/cmp-async-path", -- path completions "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-nvim-lsp", { "Saecki/crates.nvim", event = { "BufRead Cargo.toml" } }, @@ -13,7 +13,7 @@ return { dependencies = { "nvim-lua/plenary.nvim" }, event = { "BufRead pyproject.toml", "BufRead requirements.txt", "BufRead requirements_dev.txt" }, }, - { "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } }, + -- { "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } }, "SergioRibera/cmp-dotenv", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", @@ -71,7 +71,7 @@ return { }), -- Accept currently selected item. If none selected, `select` first item. -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.confirm({ select = true }), }, sources = { { name = "nvim_lua" }, @@ -82,7 +82,7 @@ return { { name = "buffer", keyword_length = 4 }, { name = "neorg" }, { name = "pypi" }, - { name = "dadbod" }, + -- { name = "dadbod" }, { name = "env" }, { name = "calc" }, { name = "emoji" }, @@ -116,7 +116,7 @@ return { neorg = "[neorg]", crates = "[crates]", pypi = "[pypi]", - dadbod = "[dadbod]", + -- dadbod = "[dadbod]", env = "[env]", buffer = "[buf]", })[entry.source.name] @@ -138,11 +138,11 @@ return { }, }) - cmp.setup.cmdline("/", { + --[[ cmp.setup.cmdline("/", { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "buffer" }, }, - }) + }) ]] end, } diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua index e09f537..f17bac8 100644 --- a/lua/plugins/codeium.lua +++ b/lua/plugins/codeium.lua @@ -1,6 +1,8 @@ return { "Exafunction/codeium.nvim", - enabled = false, - dependencies = { "nvim-lua/plenary.nvim" }, + event = "BufEnter", + dependencies = { + "nvim-lua/plenary.nvim", + }, opts = {}, } diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua index 6745499..c2d0450 100644 --- a/lua/plugins/colorizer.lua +++ b/lua/plugins/colorizer.lua @@ -1,7 +1,7 @@ return { "NvChad/nvim-colorizer.lua", opts = { - filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss", "python" }, + filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss", "python", "typst" }, user_default_options = { RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 43dd863..f3949e0 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -24,5 +24,6 @@ return { { "EdenEast/nightfox.nvim" }, { "navarasu/onedark.nvim" }, { "savq/melange-nvim" }, + { "ellisonleao/gruvbox.nvim" }, { "bluz71/vim-nightfly-colors", name = "nightfly" }, } diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 2e04aa5..ecc01d6 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -1,6 +1,7 @@ return { "zbirenbaum/copilot.lua", event = "InsertEnter", + enabled = false, opts = { panel = { enabled = false, diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua index e6e8e05..7905579 100644 --- a/lua/plugins/dadbod.lua +++ b/lua/plugins/dadbod.lua @@ -1,5 +1,14 @@ return { - { "tpope/vim-dadbod" }, - { "kristijanhusak/vim-dadbod-ui" }, - { "kristijanhusak/vim-dadbod-completion" }, + "kristijanhusak/vim-dadbod-ui", + dependencies = { + { "tpope/vim-dotenv" }, + { "tpope/vim-dadbod" }, + { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } }, + }, + cmd = { + "DBUI", + "DBUIToggle", + "DBUIAddConnection", + "DBUIFindBuffer", + }, } diff --git a/lua/plugins/hlargs.lua b/lua/plugins/hlargs.lua new file mode 100644 index 0000000..5b0b294 --- /dev/null +++ b/lua/plugins/hlargs.lua @@ -0,0 +1,4 @@ +return { + "m-demare/hlargs.nvim", + opts = {}, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 2f6e701..9e5326e 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -41,7 +41,7 @@ return { "i", "", vim.lsp.buf.signature_help, - { buffer = event.buf, desc = "Signature Documentation" } + { buffer = event.buf, desc = "LSP: Signature Documentation" } ) nmap("wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder") nmap("wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder") @@ -58,7 +58,7 @@ return { local trouble = require("trouble") trouble.open("workspace_diagnostics") trouble.next({ skip_groups = true, jump = true }) - end, "Trouble Next") + end, "LSP: Trouble Next") nmap("[d", function() local trouble = require("trouble") trouble.open("workspace_diagnostics") @@ -68,7 +68,7 @@ return { { "n", "v" }, "la", vim.lsp.buf.code_action, - { buffer = event.buf, desc = "Code [A]ction" } + { buffer = event.buf, desc = "LSP: Code [A]ction" } ) nmap("gr", function() require("trouble").toggle("lsp_references") @@ -131,7 +131,6 @@ return { "jsonls", "lua_ls", "tailwindcss", - "taplo", "texlab", "tsserver", }, @@ -160,6 +159,12 @@ return { lua_ls = function() require("plugins.lsp.lua").setup(lsp, lsp_capabilities) end, + htmx = function() + local opts = { + filetypes = { "html", "htmldjango" }, + } + require("lspconfig").htmx.setup(opts) + end, }, }) end, diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 9f576d9..f801a3b 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -2,6 +2,7 @@ return { "nvim-neorg/neorg", build = ":Neorg sync-parsers", dependencies = { "nvim-lua/plenary.nvim" }, + cmd = { "Neorg" }, ft = "norg", opts = { load = { diff --git a/lua/plugins/null_ls.lua b/lua/plugins/null_ls.lua index 8b1c6a7..3e1a15c 100644 --- a/lua/plugins/null_ls.lua +++ b/lua/plugins/null_ls.lua @@ -17,8 +17,6 @@ return { -- Here you can add tools not supported by mason.nvim -- make sure the source name is supported by null-ls -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md - formatting.ruff.with({ extra_args = { "format" } }), - diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }), formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }), formatting.prettier.with({ extra_filetypes = { "toml" }, @@ -33,27 +31,44 @@ return { "strict", }, }), - -- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), - -- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), - -- formatting.sqlfluff.with({ extra_args = { "--dialect", "postgres" } }), + formatting.sql_formatter.with({ + extra_args = { + "-c", + [[ + { + "language": "postgresql", + "dialect": "postgresql", + "tabWidth": 2, + "useTabs": false, + "keywordCase": "upper", + "dataTypeCase": "upper", + "functionCase": "upper", + "identifierCase": "upper", + "indentStyle": "standard", + "logicalOperatorNewline": "before", + "expressionWidth": "80", + "linesBetweenQueries": 2, + "denseOperators": false, + "newlineBeforeSemicolon": false + } + ]], + }, + }), + formatting.rustywind.with({ extra_filetypes = { "htmldjango" } }), }, }) require("mason-null-ls").setup({ ensure_installed = { - "cbfmt", "clang_format", "cmake_format", "cmake_lint", - "cpplint", "djlint", "google_java_format", - "luacheck", + "selene", "mypy", "stylua", "yamlfmt", "rustywind", - "ruff", - "letexindent", }, automatic_installation = true, handlers = { diff --git a/lua/plugins/presence.lua b/lua/plugins/presence.lua index 59cde08..b23ff1a 100644 --- a/lua/plugins/presence.lua +++ b/lua/plugins/presence.lua @@ -1 +1,26 @@ -return { "andweeb/presence.nvim" } +return { + "andweeb/presence.nvim", + --[[ opts = { + -- General options + auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) + neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image + main_image = "neovim", -- Main image display (either "neovim" or "file") + -- client_id = "", -- Use your own Discord application client id (not recommended) + log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") + debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) + enable_line_number = false, -- Displays the current line number instead of the current project + blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches + buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "