From 1640e1c3b64328a30f2fe429c4e1c2e507e3a256 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Tue, 11 Apr 2023 00:06:37 +0200 Subject: [PATCH] Fixed formatting --- nvim/.config/nvim/init.lua | 56 +++++++++++-------- nvim/.config/nvim/lua/autocmds.lua | 46 +++++++-------- .../nvim/lua/constant/symbols/diagnostic.lua | 19 +++---- .../nvim/lua/constant/symbols/file.lua | 4 +- .../nvim/lua/constant/symbols/fold.lua | 4 +- .../.config/nvim/lua/constant/symbols/git.lua | 1 - .../nvim/lua/constant/symbols/init.lua | 6 +- nvim/.config/nvim/lua/plugins/autopairs.lua | 1 - nvim/.config/nvim/lua/plugins/bufdel.lua | 22 ++++++-- nvim/.config/nvim/lua/plugins/bufferline.lua | 4 +- nvim/.config/nvim/lua/plugins/colorizer.lua | 2 +- nvim/.config/nvim/lua/plugins/comment.lua | 6 +- nvim/.config/nvim/lua/plugins/neotree.lua | 2 +- nvim/.config/nvim/lua/plugins/null-ls.lua | 2 +- nvim/.config/nvim/lua/plugins/peek.lua | 10 ++-- .../nvim/lua/plugins/symbols-outline.lua | 10 +++- nvim/.config/nvim/lua/plugins/treesj.lua | 12 ++-- nvim/.config/nvim/lua/plugins/trouble.lua | 2 +- nvim/.config/nvim/lua/plugins/whitespace.lua | 3 +- 19 files changed, 119 insertions(+), 93 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index edb8cdd..f0f7070 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -35,7 +35,6 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now :) --]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -69,7 +68,8 @@ require('lazy').setup({ -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. - { -- LSP Configuration & Plugins + { + -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs to stdpath for neovim @@ -111,17 +111,21 @@ require('lazy').setup({ handler_opts = { -- TODO: Setup borders for other lsp stuff (Maybe using noice?) border = "single" - }} + } + } }, - { -- Autocompletion + { + -- Autocompletion 'hrsh7th/nvim-cmp', - dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path', 'onsails/lspkind-nvim', }, + dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path', + 'onsails/lspkind-nvim', }, }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { -- Adds git releated signs to the gutter, as well as utilities for managing changes + { 'folke/which-key.nvim', opts = {} }, + { + -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { -- See `:help gitsigns.txt` @@ -135,24 +139,26 @@ require('lazy').setup({ }, }, - { -- Set lualine as statusline + { + -- Set lualine as statusline 'nvim-lualine/lualine.nvim', -- See `:help lualine.txt` opts = { options = { icons_enabled = true, theme = 'gruvbox', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, }, sections = { lualine_b = { 'branch', 'diff', - { 'diagnostics', symbols = {error = '', warn = '', info = '', hint = ''} }, + { 'diagnostics', symbols = { error = '', warn = '', info = '', hint = '' } }, }, lualine_c = { - { 'filename', + { + 'filename', path = 1, symbols = { modified = symbols.file.modified, @@ -172,7 +178,8 @@ require('lazy').setup({ }, }, - { -- Add indentation guides even on blank lines + { + -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` @@ -184,7 +191,9 @@ require('lazy').setup({ -- Fuzzy Finder (files, lsp, etc) - { 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-ui-select.nvim' } }, + { 'nvim-telescope/telescope.nvim', version = '*', + dependencies = { 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-ui-select.nvim' } }, -- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Only load if `make` is available. Make sure you have the system @@ -199,7 +208,8 @@ require('lazy').setup({ end, }, - { -- Highlight, edit, and navigate code + { + -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', @@ -351,7 +361,8 @@ require('nvim-treesitter.configs').setup { -- LSP settings. -- Set the diagnostic symbols (Also used by Neo-tree) -local signs = { Error = symbols.diagnostic.error, Warn = symbols.diagnostic.warning, Hint = symbols.diagnostic.hint, Info = symbols.diagnostic.info } +local signs = { Error = symbols.diagnostic.error, Warn = symbols.diagnostic.warning, Hint = symbols.diagnostic.hint, + Info = symbols.diagnostic.info } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) @@ -379,7 +390,8 @@ local on_attach = function(client, bufnr) -- nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') -- Should allow code actions in visual mode - vim.keymap.set({'v', 'n'}, 'ca', vim.lsp.buf.code_action, { buffer = bufnr, desc = 'LSP: [C]ode [A]ction', remap=true }) + vim.keymap.set({ 'v', 'n' }, 'ca', vim.lsp.buf.code_action, + { buffer = bufnr, desc = 'LSP: [C]ode [A]ction', remap = true }) -- nmap('ca', require('telescope.builtin')., '[C]ode [A]ction') nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') @@ -419,10 +431,10 @@ local on_attach = function(client, bufnr) }) end - -- Attach document colour support - if client.server_capabilities.colorProvider then - require("document-color").buf_attach(bufnr) - end + -- Attach document colour support + if client.server_capabilities.colorProvider then + require("document-color").buf_attach(bufnr) + end end -- Enable the following language servers @@ -475,7 +487,7 @@ require('neodev').setup() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities.textDocument.colorProvider = { - dynamicRegistration = true + dynamicRegistration = true } -- Setup mason so it can manage external tooling diff --git a/nvim/.config/nvim/lua/autocmds.lua b/nvim/.config/nvim/lua/autocmds.lua index 3d053e4..4632621 100644 --- a/nvim/.config/nvim/lua/autocmds.lua +++ b/nvim/.config/nvim/lua/autocmds.lua @@ -1,34 +1,34 @@ -- Highlight on yank local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank({ higroup = 'YankHighlight'}) - end, - group = highlight_group, - pattern = '*', + callback = function() + vim.highlight.on_yank({ higroup = 'YankHighlight' }) + end, + group = highlight_group, + pattern = '*', }) -- show cursor line only in active window local cursor_group = vim.api.nvim_create_augroup('ActiveCursor', { clear = true }) vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, { - callback = function() - local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline") - if ok and cl then - vim.wo.cursorline = true - vim.api.nvim_win_del_var(0, "auto-cursorline") - end - end, - group = cursor_group, - pattern = '*', + callback = function() + local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline") + if ok and cl then + vim.wo.cursorline = true + vim.api.nvim_win_del_var(0, "auto-cursorline") + end + end, + group = cursor_group, + pattern = '*', }) vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, { - callback = function() - local cl = vim.wo.cursorline - if cl then - vim.api.nvim_win_set_var(0, "auto-cursorline", cl) - vim.wo.cursorline = false - end - end, - group = cursor_group, - pattern = '*', + callback = function() + local cl = vim.wo.cursorline + if cl then + vim.api.nvim_win_set_var(0, "auto-cursorline", cl) + vim.wo.cursorline = false + end + end, + group = cursor_group, + pattern = '*', }) diff --git a/nvim/.config/nvim/lua/constant/symbols/diagnostic.lua b/nvim/.config/nvim/lua/constant/symbols/diagnostic.lua index 95053f3..a577c93 100644 --- a/nvim/.config/nvim/lua/constant/symbols/diagnostic.lua +++ b/nvim/.config/nvim/lua/constant/symbols/diagnostic.lua @@ -1,16 +1,15 @@ -- Symbols to use for diagnostics return { -- LSP Status symbols - error = "", - warning = "", - info = "", - hint = "", - + error = "", + warning = "", + info = "", + hint = "", -- Comment type symbols - bug = "", - todo = "", - hack = "", + bug = "", + todo = "", + hack = "", performance = "", - note = "", - test = "", + note = "", + test = "", } diff --git a/nvim/.config/nvim/lua/constant/symbols/file.lua b/nvim/.config/nvim/lua/constant/symbols/file.lua index 0a5b007..5f64b74 100644 --- a/nvim/.config/nvim/lua/constant/symbols/file.lua +++ b/nvim/.config/nvim/lua/constant/symbols/file.lua @@ -1,6 +1,6 @@ -- Symbols to use for files return { - icon = '', - modified = '●', + icon = '', + modified = '●', readonly = '' } diff --git a/nvim/.config/nvim/lua/constant/symbols/fold.lua b/nvim/.config/nvim/lua/constant/symbols/fold.lua index 29dc09e..30d22d5 100644 --- a/nvim/.config/nvim/lua/constant/symbols/fold.lua +++ b/nvim/.config/nvim/lua/constant/symbols/fold.lua @@ -1,6 +1,6 @@ -- Symbols to use for folds return { - open = '', + open = '', closed = '', - empty = '' + empty = '' } diff --git a/nvim/.config/nvim/lua/constant/symbols/git.lua b/nvim/.config/nvim/lua/constant/symbols/git.lua index f00e4c2..48845a8 100644 --- a/nvim/.config/nvim/lua/constant/symbols/git.lua +++ b/nvim/.config/nvim/lua/constant/symbols/git.lua @@ -5,7 +5,6 @@ return { modified = '●', deleted = '✖', renamed = '', - -- Status type untracked = '', ignored = '', diff --git a/nvim/.config/nvim/lua/constant/symbols/init.lua b/nvim/.config/nvim/lua/constant/symbols/init.lua index 842f8ca..f76d229 100644 --- a/nvim/.config/nvim/lua/constant/symbols/init.lua +++ b/nvim/.config/nvim/lua/constant/symbols/init.lua @@ -1,6 +1,6 @@ return { diagnostic = require("constant.symbols.diagnostic"), - fold = require("constant.symbols.fold"), - file = require("constant.symbols.file"), - git = require("constant.symbols.git"), + fold = require("constant.symbols.fold"), + file = require("constant.symbols.file"), + git = require("constant.symbols.git"), } diff --git a/nvim/.config/nvim/lua/plugins/autopairs.lua b/nvim/.config/nvim/lua/plugins/autopairs.lua index f09cd0d..cb6e182 100644 --- a/nvim/.config/nvim/lua/plugins/autopairs.lua +++ b/nvim/.config/nvim/lua/plugins/autopairs.lua @@ -1,4 +1,3 @@ --- vim: ts=4 sts=4 sw=4 noet -- https://github.com/windwp/nvim-autopairs return { 'windwp/nvim-autopairs', diff --git a/nvim/.config/nvim/lua/plugins/bufdel.lua b/nvim/.config/nvim/lua/plugins/bufdel.lua index aeae32a..21c2940 100644 --- a/nvim/.config/nvim/lua/plugins/bufdel.lua +++ b/nvim/.config/nvim/lua/plugins/bufdel.lua @@ -3,11 +3,21 @@ return { 'ojroques/nvim-bufdel', cmd = { "BufDel", "BuffDelOthers" }, keys = { - { 'bd', function() - require('bufdel').delete_buffer_expr(nil, false) - end, silent = true, desc = '[B]uffer [d]elete' }, - { 'bD', function() - require('bufdel').delete_buffer_others(false) - end, silent = true, desc = '[B]uffer [D]elete others' }, + { + 'bd', + function() + require('bufdel').delete_buffer_expr(nil, false) + end, + silent = true, + desc = '[B]uffer [d]elete' + }, + { + 'bD', + function() + require('bufdel').delete_buffer_others(false) + end, + silent = true, + desc = '[B]uffer [D]elete others' + }, }, } diff --git a/nvim/.config/nvim/lua/plugins/bufferline.lua b/nvim/.config/nvim/lua/plugins/bufferline.lua index b31bf56..dbc5578 100644 --- a/nvim/.config/nvim/lua/plugins/bufferline.lua +++ b/nvim/.config/nvim/lua/plugins/bufferline.lua @@ -49,8 +49,8 @@ return { local s = " " for e, n in pairs(diagnostics_dict) do local sym = e == "error" and symbols.diagnostic.error .. ' ' - or (e == "warning" and symbols.diagnostic.warning .. ' ') - or (e == "info" and symbols.diagnostic.info .. ' ' or symbols.diagnostic.hint .. ' ' ) + or (e == "warning" and symbols.diagnostic.warning .. ' ') + or (e == "info" and symbols.diagnostic.info .. ' ' or symbols.diagnostic.hint .. ' ') s = s .. n .. sym end return s diff --git a/nvim/.config/nvim/lua/plugins/colorizer.lua b/nvim/.config/nvim/lua/plugins/colorizer.lua index 35966e8..b34f032 100644 --- a/nvim/.config/nvim/lua/plugins/colorizer.lua +++ b/nvim/.config/nvim/lua/plugins/colorizer.lua @@ -2,7 +2,7 @@ return { 'NvChad/nvim-colorizer.lua', event = "VeryLazy", - opts = { + opts = { filetypes = { '*', -- Enable color highlighting for all files '!neo-tree', -- Exclude neo-tree diff --git a/nvim/.config/nvim/lua/plugins/comment.lua b/nvim/.config/nvim/lua/plugins/comment.lua index 6dcb165..66212e1 100644 --- a/nvim/.config/nvim/lua/plugins/comment.lua +++ b/nvim/.config/nvim/lua/plugins/comment.lua @@ -1,6 +1,6 @@ -- https://github.com/numToStr/Comment.nvim return { - 'numToStr/Comment.nvim', - event = "VeryLazy", - opts = {}, + 'numToStr/Comment.nvim', + event = "VeryLazy", + opts = {}, } diff --git a/nvim/.config/nvim/lua/plugins/neotree.lua b/nvim/.config/nvim/lua/plugins/neotree.lua index 7aca6ee..19a05b2 100644 --- a/nvim/.config/nvim/lua/plugins/neotree.lua +++ b/nvim/.config/nvim/lua/plugins/neotree.lua @@ -11,7 +11,7 @@ return { keys = { { '', 'Neotree toggle reveal filesystem float', desc = 'Open floating Neo-tree window' }, }, - config = function () + config = function() local symbols = require('constant.symbols'); require('neo-tree').setup { diff --git a/nvim/.config/nvim/lua/plugins/null-ls.lua b/nvim/.config/nvim/lua/plugins/null-ls.lua index 690f473..d2c2064 100644 --- a/nvim/.config/nvim/lua/plugins/null-ls.lua +++ b/nvim/.config/nvim/lua/plugins/null-ls.lua @@ -1,6 +1,6 @@ return { 'jose-elias-alvarez/null-ls.nvim', - config = function () + config = function() local null_ls = require('null-ls') null_ls.setup { diff --git a/nvim/.config/nvim/lua/plugins/peek.lua b/nvim/.config/nvim/lua/plugins/peek.lua index e722599..8a4cef3 100644 --- a/nvim/.config/nvim/lua/plugins/peek.lua +++ b/nvim/.config/nvim/lua/plugins/peek.lua @@ -1,10 +1,10 @@ -- https://github.com/toppair/peek.nvim return { 'toppair/peek.nvim', - build = 'deno task --quiet build:fast', - cond = function() - return vim.fn.executable 'deno' == 1 - end, + build = 'deno task --quiet build:fast', + cond = function() + return vim.fn.executable 'deno' == 1 + end, lazy = true, cmds = { "PeekOpen", "PeekClose" }, init = function() @@ -14,7 +14,7 @@ return { local augroup = vim.api.nvim_create_augroup('Peek', { clear = true }) -- Automatically open a markdown preview window - vim.api.nvim_create_autocmd({ "FileType"}, { + vim.api.nvim_create_autocmd({ "FileType" }, { callback = function() require('peek').open() end, diff --git a/nvim/.config/nvim/lua/plugins/symbols-outline.lua b/nvim/.config/nvim/lua/plugins/symbols-outline.lua index 243dd37..66b6bdb 100644 --- a/nvim/.config/nvim/lua/plugins/symbols-outline.lua +++ b/nvim/.config/nvim/lua/plugins/symbols-outline.lua @@ -2,9 +2,13 @@ return { 'simrat39/symbols-outline.nvim', keys = { - { '', function() - require('symbols-outline').toggle_outline() - end, desc = 'Toggle symbols outline' }, + { + '', + function() + require('symbols-outline').toggle_outline() + end, + desc = 'Toggle symbols outline' + }, }, opts = {}, } diff --git a/nvim/.config/nvim/lua/plugins/treesj.lua b/nvim/.config/nvim/lua/plugins/treesj.lua index 6e2a491..33c6965 100644 --- a/nvim/.config/nvim/lua/plugins/treesj.lua +++ b/nvim/.config/nvim/lua/plugins/treesj.lua @@ -2,12 +2,16 @@ return { 'Wansmer/treesj', keys = { - { 'm', function() - require('treesj').toggle() - end, desc = "Split or Join code block" }, + { + 'm', + function() + require('treesj').toggle() + end, + desc = "Split or Join code block" + }, }, dependencies = { 'nvim-treesitter/nvim-treesitter' }, opts = { - use_default_keymaps = false, + use_default_keymaps = false, } } diff --git a/nvim/.config/nvim/lua/plugins/trouble.lua b/nvim/.config/nvim/lua/plugins/trouble.lua index bd29362..fc050b3 100644 --- a/nvim/.config/nvim/lua/plugins/trouble.lua +++ b/nvim/.config/nvim/lua/plugins/trouble.lua @@ -5,7 +5,7 @@ return { keys = { { '', 'TroubleToggle workspace_diagnostics', desc = 'Goto previous buffer' }, }, - config = function () + config = function() local symbols = require('constant.symbols'); require('trouble').setup { icons = false, diff --git a/nvim/.config/nvim/lua/plugins/whitespace.lua b/nvim/.config/nvim/lua/plugins/whitespace.lua index ff7d1b7..947b0e9 100644 --- a/nvim/.config/nvim/lua/plugins/whitespace.lua +++ b/nvim/.config/nvim/lua/plugins/whitespace.lua @@ -1,13 +1,12 @@ return { 'johnfrankmorgan/whitespace.nvim', - config = function () + config = function() require('whitespace-nvim').setup({ -- configuration options and their defaults -- `highlight` configures which highlight is used to display -- trailing whitespace highlight = 'CursorLine', - -- `ignored_filetypes` configures which filetypes to ignore when -- displaying trailing whitespace ignored_filetypes = { 'TelescopePrompt', 'Trouble', 'help' },