From ea6f2b418dc96a093ce438187dbabe4195b24b82 Mon Sep 17 00:00:00 2001 From: iodeslykos <42@iodeslykos.com> Date: Mon, 3 Feb 2025 09:34:57 -0500 Subject: [PATCH] feat: Bloated config to hack away at --- init.lua | 204 ++++++++++++++++++++++++++++---- lua/kickstart/plugins/debug.lua | 8 +- lua/kickstart/plugins/lint.lua | 68 +++++++++-- 3 files changed, 248 insertions(+), 32 deletions(-) diff --git a/init.lua b/init.lua index 4eae8e7d..58478671 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -616,18 +616,45 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs + -- See `:help lspconfig-all` for a list of all the pre-configured LSPs. + ansiblels = {}, + arduino_language_server = {}, + awk_ls = {}, + bashls = {}, + clangd = {}, + codeqlls = {}, + cssls = {}, + docker_compose_language_service = {}, + dockerls = {}, + eslint = {}, + golangci_lint_ls = {}, + gradle_ls = {}, + graphql = {}, + groovyls = {}, + helm_ls = {}, + html = {}, + java_language_server = {}, + jinja_lsp = {}, + jqls = {}, + jsonls = {}, + kotlin_language_server = {}, + powershell_es = {}, + pyright = {}, + ruff = {}, + rust_analyzer = {}, + sqlls = {}, + taplo = {}, + terraformls = {}, + vale_ls = {}, + vimls = {}, + yamlls = {}, + zls = {}, -- -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - -- + ts_ls = {}, lua_ls = { -- cmd = { ... }, @@ -638,8 +665,12 @@ require('lazy').setup({ completion = { callSnippet = 'Replace', }, + telemetry = { enable = false }, + diagnostics = { + disable = { 'missing-fields' } + }, + -- workspace = { checkThirdParty = false }, -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, }, }, }, @@ -712,16 +743,35 @@ require('lazy').setup({ } end, formatters_by_ft = { + bash = { 'shfmt' }, + go = { 'gofmt', 'goimports', 'gotests' }, + hcl = { 'tofu_fmt' }, lua = { 'stylua' }, + markdown = { 'markdownlint' }, + python = { 'ruff_format', 'ruff_fix' }, + rust = { 'rustfmt', lsp_format = 'fallback' }, + sh = { 'shfmt' }, + terraform = { 'tofu_fmt' }, + tofu = { 'tofu_fmt' }, + xml = { 'xmlformatter' }, + zsh = { 'shfmt' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { "prettierd" }, -- "prettier", stop_after_first = true }, + typescript = { 'prettierd' }, -- 'prettier', stop_after_first = true }, + markdown = { 'prettierd' }, -- 'prettier', stop_after_first = true }, + json = { 'prettierd' }, -- 'prettier', stop_after_first = true }, + yaml = { 'prettierd', 'yamlfmt' }, -- 'prettier', stop_after_first = true }, + }, + format_on_save = { + lsp_fallback = true, + async = true, + timeout_ms = 1000, }, }, }, - { -- Autocompletion 'hrsh7th/nvim-cmp', event = 'InsertEnter', @@ -837,28 +887,59 @@ require('lazy').setup({ } end, }, - { -- 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', + -- 'folke/tokyonight.nvim', + -- 'joshdick/onedark.vim', -- GOAT. + 'olimorris/onedarkpro.nvim', -- New hotness? + -- 'KeitaNakamura/neodark.vim', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- 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 'tokyonight-night' + -- vim.cmd.colorscheme 'onedark' -- Valid for both onedark.nvim and onedarkpro.nvim themes. + vim.cmd.colorscheme 'onedark_vivid' -- Valid for onedarkpro.nvim. + -- vim.cmd.colorscheme 'neodark' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' end, }, - + { + -- "A light and configurable statusline/tabline plugin for Vim" + -- 'itchyny/lightline.vim', + -- "Lean & mean status/tabline for vim that's light as air." + -- 'vim-airline/vim-airline', + -- Uncomment to enable lightline.vim and vim-airline themes compatible with 'joshdick/onedark.vim'. + -- vim.g.lightline.colorscheme 'onedark', + -- vim.g.airline_theme 'onedark', + -- Set lualine as statusline. `:help lualine.txt` + 'nvim-lualine/lualine.nvim', + opts = { + options = { + icons_enabled = true, + theme = 'onedark_vivid', + component_separators = '|', + section_separators = '', + }, + }, + }, + -- Recommended for improved syntax highlighting with 'joshdick/onedark.vim'. + -- Incompatible with 'tpope/vim-sleuth'. + -- 2747: Vim(let):E741: Value is locked: g:loaded_sleuth + -- { + -- 'sheerun/vim-polyglot', + -- }, -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - + { -- GitHub Copilot. `:Copilot setup` + 'github/copilot.vim' + }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', config = function() @@ -880,17 +961,17 @@ require('lazy').setup({ -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' + -- local statusline = require 'mini.statusline' -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } + -- statusline.setup { use_icons = vim.g.have_nerd_font } -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for -- cursor location to LINE:COLUMN ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim @@ -898,11 +979,86 @@ require('lazy').setup({ }, { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, build = ':TSUpdate', main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { + -- Gotta sort and reassign these. + -- This variable can only handle base languages. + 'arduino', + -- 'arduino_language_server', + 'awk', + -- 'awk-language-server', + 'bash', + -- 'bash-language-server', 'shellcheck', 'shfmt', 'shellharden', + 'c', + 'cmake', + -- 'clangd', 'cmakelint', 'cmake-language-server', 'checkmake', + 'csv', + 'diff', + 'dockerfile', + 'fish', + 'git_config', 'git_rebase', 'gitattributes', 'gitignore', + -- 'gh', 'actionlint', + 'go', 'gomod', 'gosum', 'gotmpl', + -- 'gopls', 'gotests', + 'gpg', + 'graphql', + 'groovy', + -- 'hadolint', + 'hcl', + -- 'hclfmt', + 'html', + 'java', + 'javascript', + -- 'jinja-lsp', + 'jq', 'json', 'json5', + -- 'json-lsp', 'jsonld-lsp', 'jsonlint', 'jq-lsp', + 'kotlin', + -- 'kotlin-language-server', 'ktfmt', 'ktlint', + 'lua', + -- 'lua-language-server', 'luadoc', + 'markdown', + -- 'markdownlint', 'markdownlint-cli2', + -- 'matlab', + -- 'mermaid', -- Experimental. + 'passwd', + -- 'perl', + 'powershell', + -- 'powershell-editor-services', + -- 'prolog', + 'python', + -- 'pylint', 'requirements', 'ruff', 'ruff-lsp', + 'query', + 'regex', + 'rust', + -- 'rust-analyzer', + -- 'semgrep', + -- 'snyk', + -- 'snyk-ls', + 'sql', + -- 'sqlls', 'sqlfluff', 'sqlfmt', + 'ssh_config', + 'terraform', + -- 'terraform-ls', 'tflint', + 'tmux', + -- 'trivy', + 'typescript', + -- 'typescript-language-server', + -- 'vale', + 'vim', 'vimdoc', + -- 'vim-language-server', + 'xml', + -- 'xmlformatter', + 'yaml', + -- 'yamlfmt', 'yamllint', 'yamlfix', + 'zig', + -- 'zls', + }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -933,10 +1089,10 @@ require('lazy').setup({ -- -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', + require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 753cb0ce..9cd39e3b 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -94,7 +94,13 @@ return { -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want - 'delve', + 'bash-debug-adapter', + -- 'cpptools', + 'debugpy', + -- 'delve', + -- 'java-debug-adapter', + -- 'js-debug-adapter', + -- 'kotlin-debug-adapter', }, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 9a0e282d..5762b96b 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,18 +1,74 @@ return { - { -- Linting 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, + dependencies = { + { 'williamboman/mason.nvim', config = true }, + 'rshkarin/mason-nvim-lint', + }, + enabled = true, + event = { 'BufReadPre', 'BufNewFile', 'InsertLeave' }, config = function() local lint = require 'lint' + local ensure_installed = { + 'actionlint', + 'ansible-lint', + 'cmakelint', + 'cpplint', + 'eslint_d', + 'golangci-lint', + 'hadolint', + 'jsonlint', + 'ktlint', + 'luacheck', + 'markdownlint', + -- 'markdownlint-cli2', + -- 'npm-groovy-lint', + 'pylint', + -- 'semgrep', + 'shellcheck', + 'shellharden', + 'shfmt', + 'tflint', + 'trivy', + 'typos', + 'yamllint', + } + require('mason-nvim-lint').setup{ + automatic_installation = true, + ensure_installed = ensure_installed, + -- ignore_install = {}, + } lint.linters_by_ft = { + ansible = { 'ansible_lint' }, + bash = { 'shellcheck', 'shellharden' }, clojure = { nil }, + dockerfile = { 'hadolint' }, + -- helm = { 'helm_lint'}, -- helm_lint is currently available. inko = { nil }, janet = { nil }, + -- java = { 'semgrep' }, -- Need to find an alternative here. + javascript = { 'eslint_d' }, + json = { 'jsonlint' }, + kotlin = { 'ktlint' }, + -- gitcommit = { 'gitlint', 'gitleaks' }, -- Handled better by `pre-commit`. + go = { 'golangcilint' }, + -- graphql = { 'prettierd' }, + -- groovy = { 'npm-groovy-lint' }, + latex = { 'vale' }, + lua = { 'luacheck' }, markdown = { 'markdownlint' }, - terraform = { 'tflint'}, + postgres = { 'sqlfluff' }, + python = { 'pylint', 'ruff' }, + -- rust = { 'bacon' }, -- bacon is present in the registry, but does not function. + sh = { 'shellcheck', 'shellharden' }, + sql = { 'sqlfluff' }, + terraform = { 'tflint' }, tofu = { 'tflint' }, + -- toml = { '' }, text = { 'vale' }, + typescript = { 'eslint_d' }, + yaml = { 'yamllint', 'actionlint' }, + zsh = { 'shellcheck', 'shellharden' }, } -- To allow other plugins to add linters to require('lint').linters_by_ft, @@ -47,8 +103,6 @@ return { -- lint.linters_by_ft['terraform'] = nil -- lint.linters_by_ft['text'] = nil - -- Create autocommand which carries out the actual linting - -- on the specified events. local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, @@ -57,10 +111,10 @@ return { -- avoid superfluous noise, notably within the handy LSP pop-ups that -- describe the hovered symbol using Markdown. if vim.opt_local.modifiable:get() then - lint.try_lint() + lint.try_lint() end end, }) end, - }, + } }