From a8b364514841651447fb0e0376e09446b4a17bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 14 Mar 2023 19:02:50 +0100 Subject: [PATCH] Use stylua --- init.lua | 154 +++++++++++++++++++++++++++---------------------------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/init.lua b/init.lua index 4223a02..d76f0d1 100644 --- a/init.lua +++ b/init.lua @@ -9,15 +9,15 @@ local config = { -- Configure AstroNvim updates updater = { - remote = "origin", -- remote to use - channel = "nightly", -- "stable" or "nightly" - version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) - branch = "nightly", -- branch name (NIGHTLY ONLY) - commit = nil, -- commit hash (NIGHTLY ONLY) - pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) - skip_prompts = false, -- skip prompts about breaking changes + remote = "origin", -- remote to use + channel = "nightly", -- "stable" or "nightly" + version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) + branch = "nightly", -- branch name (NIGHTLY ONLY) + commit = nil, -- commit hash (NIGHTLY ONLY) + pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) + skip_prompts = false, -- skip prompts about breaking changes show_changelog = true, -- show the changelog after performing an update - auto_quit = false, -- automatically quit the current session after a successful update + auto_quit = false, -- automatically quit the current session after a successful update -- remotes = { -- easily add new remotes to track -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, @@ -41,18 +41,18 @@ local config = { opt = { -- set to true or false etc. relativenumber = true, -- sets vim.opt.relativenumber - number = true, -- sets vim.opt.number - spell = false, -- sets vim.opt.spell - signcolumn = "auto", -- sets vim.opt.signcolumn to auto - wrap = false, -- sets vim.opt.wrap + number = true, -- sets vim.opt.number + spell = false, -- sets vim.opt.spell + signcolumn = "auto", -- sets vim.opt.signcolumn to auto + wrap = false, -- sets vim.opt.wrap }, g = { - mapleader = " ", -- sets vim.g.mapleader - autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) - cmp_enabled = true, -- enable completion at start - autopairs_enabled = true, -- enable autopairs at start - diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on) - icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) + mapleader = " ", -- sets vim.g.mapleader + autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) + cmp_enabled = true, -- enable completion at start + autopairs_enabled = true, -- enable autopairs at start + diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on) + icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) ui_notifications_enabled = true, -- disable notifications when toggling UI elements -- Copilot copilot_no_tab_map = true, @@ -65,7 +65,7 @@ local config = { -- Tlist_Close_On_Select = 1, -- MarkdownPreview - mkdp_auto_close = 0 + mkdp_auto_close = 0, }, }, -- If you need more control, you can use the function()...end notation @@ -91,7 +91,7 @@ local config = { formatting = { -- control auto formatting on save format_on_save = { - enabled = false, -- enable or disable format on save globally + enabled = false, -- enable or disable format on save globally allow_filetypes = { -- enable format on save for specified filetypes only -- "go", }, @@ -155,8 +155,10 @@ local config = { mappings = { -- first key is the mode n = { - ["fT"] = { function() require("telescope.builtin").colorscheme { enable_preview = true } end, desc = - "Find themes" }, + ["fT"] = { + function() require("telescope.builtin").colorscheme { enable_preview = true } end, + desc = "Find themes", + }, -- second key is the lefthand side of the map -- mappings seen under group name "Buffer" ["bb"] = { "tabnew", desc = "New tab" }, @@ -182,39 +184,21 @@ local config = { ["d"] = { name = "Debugger" }, ["dl"] = { name = "Load launch.json" }, -- Config loading - ["dlc"] = { function() require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } }) end, desc = - "C/C++/asm" }, - ["dln"] = { function() require("dap.ext.vscode").load_launchjs(nil, { node2 = { "javascript", "javascriptreact", "typescriptreact", "typescript" }}) end, desc = - "Node" }, + ["dlc"] = { + function() require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } }) end, + desc = "C/C++/asm", + }, + ["dln"] = { + function() + require("dap.ext.vscode").load_launchjs( + nil, + { node2 = { "javascript", "javascriptreact", "typescriptreact", "typescript" } } + ) + end, + desc = "Node", + }, -- Load launch.json for all supported languages ["dla"] = { function() require("dap.ext.vscode").load_launchjs(nil, nil) end, desc = "All" }, - -- Function keys mappings - [""] = { function() require("dap").continue() end, desc = "Debugger: Start" }, - [""] = { function() require("dap").terminate() end, desc = "Debugger: Stop" }, -- Shift+F5 - [""] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" }, -- Control+F5 - [""] = { function() require("dap").pause() end, desc = "Debugger: Pause" }, - [""] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" }, - [""] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" }, - [""] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" }, - [""] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" }, -- Shift+F11 - -- Breakpoints - ["db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" }, - ["dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" }, - -- Session actions - ["dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" }, - ["dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" }, - ["dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" }, - ["dq"] = { function() require("dap").close() end, desc = "Close Session" }, - ["dQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" }, - -- Step - ["di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" }, - ["do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" }, - ["dO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" }, - -- Repls (debugger) - ["dR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, - -- Dap-UI - ["du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" }, - ["dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" }, -- Mardown preview ["m"] = { name = "Markdown" }, ["mp"] = { "MarkdownPreview", desc = "Markdown preview" }, @@ -293,7 +277,7 @@ local config = { -- Theme { "folke/tokyonight.nvim", - event = "UIEnter" + event = "UIEnter", }, -- You can disable default plugins as follows: -- { "max397574/better-escape.nvim", enabled = false }, @@ -353,7 +337,7 @@ local config = { -- }, { "dstein64/vim-startuptime", - cmd = "StartupTime" + cmd = "StartupTime", }, { @@ -367,10 +351,15 @@ local config = { local luasnip = require "luasnip" -- modify the mapping part of the table opts.mapping[""] = cmp.mapping.confirm { select = false } - opts.mapping[""] = cmp.mapping(function(fallback) - vim.api.nvim_feedkeys(vim.fn['copilot#Accept'](vim.api.nvim_replace_termcodes('', true, true, true)), 'n', - true) - end) + opts.mapping[""] = cmp.mapping( + function(fallback) + vim.api.nvim_feedkeys( + vim.fn["copilot#Accept"](vim.api.nvim_replace_termcodes("", true, true, true)), + "n", + true + ) + end + ) if luasnip.expandable() then luasnip.expand() elseif luasnip.expand_or_jumpable() then @@ -378,7 +367,7 @@ local config = { fallback() end opts.experimental = { - ghost_text = false -- this feature conflict with copilot.vim's preview. + ghost_text = false, -- this feature conflict with copilot.vim's preview. } -- return the new table to be used return opts @@ -388,7 +377,7 @@ local config = { -- Editorconfig { "editorconfig/editorconfig-vim", - event = "User AstroFile" + event = "User AstroFile", }, -- You can also add new plugins here as well: @@ -397,13 +386,13 @@ local config = { -- Plugins for other plugins { "tyru/open-browser.vim", - cmd = { "OPenBrowser", "OpenBrowserSearch", "OpenBrowserSmartSearch" } + cmd = { "OPenBrowser", "OpenBrowserSearch", "OpenBrowserSmartSearch" }, }, --Social { "andweeb/presence.nvim", - event = "UIEnter" + event = "UIEnter", }, { "ellisonleao/carbon-now.nvim", @@ -425,7 +414,7 @@ local config = { width = "680", watermark = false, }, - } + }, }, -- Comments @@ -437,32 +426,32 @@ local config = { { "folke/trouble.nvim", -- cmd = { "TroubleToggle", "TodoTrouble" } - cmd = "TroubleToggle" + cmd = "TroubleToggle", }, -- TOC (functions, macros, ...) { "yegappan/taglist", - cmd = "TlistToggle" + cmd = "TlistToggle", }, -- Code completion { "github/copilot.vim", - event = "User AstroFile" + event = "User AstroFile", }, -- PlatformIO { "normen/vim-pio", -- event = "BufEnter" - cmd = { "PIO", "PIOInit", "PIOInstall", "PIOUninstall", "PIONewProject", "PIOAddLibrary", "PIORemoveLibrary" } + cmd = { "PIO", "PIOInit", "PIOInstall", "PIOUninstall", "PIONewProject", "PIOAddLibrary", "PIORemoveLibrary" }, }, -- Text related { -- LaTeX "lervag/vimtex", - event = "BufEnter *.tex" + event = "BufEnter *.tex", }, { "iamcco/markdown-preview.nvim", @@ -477,28 +466,37 @@ local config = { }, { "aklt/plantuml-syntax", - event = "BufEnter *.uml" + event = "BufEnter *.uml", }, -- Basic editor functionality { "Pocco81/auto-save.nvim", event = "User AstroFile", - config = function() - require("auto-save").setup() - end, + config = function() require("auto-save").setup() end, }, -- Tasks.json { "stevearc/overseer.nvim", - cmd = { "OverseerOpen", "OverseerClose", "OverseerToggle", "OverseerSaveBundle", "OverseerLoadBundle", - "OverseerDeleteBundle", "OverseerRunCmd", "OverseerRun", "OverseerInfo", "OverseerBuild", "OverseerQuickAction", - "OverseerTaskAction ", "OverseerClearCache" }, - opts = {} + cmd = { + "OverseerOpen", + "OverseerClose", + "OverseerToggle", + "OverseerSaveBundle", + "OverseerLoadBundle", + "OverseerDeleteBundle", + "OverseerRunCmd", + "OverseerRun", + "OverseerInfo", + "OverseerBuild", + "OverseerQuickAction", + "OverseerTaskAction ", + "OverseerClearCache", + }, + opts = {}, }, - -- { -- "ray-x/lsp_signature.nvim", -- event = "BufRead",