Sun, 05 Mar 2023 19:32:15 -0600
Apply stylua
--- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -8,4 +8,3 @@ require("config.lsp") -- >> Builtin g.netrw_altfile = 1 g.netrw_use_errorwindow = 0 -
--- a/.config/nvim/lua/config/lsp.lua +++ b/.config/nvim/lua/config/lsp.lua @@ -3,8 +3,8 @@ local diag_float_max_threshold = "INFO" vim.diagnostic.config({ severity_sort = true, - underline = { severity = {min = diag_virtual_min_threshold} }, - virtual_text = { true, severity = {min = diag_virtual_min_threshold} }, + underline = { severity = { min = diag_virtual_min_threshold } }, + virtual_text = { true, severity = { min = diag_virtual_min_threshold } }, float = { source = "if_many" }, }) @@ -27,25 +27,25 @@ vim.api.nvim_create_autocmd("LspAttach", -- enable auto diags in message area for below threshold vim.api.nvim_create_autocmd("CursorHold", { - group = vim.api.nvim_create_augroup("lsp_buf_diags", {clear = true}), + group = vim.api.nvim_create_augroup("lsp_buf_diags", { clear = true }), buffer = bufnr, callback = function(opts, bufnr, line_nr, client_id) vim.diagnostic.open_float(nil, { focusable = false, - close_events = {"BufLeave", "CursorMoved", "InsertEnter", "FocusLost"}, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, scope = "line", - severity = {max = diag_float_max_threshold}, + severity = { max = diag_float_max_threshold }, }) end, }) - end + end, }) -- Format on write, but only certain languages local autoformat_filetypes = { elixir = true, go = true } vim.api.nvim_create_autocmd("BufWritePre", { - group = vim.api.nvim_create_augroup("lsp_autoformat", {clear = true}), + group = vim.api.nvim_create_augroup("lsp_autoformat", { clear = true }), callback = function(opts, bufnr) if autoformat_filetypes[vim.bo.filetype] then vim.lsp.buf.formatting_seq_sync(nil, 100) @@ -57,15 +57,14 @@ vim.api.nvim_create_autocmd("BufWritePre if vim.fn.executable("standardrb") == 1 then vim.api.nvim_create_autocmd("FileType", { pattern = "ruby", - group = vim.api.nvim_create_augroup("lsp_ruby", {clear = true}), + group = vim.api.nvim_create_augroup("lsp_ruby", { clear = true }), once = true, callback = function() require("lspconfig").standardrb.setup({ autostart = true, - single_file_support = true + single_file_support = true, }) vim.cmd.LspStart("standardrb") end, }) end -
--- a/.config/nvim/lua/config/maps.lua +++ b/.config/nvim/lua/config/maps.lua @@ -1,4 +1,3 @@ - local function map(mode, lhs, rhs, opts) opts = opts or {} opts.silent = opts.silent ~= false @@ -8,7 +7,7 @@ end map("n", "<F2>", ":20Lexplore<CR>") map("n", "<F3>", "n") map("n", "<S-F3>", "N") -map("", "<F4>", ":let v:hlsearch = !v:hlsearch<CR>") +map("", "<F4>", ":let v:hlsearch = !v:hlsearch<CR>") map("n", "<F5>", ":UndotreeToggle<CR>") map("n", "<F8>", ":TagbarToggle<CR>") @@ -36,10 +35,10 @@ map("n", "<C-Right>", "<cmd>vertical res -- buffer switching map("n", "gb", "<C-^>") -map("n", "gB", ":ls<CR>:b ", {silent = false}) +map("n", "gB", ":ls<CR>:b ", { silent = false }) -- Select last paste, in the same mode it was pasted in -map("n", "gV", "'`[' . strpart(getregtype(), 0, 1) . '`]'", {expr=true}) +map("n", "gV", "'`[' . strpart(getregtype(), 0, 1) . '`]'", { expr = true }) -- Add undo break-points map("i", ",", ",<c-g>u") @@ -50,8 +49,8 @@ map("i", ";", ";<c-g>u") map("v", "<", "<gv") map("v", ">", ">gv") -map("n", "j", "v:count == 0 ? 'gj' : 'j'", {expr = true}) -map("n", "k", "v:count == 0 ? 'gk' : 'k'", {expr = true}) +map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true }) +map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true }) -- Use ltag over tselect map("n", "g<C-]>", ":exe 'ltag ' . expand('<cword>') | lopen<CR>") @@ -74,10 +73,10 @@ map("n", "<leader>tm", ":Tabularize meth map("n", "<leader>a", ":call vimrc#AutoFmtToggle()<CR>") -- LSP features -map('n', '<leader>d', vim.diagnostic.open_float) -map('n', '[d', vim.diagnostic.goto_prev) -map('n', ']d', vim.diagnostic.goto_next) -map('n', '<leader>ld', vim.diagnostic.setloclist) +map("n", "<leader>d", vim.diagnostic.open_float) +map("n", "[d", vim.diagnostic.goto_prev) +map("n", "]d", vim.diagnostic.goto_next) +map("n", "<leader>ld", vim.diagnostic.setloclist) vim.api.nvim_create_augroup("lsp_attach", {}) @@ -85,23 +84,24 @@ vim.api.nvim_create_autocmd("LspAttach", group = "lsp_attach", callback = function(args) local bufnr = args.buf - local bufopts = { buffer=bufnr } + local bufopts = { buffer = bufnr } - map('n', 'gD', vim.lsp.buf.declaration, bufopts) - map('n', 'gd', vim.lsp.buf.definition, bufopts) - map('n', 'K', vim.lsp.buf.hover, bufopts) - map('n', 'gi', vim.lsp.buf.implementation, bufopts) - map('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) - map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) - map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) - map('n', '<leader>wl', function() + map("n", "gD", vim.lsp.buf.declaration, bufopts) + map("n", "gd", vim.lsp.buf.definition, bufopts) + map("n", "K", vim.lsp.buf.hover, bufopts) + map("n", "gi", vim.lsp.buf.implementation, bufopts) + map("n", "<C-k>", vim.lsp.buf.signature_help, bufopts) + map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts) + map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts) + map("n", "<leader>wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) - map('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) - map('n', '<leader>rn', vim.lsp.buf.rename, bufopts) - map('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) - map('n', 'gr', vim.lsp.buf.references, bufopts) - map('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts) + map("n", "<leader>D", vim.lsp.buf.type_definition, bufopts) + map("n", "<leader>rn", vim.lsp.buf.rename, bufopts) + map("n", "<leader>ca", vim.lsp.buf.code_action, bufopts) + map("n", "gr", vim.lsp.buf.references, bufopts) + map("n", "<leader>f", function() + vim.lsp.buf.format({ async = true }) + end, bufopts) end, }) -
--- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -26,11 +26,11 @@ o.winminwidth = 5 -- Behavior o.autowriteall = true o.backup = true -o.completeopt = {"menu", "menuone", "noselect"} +o.completeopt = { "menu", "menuone", "noselect" } o.hidden = false o.ignorecase = true o.scrolloff = 15 -o.sessionoptions = {"buffers", "curdir", "localoptions"} +o.sessionoptions = { "buffers", "curdir", "localoptions" } o.sidescrolloff = 10 o.smartcase = true o.splitbelow = true @@ -40,10 +40,10 @@ o.wildignorecase = true -- Paths o.backupdir:remove(".") -o.tags:append({".tags", "./.tags;"}) +o.tags:append({ ".tags", "./.tags;" }) o.wildignore = "*~,*.o,*.pyc,.git/*,hg/*,.svn/*" if vim.fn.executable("ag") then o.grepprg = "ag --vimgrep" - o.grepformat = {"%f:%l:%c:%m", "%f"} + o.grepformat = { "%f:%l:%c:%m", "%f" } end
--- a/.config/nvim/lua/lazy-bootstrap.lua +++ b/.config/nvim/lua/lazy-bootstrap.lua @@ -1,6 +1,13 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) @@ -13,7 +20,7 @@ require("lazy").setup({ colorscheme = "jellybeans", }, }, - { import = "plugins" } + { import = "plugins" }, }, change_detection = { enabled = false }, performance = {
--- a/.config/nvim/lua/plugins/completion.lua +++ b/.config/nvim/lua/plugins/completion.lua @@ -34,10 +34,10 @@ return { ["<Tab>"] = cmp.mapping.select_next_item(), ["<S-Tab>"] = cmp.mapping.select_prev_item(), ["<C-g>"] = cmp.mapping.abort(), - ["<Right>"] = cmp.mapping.confirm({select = true}), + ["<Right>"] = cmp.mapping.confirm({ select = true }), ["<Space>"] = function(fallback) if cmp.visible() then - cmp.confirm({select = false}, function() + cmp.confirm({ select = false }, function() vim.api.nvim_feedkeys(" ", "n", false) end) end @@ -58,4 +58,3 @@ return { end, }, } -
--- a/.config/nvim/lua/plugins/editing.lua +++ b/.config/nvim/lua/plugins/editing.lua @@ -15,10 +15,20 @@ g.tagbar_width = 30 -- >> interestingwords -- These are jellybeans colors and some complements g.interestingWordsGUIColors = { - '#C4A258','#6AADA0', '#71B9F8', '#A037B0', '#CF6A4C', '#D8AD4C', + "#C4A258", + "#6AADA0", + "#71B9F8", + "#A037B0", + "#CF6A4C", + "#D8AD4C", } g.interestingWordsTermColors = { - '179', '73', '75', '133', '167', '136', + "179", + "73", + "75", + "133", + "167", + "136", } return { @@ -28,16 +38,16 @@ return { "tomtom/tcomment_vim", "tpope/vim-endwise", "godlygeek/tabular", - {"mbbill/undotree", cmd = "UndotreeToggle"}, + { "mbbill/undotree", cmd = "UndotreeToggle" }, "tpope/vim-vinegar", "lfv89/vim-interestingwords", "kshenoy/vim-signature", - {"majutsushi/tagbar", cmd = "TagbarToggle"}, + { "majutsushi/tagbar", cmd = "TagbarToggle" }, { "RRethy/vim-illuminate", - event = {"BufReadPost", "BufNewFile"}, + event = { "BufReadPost", "BufNewFile" }, opts = { delay = 250, large_file_cutoff = 15000,
--- a/.config/nvim/lua/plugins/etc.lua +++ b/.config/nvim/lua/plugins/etc.lua @@ -1,20 +1,24 @@ local g = vim.g -g.vimwiki_auto_chdir = 1 +g.vimwiki_auto_chdir = 1 g.vimwiki_auto_header = 1 -g.vimwiki_ext2syntax = {[vim.type_idx]=vim.types.dictionary} +g.vimwiki_ext2syntax = { [vim.type_idx] = vim.types.dictionary } g.vimwiki_list = { { - path = '~/vimwiki/', - auto_tags = 1, auto_toc = 1, automatic_nested_syntaxes = 1 + path = "~/vimwiki/", + auto_tags = 1, + auto_toc = 1, + automatic_nested_syntaxes = 1, }, { - path = '~/Documents/SpiderOak Hive/vimwiki', - auto_tags = 1, auto_toc = 1, automatic_nested_syntaxes = 1 - } + path = "~/Documents/SpiderOak Hive/vimwiki", + auto_tags = 1, + auto_toc = 1, + automatic_nested_syntaxes = 1, + }, } return { - 'vimwiki/vimwiki', + "vimwiki/vimwiki", }
--- a/.config/nvim/lua/plugins/filetype.lua +++ b/.config/nvim/lua/plugins/filetype.lua @@ -8,30 +8,30 @@ g.perl_compiler_force_warnings = 0 return { { - 'nvim-treesitter/nvim-treesitter', + "nvim-treesitter/nvim-treesitter", build = function() - require('nvim-treesitter.install').update({ with_sync = true }) + require("nvim-treesitter.install").update({ with_sync = true }) end, config = function() - require('nvim-treesitter.configs').setup({ + require("nvim-treesitter.configs").setup({ highlight = { enable = true }, indent = { enable = true }, ensure_installed = { - 'c', - 'comment', - 'eex', - 'elixir', - 'heex', - 'help', - 'lua', - 'surface', - 'vim', + "c", + "comment", + "eex", + "elixir", + "heex", + "help", + "lua", + "surface", + "vim", }, }) end, }, - 'Shougo/vinarise.vim', - 'asciidoc/vim-asciidoc', - {'vim-perl/vim-perl', branch = 'dev'}, - 'yko/mojo.vim', + "Shougo/vinarise.vim", + "asciidoc/vim-asciidoc", + { "vim-perl/vim-perl", branch = "dev" }, + "yko/mojo.vim", }
--- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,7 +1,7 @@ return { "neovim/nvim-lspconfig", - {"williamboman/mason.nvim", config = true}, - {"j-hui/fidget.nvim", config = true}, + { "williamboman/mason.nvim", config = true }, + { "j-hui/fidget.nvim", config = true }, { "williamboman/mason-lspconfig.nvim", @@ -10,19 +10,19 @@ return { require("mason-lspconfig").setup_handlers({ function(server) require("lspconfig")[server].setup({ - capabilities = require('cmp_nvim_lsp').default_capabilities() + capabilities = require("cmp_nvim_lsp").default_capabilities(), }) end, - gopls = function () + gopls = function() require("lspconfig").gopls.setup({ - capabilities = require('cmp_nvim_lsp').default_capabilities(), - settings = { gopls = { gofumpt = true } } + capabilities = require("cmp_nvim_lsp").default_capabilities(), + settings = { gopls = { gofumpt = true } }, }) end, - solargraph = function () + solargraph = function() require("lspconfig").solargraph.setup({ - capabilities = require('cmp_nvim_lsp').default_capabilities(), - init_options = { formatting = false } + capabilities = require("cmp_nvim_lsp").default_capabilities(), + init_options = { formatting = false }, }) end, })
--- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -18,26 +18,26 @@ return { component_separators = "", }, sections = { - lualine_a = {'mode'}, - lualine_b = {'filename'}, - lualine_c = {'diagnostics'}, - lualine_x = {'encoding', 'fileformat'}, - lualine_y = {'filetype'}, - lualine_z = {'progress', 'location'} + lualine_a = { "mode" }, + lualine_b = { "filename" }, + lualine_c = { "diagnostics" }, + lualine_x = { "encoding", "fileformat" }, + lualine_y = { "filetype" }, + lualine_z = { "progress", "location" }, }, tabline = { - lualine_a = { {'buffers', mode = 4, show_filename_only = false} }, - lualine_z = { 'branch' }, + lualine_a = { { "buffers", mode = 4, show_filename_only = false } }, + lualine_z = { "branch" }, }, - extensions = {"quickfix"}, - } + extensions = { "quickfix" }, + }, }, { "lukas-reineke/indent-blankline.nvim", event = "BufReadPost", keys = { - {"<leader>ig", "<cmd>IndentBlanklineToggle<cr>"}, + { "<leader>ig", "<cmd>IndentBlanklineToggle<cr>" }, }, opts = { enabled = false, @@ -57,7 +57,9 @@ return { -- symbol = "▏", options = { try_as_border = true }, draw = { - animation = function() return 2 end, + animation = function() + return 2 + end, }, }, config = function(_, opts)