From 00e4d34f5f18264f4ac3ac55d4e1edcd632fb3dd Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Fri, 24 Nov 2023 17:40:00 +0100 Subject: [PATCH] fix indentation --- lua/weeheavy/plugins/devicons.lua | 4 +- lua/weeheavy/plugins/gitsigns.lua | 58 ++++++------ lua/weeheavy/plugins/lualine.lua | 22 +++-- lua/weeheavy/plugins/nightfox.lua | 12 ++- .../plugins/telescope-filebrowser.lua | 4 +- lua/weeheavy/plugins/telescope-fzf-native.lua | 4 +- lua/weeheavy/plugins/telescope.lua | 94 +++++++++---------- lua/weeheavy/plugins/treesitter-context.lua | 3 +- lua/weeheavy/plugins/treesitter.lua | 88 ++++++++--------- lua/weeheavy/plugins/which-key.lua | 44 ++++----- 10 files changed, 169 insertions(+), 164 deletions(-) diff --git a/lua/weeheavy/plugins/devicons.lua b/lua/weeheavy/plugins/devicons.lua index a30eca8..7e5b654 100644 --- a/lua/weeheavy/plugins/devicons.lua +++ b/lua/weeheavy/plugins/devicons.lua @@ -1,4 +1,4 @@ return { - "nvim-tree/nvim-web-devicons", - lazy = true + "nvim-tree/nvim-web-devicons", + lazy = true } diff --git a/lua/weeheavy/plugins/gitsigns.lua b/lua/weeheavy/plugins/gitsigns.lua index cdae325..7bec830 100644 --- a/lua/weeheavy/plugins/gitsigns.lua +++ b/lua/weeheavy/plugins/gitsigns.lua @@ -1,38 +1,38 @@ -- Adds git related signs to the gutter, as well as utilities for managing changes return { -'lewis6991/gitsigns.nvim', -opts = { + 'lewis6991/gitsigns.nvim', + opts = { -- See `:help gitsigns.txt` signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, }, on_attach = function(bufnr) - --vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + --vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) - -- don't override the built-in and fugitive keymaps - local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) - vim.keymap.set({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) + -- don't override the built-in and fugitive keymaps + local gs = package.loaded.gitsigns + vim.keymap.set({ 'n', 'v' }, ']c', function() + if vim.wo.diff then + return ']c' + end + vim.schedule(function() + gs.next_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) + vim.keymap.set({ 'n', 'v' }, '[c', function() + if vim.wo.diff then + return '[c' + end + vim.schedule(function() + gs.prev_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) end, -}, + }, } diff --git a/lua/weeheavy/plugins/lualine.lua b/lua/weeheavy/plugins/lualine.lua index ee11a32..89c8286 100644 --- a/lua/weeheavy/plugins/lualine.lua +++ b/lua/weeheavy/plugins/lualine.lua @@ -1,13 +1,15 @@ -- status line like vim-airline return { - "nvim-lualine/lualine.nvim", - opts = { - options = { - icons_enabled = true, - theme = 'auto', - --component_separators = '⋮', - component_separators = '⁞', - section_separators = { left = '', right = '' }, - }, - }, + "nvim-lualine/lualine.nvim", + opts = { + options = { + icons_enabled = true, + theme = 'auto', + --component_separators = '⋮', + component_separators = '⁞', + --section_separators = { left = '', right = '' }, + --section_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + }, + }, } diff --git a/lua/weeheavy/plugins/nightfox.lua b/lua/weeheavy/plugins/nightfox.lua index 024f63b..bd91c63 100644 --- a/lua/weeheavy/plugins/nightfox.lua +++ b/lua/weeheavy/plugins/nightfox.lua @@ -1,7 +1,9 @@ return { - 'EdenEast/nightfox.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'duskfox' - end, + 'EdenEast/nightfox.nvim', + lazy = true, + priority = 1000, + opts = {}, + --config = function() + -- vim.cmd.colorscheme 'duskfox' + --end } diff --git a/lua/weeheavy/plugins/telescope-filebrowser.lua b/lua/weeheavy/plugins/telescope-filebrowser.lua index 4e996b7..a836090 100644 --- a/lua/weeheavy/plugins/telescope-filebrowser.lua +++ b/lua/weeheavy/plugins/telescope-filebrowser.lua @@ -1,4 +1,4 @@ return { - "nvim-telescope/telescope-file-browser.nvim", - dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, + "nvim-telescope/telescope-file-browser.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, } diff --git a/lua/weeheavy/plugins/telescope-fzf-native.lua b/lua/weeheavy/plugins/telescope-fzf-native.lua index 729b6c1..ecad5b2 100644 --- a/lua/weeheavy/plugins/telescope-fzf-native.lua +++ b/lua/weeheavy/plugins/telescope-fzf-native.lua @@ -14,6 +14,6 @@ If you have huge amounts of files, consider adding some to `$HOME/.ignore`: .git/ ]]-- return { -"nvim-telescope/telescope-fzf-native.nvim", - build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' + "nvim-telescope/telescope-fzf-native.nvim", + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } diff --git a/lua/weeheavy/plugins/telescope.lua b/lua/weeheavy/plugins/telescope.lua index cdd7b4c..95cfb03 100644 --- a/lua/weeheavy/plugins/telescope.lua +++ b/lua/weeheavy/plugins/telescope.lua @@ -1,50 +1,50 @@ -- Telescope return { - "nvim-telescope/telescope.nvim", - tag = "0.1.4", - dependencies = { - { "nvim-lua/plenary.nvim" } - }, - config = function(lazy, opts) - local telescope = require('telescope') - telescope.load_extension('fzf') - telescope.load_extension('file_browser') - telescope.setup({ - defaults = { - sorting_strategy = "ascending", - wrap_result = true, - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.4, - width = 0.75, - height = 0.75, - preview_cutoff = 10, - } - } - }, - pickers = { - find_files = { - hidden = true - }, - live_grep = { - additional_args = function() - return { '--hidden', '--glob', '!**/.git/*' } - end - }, - grep_string = { - additional_args = function() - return { '--hidden', '--glob', '!**/.git/*' } - end - }, - -- note: remove the 'builtin.' prefix. - ["lsp_references"] = { wrap_results = true, }, - ["lsp_definitions"] = { wrap_results = true, }, - ["diagnostics"] = { wrap_results = true, }, - ["find_files"] = { wrap_results = true, }, - ["buffers"] = { sort_mru = true, ignore_current_buffer = true }, - } - }) - end, + "nvim-telescope/telescope.nvim", + tag = "0.1.4", + dependencies = { + { "nvim-lua/plenary.nvim" } + }, + config = function(lazy, opts) + local telescope = require('telescope') + telescope.load_extension('fzf') + telescope.load_extension('file_browser') + telescope.setup({ + defaults = { + sorting_strategy = "ascending", + wrap_result = true, + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.4, + width = 0.75, + height = 0.75, + preview_cutoff = 10, + } + } + }, + pickers = { + find_files = { + hidden = true + }, + live_grep = { + additional_args = function() + return { '--hidden', '--glob', '!**/.git/*' } + end + }, + grep_string = { + additional_args = function() + return { '--hidden', '--glob', '!**/.git/*' } + end + }, + -- note: remove the 'builtin.' prefix. + ["lsp_references"] = { wrap_results = true, }, + ["lsp_definitions"] = { wrap_results = true, }, + ["diagnostics"] = { wrap_results = true, }, + ["find_files"] = { wrap_results = true, }, + ["buffers"] = { sort_mru = true, ignore_current_buffer = true }, + } + }) + end } diff --git a/lua/weeheavy/plugins/treesitter-context.lua b/lua/weeheavy/plugins/treesitter-context.lua index 64e8607..86c4268 100644 --- a/lua/weeheavy/plugins/treesitter-context.lua +++ b/lua/weeheavy/plugins/treesitter-context.lua @@ -1,5 +1,6 @@ -- Shows context of code line -- Docs: https://github.com/nvim-treesitter/nvim-treesitter-context return { - "nvim-treesitter/nvim-treesitter-context" + "nvim-treesitter/nvim-treesitter-context", + event = { "BufReadPre", "BufNewFile" }, } diff --git a/lua/weeheavy/plugins/treesitter.lua b/lua/weeheavy/plugins/treesitter.lua index e4dd15e..34f27c9 100644 --- a/lua/weeheavy/plugins/treesitter.lua +++ b/lua/weeheavy/plugins/treesitter.lua @@ -1,48 +1,48 @@ -- Treesitter return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - local treesitter = require("nvim-treesitter.configs") + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + local treesitter = require("nvim-treesitter.configs") - treesitter.setup({ - highlight = { enable = true, }, - indent = { enable = true }, - auto_install = false, - -- language list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages - ensure_installed = { - "lua", - "comment", - "vim", - "vimdoc", - "bash", - "diff", - "gitignore", - "markdown", - "markdown_inline", - "elixir", - "eex", - "heex", - "yaml", - "html", - "css", - "dockerfile", - "query", - "hcl", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }) - end, + treesitter.setup({ + highlight = { enable = true, }, + indent = { enable = true }, + auto_install = false, + -- language list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages + ensure_installed = { + "lua", + "comment", + "vim", + "vimdoc", + "bash", + "diff", + "gitignore", + "markdown", + "markdown_inline", + "elixir", + "eex", + "heex", + "yaml", + "html", + "css", + "dockerfile", + "query", + "hcl", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end } diff --git a/lua/weeheavy/plugins/which-key.lua b/lua/weeheavy/plugins/which-key.lua index b837c0a..4c7438a 100644 --- a/lua/weeheavy/plugins/which-key.lua +++ b/lua/weeheavy/plugins/which-key.lua @@ -1,24 +1,24 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 250 - end, - opts = { - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - align = "left", -- align columns left, center or right - }, - window = { - border = "none", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. - padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent - zindex = 1000, -- positive value to position WhichKey above other floating windows. - }, - } + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 250 + end, + opts = { + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "left", -- align columns left, center or right + }, + window = { + border = "none", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. + padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent + zindex = 1000, -- positive value to position WhichKey above other floating windows. + }, + } }