From d9cdc25e2fd4f9de1813aac6ef32c60f9a485fda Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 20 Jan 2024 00:37:13 +0100 Subject: [PATCH] trailing whitespace --- lua/custom/mappings.lua | 16 ++++++++++++---- lua/custom/plugins.lua | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua index d0f166a..c587854 100644 --- a/lua/custom/mappings.lua +++ b/lua/custom/mappings.lua @@ -284,22 +284,30 @@ M.edit = { -- split and join lines -- "J" for join is defaul ["S"] = { - "ik", + "il", "split line", }, -- do something useful with the arrows [""] = { " move-2", "Move line up", opts = { expr = true } }, [""] = { " move+", "Move line down", opts = { expr = true } }, - [""] = { "<<", "Less indentation", opts = { expr = true } }, - [""] = { ">>", "More indentation", opts = { expr = true } }, + [""] = { " << ", "Less indentation", opts = { expr = true } }, + [""] = { " >> ", "More indentation", opts = { expr = true } }, -- format with conform ["ff"] = { function() require("conform").format() end, - "formatting", + "format buffer", + }, + -- + -- remove trailing whitespace + ["fw"] = { + function() + require('mini.trailspace').trim() + end, + "remove whitespace", }, }, v = { diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index 60e00f4..25acc05 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -85,6 +85,7 @@ local plugins = { "folke/which-key.nvim", keys = { "", "", "", "", '"', "'", "`", "c", "v", "g" }, }, + { "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} }, } return plugins