From 8f04c0e04c72c964ccfd110268d61c54f1ed83b5 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Sun, 10 Nov 2024 15:38:47 +0100 Subject: [PATCH] chores(all): format --- lua/autocommands.lua | 7 +++--- lua/general-options.lua | 2 +- lua/lazy-configure.lua | 2 +- lua/lsp.lua | 2 +- lua/mappings.lua | 3 ++- lua/neorg-configure.lua | 14 ++++++------ lua/telescope-configure.lua | 2 +- lua/treesitter-configure.lua | 6 ++--- lua/which-key-configure.lua | 44 ++++++++++++++++++------------------ 9 files changed, 42 insertions(+), 40 deletions(-) diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 552efde..a0d547c 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -16,9 +16,11 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { -- email commands: my/msy to paste the html inside the clipboard vim.keymap.set('', 'msy', ':w !pandoc -f markdown+emoji -t html5 -s | wl-copy --type text/html', { noremap = true, silent = true, desc = "[M]arkdown to [S]ingle page [Y]ank" }) - vim.keymap.set('', 'my', ':w !pandoc -f markdown+emoji --wrap=none -t html5 | wl-copy --type text/html', + vim.keymap.set('', 'my', + ':w !pandoc -f markdown+emoji --wrap=none -t html5 | wl-copy --type text/html', { noremap = true, silent = true, desc = "[M]arkdown to HTML [Y]ank" }) - vim.keymap.set('', 'mp', 'MarkdownPreviewToggle', { noremap = true, silent = true, desc = "[M]arkdown [P]review" }) + vim.keymap.set('', 'mp', 'MarkdownPreviewToggle', + { noremap = true, silent = true, desc = "[M]arkdown [P]review" }) end }) @@ -83,4 +85,3 @@ vim.api.nvim_create_autocmd("FileType", { require('spelling').spell_keymap() end, }) - diff --git a/lua/general-options.lua b/lua/general-options.lua index 0a5bfe9..17b76f3 100644 --- a/lua/general-options.lua +++ b/lua/general-options.lua @@ -62,5 +62,5 @@ vim.o.scrolloff = 10 vim.cmd "set formatoptions-=t" -- Make some typographic chars visible -vim.opt.listchars:append({nbsp = "·", trail = "¤", eol = '↲'}) +vim.opt.listchars:append({ nbsp = "·", trail = "¤", eol = '↲' }) vim.o.list = true diff --git a/lua/lazy-configure.lua b/lua/lazy-configure.lua index 09aac1e..d21f6ec 100644 --- a/lua/lazy-configure.lua +++ b/lua/lazy-configure.lua @@ -191,7 +191,7 @@ require('lazy').setup({ }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) { diff --git a/lua/lsp.lua b/lua/lsp.lua index f72ae96..6d237e1 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -16,7 +16,7 @@ local on_attach = function(_, bufnr) nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed - nmap('f', function() -- https://stackoverflow.com/a/74303272 + nmap('f', function() -- https://stackoverflow.com/a/74303272 vim.lsp.buf.code_action({ filter = function(a) return a.isPreferred diff --git a/lua/mappings.lua b/lua/mappings.lua index a294131..69fe1ee 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -1,7 +1,8 @@ local map_list = { -- ["w|"] = ":vsplit", ["w-"] = ":split", -- w| / w- pour créer des splits verticaux et horizontaux -- ["ge"] = ":bprevious", ["gn"] = ":bnext", - ["W"] = ":w", [""] = ":tabnew", + ["W"] = ":w", + [""] = ":tabnew", } local keymap = vim.keymap.set diff --git a/lua/neorg-configure.lua b/lua/neorg-configure.lua index 7b448c3..e170713 100644 --- a/lua/neorg-configure.lua +++ b/lua/neorg-configure.lua @@ -47,16 +47,16 @@ vim.api.nvim_set_keymap("n", "nef", ":Neorg export to-file ", -- Tasks vim.api.nvim_set_keymap("n", "td", "(neorg.qol.todo-items.todo.task-done)", - { noremap = true, silent = true, desc = "[T]ask [D]one"}) + { noremap = true, silent = true, desc = "[T]ask [D]one" }) vim.api.nvim_set_keymap("n", "tu", "(neorg.qol.todo-items.todo.task-undone)", - { noremap = true, silent = true, desc = "[T]ask [U]ndone"}) + { noremap = true, silent = true, desc = "[T]ask [U]ndone" }) vim.api.nvim_set_keymap("n", "tp", "(neorg.qol.todo-items.todo.task-pending)", - { noremap = true, silent = true, desc = "[T]ask [P]ending"}) + { noremap = true, silent = true, desc = "[T]ask [P]ending" }) vim.api.nvim_set_keymap("n", "th", "(neorg.qol.todo-items.todo.task-on_hold)", - { noremap = true, silent = true, desc = "[T]ask on [H]old"}) + { noremap = true, silent = true, desc = "[T]ask on [H]old" }) vim.api.nvim_set_keymap("n", "tc", "(neorg.qol.todo-items.todo.task-cancelled)", - { noremap = true, silent = true, desc = "[T]ask on [C]ancelled"}) + { noremap = true, silent = true, desc = "[T]ask on [C]ancelled" }) vim.api.nvim_set_keymap("n", "tr", "(neorg.qol.todo-items.todo.task-recurring)", - { noremap = true, silent = true, desc = "[T]ask on [R]ecurring"}) + { noremap = true, silent = true, desc = "[T]ask on [R]ecurring" }) vim.api.nvim_set_keymap("n", "ti", "(neorg.qol.todo-items.todo.task-important)", - { noremap = true, silent = true, desc = "[T]ask on [I]mportant"}) + { noremap = true, silent = true, desc = "[T]ask on [I]mportant" }) diff --git a/lua/telescope-configure.lua b/lua/telescope-configure.lua index adb6c20..d4502bb 100644 --- a/lua/telescope-configure.lua +++ b/lua/telescope-configure.lua @@ -81,5 +81,5 @@ vim.keymap.set('n', 'sb', require('telescope.builtin').lsp_document_symb -- vim telescope vim.keymap.set('n', 'gc', require('telescope.builtin').git_commits, { desc = '[G]it [C]ommits' }) vim.keymap.set('n', 'gs', require('telescope.builtin').git_status, { desc = '[G]it [S]tatus' }) -vim.keymap.set({'n', 'x'}, 'gB', require('telescope.builtin').git_bcommits, { desc = '[G]it [B]commits' }) +vim.keymap.set({ 'n', 'x' }, 'gB', require('telescope.builtin').git_bcommits, { desc = '[G]it [B]commits' }) vim.keymap.set('n', 'gb', require('telescope.builtin').git_branches, { desc = '[G]it [B]ranches' }) diff --git a/lua/treesitter-configure.lua b/lua/treesitter-configure.lua index 5fddd0e..93db505 100644 --- a/lua/treesitter-configure.lua +++ b/lua/treesitter-configure.lua @@ -4,8 +4,8 @@ vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'norg', 'norg_meta', 'gdscript' }, - ignore_install = {'latex', 'tex', 'markdown'}, - disable = {'latex', 'tex', 'markdown'}, + ignore_install = { 'latex', 'tex', 'markdown' }, + disable = { 'latex', 'tex', 'markdown' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -15,7 +15,7 @@ vim.defer_fn(function() highlight = { enable = true }, indent = { enable = true, - disable = {'javascript'} + disable = { 'javascript' } }, incremental_selection = { enable = true, diff --git a/lua/which-key-configure.lua b/lua/which-key-configure.lua index 65f76b9..c513a69 100644 --- a/lua/which-key-configure.lua +++ b/lua/which-key-configure.lua @@ -1,21 +1,21 @@ local options = { plugins = { - marks = true, -- shows a list of your marks on ' and ` + marks = true, -- shows a list of your marks on ' and ` registers = true, -- shows your registers on " in NORMAL or in INSERT mode -- the presets plugin, adds help for a bunch of default keybindings in Neovim -- No actual key bindings are created spelling = { - enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions suggestions = 20, -- how many suggestions should be shown in the list? }, presets = { - operators = false, -- adds help for operators like d, y, ... - motions = true, -- adds help for motions + operators = false, -- adds help for operators like d, y, ... + motions = true, -- adds help for motions text_objects = false, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g }, }, -- add operators that will trigger motion and text object completion @@ -38,27 +38,27 @@ local options = { }, popup_mappings = { scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup + scroll_up = "", -- binding to scroll up inside the popup }, 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. + 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 = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent - zindex = 1000, -- positive value to position WhichKey above other floating windows. + winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent + zindex = 1000, -- positive value to position WhichKey above other floating windows. }, 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 + 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 }, - ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label + ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label hidden = { "", "", "", "", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate - show_help = true, -- show a help message in the command line for using WhichKey - show_keys = true, -- show the currently pressed key and its label as a message in the command line - triggers = "auto", -- automatically setup triggers + show_help = true, -- show a help message in the command line for using WhichKey + show_keys = true, -- show the currently pressed key and its label as a message in the command line + triggers = "auto", -- automatically setup triggers -- triggers = {""} -- or specifiy a list manually -- list of triggers, where WhichKey should not wait for timeoutlen and show immediately triggers_nowait = {