From 690a4cab3d440478eba70b48d073970a579e30b8 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 28 Apr 2024 23:20:18 +0200 Subject: style: formatting --- lua/pml68/configs/cmp.lua | 14 ++++---- lua/pml68/configs/settings/elixirls.lua | 2 +- lua/pml68/configs/settings/rust_analyzer.lua | 2 +- lua/pml68/configs/toggleterm.lua | 8 ++--- lua/pml68/plugins.lua | 48 ++++++++++++++-------------- lua/pml68/remap.lua | 6 ++-- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lua/pml68/configs/cmp.lua b/lua/pml68/configs/cmp.lua index 91d1b5e..bffb09a 100644 --- a/lua/pml68/configs/cmp.lua +++ b/lua/pml68/configs/cmp.lua @@ -2,10 +2,10 @@ local cmp = require("cmp") cmp.setup({ sources = { - {name = 'nvim_lsp'}, - {name = 'path'}, - {name = 'vimtex'}, - {name = 'crates'}, + { name = 'nvim_lsp' }, + { name = 'path' }, + { name = 'vimtex' }, + { name = 'crates' }, }, window = { completion = { @@ -18,9 +18,9 @@ cmp.setup({ completeopt = 'menu,menuone,noinsert' }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.confirm({select = true}), - [''] = cmp.mapping.select_prev_item({behavior = 'select'}), - [''] = cmp.mapping.select_next_item({behavior = 'select'}), + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.select_prev_item({ behavior = 'select' }), + [''] = cmp.mapping.select_next_item({ behavior = 'select' }), }), snippet = { expand = function(args) diff --git a/lua/pml68/configs/settings/elixirls.lua b/lua/pml68/configs/settings/elixirls.lua index c724eea..721ef5e 100644 --- a/lua/pml68/configs/settings/elixirls.lua +++ b/lua/pml68/configs/settings/elixirls.lua @@ -1,3 +1,3 @@ return { - cmd = {vim.fn.stdpath("data") .. "/mason/bin/elixir-ls"}, + cmd = { vim.fn.stdpath("data") .. "/mason/bin/elixir-ls" }, } diff --git a/lua/pml68/configs/settings/rust_analyzer.lua b/lua/pml68/configs/settings/rust_analyzer.lua index e89b07f..3222bb7 100755 --- a/lua/pml68/configs/settings/rust_analyzer.lua +++ b/lua/pml68/configs/settings/rust_analyzer.lua @@ -1,5 +1,5 @@ return { - filetypes = {"rust"}, + filetypes = { "rust" }, settings = { ['rust-analyzer'] = { cargo = { diff --git a/lua/pml68/configs/toggleterm.lua b/lua/pml68/configs/toggleterm.lua index 997802b..e2681b5 100644 --- a/lua/pml68/configs/toggleterm.lua +++ b/lua/pml68/configs/toggleterm.lua @@ -1,5 +1,5 @@ -local Terminal = require('toggleterm.terminal').Terminal -local lazygit = Terminal:new({ +local Terminal = require('toggleterm.terminal').Terminal +local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float", @@ -12,9 +12,9 @@ function _lazygit_toggle() lazygit:toggle() end -vim.keymap.set("n", "g", " lua _lazygit_toggle() ", {noremap = true, silent = true}) +vim.keymap.set("n", "g", " lua _lazygit_toggle() ", { noremap = true, silent = true }) function _G.set_terminal_keymaps() - local opts = {buffer = 0} + local opts = { buffer = 0 } vim.keymap.set('t', '', [[]], opts) vim.keymap.set('t', '', [[wincmd h]], opts) vim.keymap.set('t', '', [[wincmd j]], opts) diff --git a/lua/pml68/plugins.lua b/lua/pml68/plugins.lua index aa839e5..4c206a9 100644 --- a/lua/pml68/plugins.lua +++ b/lua/pml68/plugins.lua @@ -8,7 +8,7 @@ local plugins = { vim.defer_fn(function() require("colorizer").attach_to_buffer(0) - end,0) + end, 0) end }, --IndentBlankline @@ -32,13 +32,13 @@ local plugins = { "windwp/nvim-autopairs", opts = { fast_wrap = {}, - disable_filetype = {"TelescopePrompt","vim"}, + disable_filetype = { "TelescopePrompt", "vim" }, }, - config = function(_,opts) + config = function(_, opts) require("nvim-autopairs").setup(opts) - local cmp_autopairs = require"nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done",cmp_autopairs.on_confirm_done()) + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) end, }, "hrsh7th/cmp-nvim-lsp", @@ -63,7 +63,7 @@ local plugins = { end end, }, - config = function(_,opts) + config = function(_, opts) require("pml68.configs.toggleterm") require("toggleterm").setup(opts) end @@ -83,26 +83,26 @@ local plugins = { event = "BufReadPre", opts = { signs = { - add = {text = "│"}, - change = {text = "│"}, - delete = {text = "󰍵"}, - topdelete = {text = "‾"}, - changedelete = {text = "~"}, - untracked = {text = "│"}, + add = { text = "│" }, + change = { text = "│" }, + delete = { text = "󰍵" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "│" }, }, on_attach = function(bufnr) local gs = package.loaded.gitsigns - local function map(mode,l,r,opts) + local function map(mode, l, r, opts) opts = opts or {} opts.buffer = bufnr - vim.keymap.set(mode,l,r,opts) + vim.keymap.set(mode, l, r, opts) end - map("n","gb",gs.blame_line) + map("n", "gb", gs.blame_line) end, }, - config = function(_,opts) + config = function(_, opts) require("gitsigns").setup(opts) end }, @@ -115,17 +115,17 @@ local plugins = { }, { "williamboman/mason.nvim", - cmd = {"Mason","MasonInstall","MasonInstallAll","MasonUpdate"}, + cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" }, opts = function() return require("pml68.configs.mason") end, - config = function(_,opts) + config = function(_, opts) require("mason").setup(opts) - vim.api.nvim_create_user_command("MasonInstallAll",function() + vim.api.nvim_create_user_command("MasonInstallAll", function() if opts.ensure_installed and #opts.ensure_installed > 0 then - vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed," ")) + vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " ")) end - end,{}) + end, {}) vim.g.mason_binaries_list = opts.ensure_installed end, @@ -158,7 +158,7 @@ local plugins = { --Syntaxhighlighting { "nvim-treesitter/nvim-treesitter", - event = {"BufReadPost","BufNewFile"}, + event = { "BufReadPost", "BufNewFile" }, build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({ @@ -282,12 +282,12 @@ local plugins = { "saecki/crates.nvim", tag = "stable", dependencies = "hrsh7th/nvim-cmp", - event = {"BufRead Cargo.toml"}, + event = { "BufRead Cargo.toml" }, config = function() local crates = require("crates") crates.setup() - vim.keymap.set("n","rcu",function() + vim.keymap.set("n", "rcu", function() crates.upgrade_all_crates() end) end diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua index 6d35236..e08f780 100644 --- a/lua/pml68/remap.lua +++ b/lua/pml68/remap.lua @@ -34,7 +34,7 @@ vim.keymap.set('n', ']d', 'lua vim.diagnostic.goto_next()') vim.api.nvim_create_autocmd('LspAttach', { desc = 'LSP actions', callback = function(event) - local opts = {buffer = event.buf} + local opts = { buffer = event.buf } vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()', opts) vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts) @@ -44,8 +44,8 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts) vim.keymap.set('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) vim.keymap.set('n', '', 'lua vim.lsp.buf.rename()', opts) - vim.keymap.set({'n', 'x'}, '', 'lua vim.lsp.buf.format({async = true})', opts) vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) + vim.keymap.set({ 'n', 'x' }, '', 'lua vim.lsp.buf.format({async = true})', opts) end }) @@ -55,7 +55,7 @@ vim.api.nvim_create_autocmd('filetype', { desc = 'Better mappings for netrw', callback = function() local bind = function(lhs, rhs) - vim.keymap.set('n', lhs, rhs, {remap = true, buffer = true}) + vim.keymap.set('n', lhs, rhs, { remap = true, buffer = true }) end bind('a', '%') -- cgit v1.2.3