From 5ea28f0a938f13fcecb1d83e7bf38397d501a586 Mon Sep 17 00:00:00 2001 From: Guust Taillieu Date: Sat, 20 Jun 2026 15:06:13 +0200 Subject: [PATCH] fix: styling issues --- init.lua | 139 +++++++++------------- lua/custom/plugins/markdown.lua | 2 +- lua/custom/plugins/supermaven.lua | 8 +- lua/kickstart/plugins/auto-completion.lua | 2 +- lua/kickstart/plugins/autopairs.lua | 4 +- lua/kickstart/plugins/debug.lua | 6 +- lua/kickstart/plugins/format.lua | 3 +- lua/kickstart/plugins/gitsigns.lua | 9 +- lua/kickstart/plugins/guess-indent.lua | 2 +- lua/kickstart/plugins/lint.lua | 2 +- lua/kickstart/plugins/lsp.lua | 8 +- lua/kickstart/plugins/mini.lua | 16 +-- lua/kickstart/plugins/snippets.lua | 14 +-- lua/kickstart/plugins/telescope.lua | 21 ++-- lua/kickstart/plugins/which-key.lua | 4 +- 15 files changed, 92 insertions(+), 148 deletions(-) diff --git a/init.lua b/init.lua index 54ed06ee..4d0d82df 100644 --- a/init.lua +++ b/init.lua @@ -29,7 +29,7 @@ vim.g.have_nerd_font = true -- Key mappings -vim.g.mapleader = ' ' -- Set leader key to space +vim.g.mapleader = ' ' -- Set leader key to space vim.g.maplocalleader = ' ' -- Set local leader key (NEW) -- Make background transparent @@ -37,29 +37,29 @@ vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' }) vim.api.nvim_set_hl(0, 'NormalNC', { bg = 'none' }) vim.api.nvim_set_hl(0, 'EndOfBuffer', { bg = 'none' }) vim.api.nvim_set_hl(0, 'SignColumn', { bg = 'none' }) -- Make sign column transparent -vim.opt.number = true -- Line numbers +vim.opt.number = true -- Line numbers -- Basic settings vim.opt.relativenumber = true -- Relative line numbers -vim.opt.cursorline = true -- Highlight current line -vim.opt.wrap = false -- Don't wrap lines -vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor -vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor +vim.opt.cursorline = true -- Highlight current line +vim.opt.wrap = false -- Don't wrap lines +vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor +vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor -- Indentation -vim.opt.tabstop = 2 -- Tab width -vim.opt.shiftwidth = 2 -- Indent width -vim.opt.softtabstop = 2 -- Soft tab stop -vim.opt.expandtab = true -- Use spaces instead of tabs +vim.opt.tabstop = 2 -- Tab width +vim.opt.shiftwidth = 2 -- Indent width +vim.opt.softtabstop = 2 -- Soft tab stop +vim.opt.expandtab = true -- Use spaces instead of tabs vim.opt.smartindent = true -- Smart auto-indenting -vim.opt.autoindent = true -- Copy indent from current line +vim.opt.autoindent = true -- Copy indent from current line vim.o.breakindent = true -- Search settings vim.opt.ignorecase = true -- Case insensitive search -vim.opt.smartcase = true -- Case sensitive if uppercase in search -vim.opt.hlsearch = false -- Don't highlight search results -vim.opt.incsearch = true -- Show matches as you type +vim.opt.smartcase = true -- Case sensitive if uppercase in search +vim.opt.hlsearch = false -- Don't highlight search results +vim.opt.incsearch = true -- Show matches as you type -- Visual settings vim.opt.termguicolors = true -- Enable 24-bit colors @@ -83,45 +83,43 @@ vim.opt.listchars = { tab = ' ', trail = '·', nbsp = '␣' } -- Sets how white -- Folding settings vim.opt.foldmethod = 'expr' -- Use expression for folding -- vim.wo.vim.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- Use treesitter for folding -vim.opt.foldlevel = 99 -- Start with all folds open +vim.opt.foldlevel = 99 -- Start with all folds open -- File handling -vim.opt.backup = false -- Don't create backup files -vim.opt.writebackup = false -- Don't create backup before writing -vim.opt.swapfile = false -- Don't create swap files -vim.opt.undofile = true -- Persistent undo -vim.o.undofile = true -- Save undo history +vim.opt.backup = false -- Don't create backup files +vim.opt.writebackup = false -- Don't create backup before writing +vim.opt.swapfile = false -- Don't create swap files +vim.opt.undofile = true -- Persistent undo +vim.o.undofile = true -- Save undo history vim.opt.undodir = vim.fn.expand '~/.vim/undodir' -- Undo directory -vim.opt.updatetime = 250 -- Faster completion -vim.opt.timeoutlen = 500 -- Key timeout duration -vim.opt.ttimeoutlen = 0 -- Key code timeout -vim.opt.autoread = true -- Auto reload files changed outside vim -vim.opt.autowrite = false -- Don't auto save +vim.opt.updatetime = 250 -- Faster completion +vim.opt.timeoutlen = 500 -- Key timeout duration +vim.opt.ttimeoutlen = 0 -- Key code timeout +vim.opt.autoread = true -- Auto reload files changed outside vim +vim.opt.autowrite = false -- Don't auto save -- Behavior settings -vim.opt.hidden = true -- Allow hidden buffers -vim.opt.errorbells = false -- No error bells +vim.opt.hidden = true -- Allow hidden buffers +vim.opt.errorbells = false -- No error bells vim.opt.backspace = 'indent,eol,start' -- Better backspace behavior -vim.opt.autochdir = false -- Don't auto change directory -vim.opt.iskeyword:append '-' -- Treat dash as part of word -vim.opt.path:append '**' -- include subdirectories in search -vim.opt.selection = 'exclusive' -- Selection behavior -vim.opt.mouse = 'a' -- Enable mouse support +vim.opt.autochdir = false -- Don't auto change directory +vim.opt.iskeyword:append '-' -- Treat dash as part of word +vim.opt.path:append '**' -- include subdirectories in search +vim.opt.selection = 'exclusive' -- Selection behavior +vim.opt.mouse = 'a' -- Enable mouse support vim.opt.clipboard:append 'unnamedplus' -- Use system clipboard -vim.opt.modifiable = true -- Allow buffer modifications -vim.opt.encoding = 'UTF-8' -- Set encoding -vim.opt.splitbelow = true -- Horizontal splits go below -vim.opt.splitright = true -- Vertical splits go right +vim.opt.modifiable = true -- Allow buffer modifications +vim.opt.encoding = 'UTF-8' -- Set encoding +vim.opt.splitbelow = true -- Horizontal splits go below +vim.opt.splitright = true -- Vertical splits go right vim.o.inccommand = 'split' -vim.o.confirm = true -- Ask before closing (unsaved changes) +vim.o.confirm = true -- Ask before closing (unsaved changes) -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Don't show the mode, since it's already in the status line vim.o.showmode = false @@ -169,7 +167,6 @@ vim.keymap.set('n', '^[[1;9l', 'L', { desc = 'Move window to the right' }) vim.keymap.set('n', '^[[1;9j', 'J', { desc = 'Move window to the lower' }) vim.keymap.set('n', '^[[1;9k', 'K', { desc = 'Move window to the upper' }) - vim.diagnostic.config { update_in_insert = false, severity_sort = true, @@ -177,7 +174,7 @@ vim.diagnostic.config { underline = { severity = { min = vim.diagnostic.severity.WARN } }, -- Can switch between these as you prefer - virtual_text = true, -- Text shows up at the end of the line + virtual_text = true, -- Text shows up at the end of the line virtual_lines = false, -- Text shows up underneath the line, with virtual lines -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` @@ -241,14 +238,10 @@ vim.keymap.set('n', 'ya', function() end) -- Delete all content of the current buffer -vim.keymap.set('n', 'da', function() - vim.api.nvim_buf_set_lines(0, 0, -1, false, {}) -end) +vim.keymap.set('n', 'da', function() vim.api.nvim_buf_set_lines(0, 0, -1, false, {}) end) -- Select all content of the current buffer -vim.keymap.set('n', 'sa', function() - vim.api.nvim_feedkeys('ggVG', 'n', false) -end) +vim.keymap.set('n', 'sa', function() vim.api.nvim_feedkeys('ggVG', 'n', false) end) -- Basic autocommands local augroup = vim.api.nvim_create_augroup('UserConfig', {}) @@ -257,9 +250,7 @@ local augroup = vim.api.nvim_create_augroup('UserConfig', {}) vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, + callback = function() vim.hl.on_yank() end, }) -- Return to last edit position when opening files @@ -268,9 +259,7 @@ vim.api.nvim_create_autocmd('BufReadPost', { callback = function() local mark = vim.api.nvim_buf_get_mark(0, '"') local lcount = vim.api.nvim_buf_line_count(0) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end + if mark[1] > 0 and mark[1] <= lcount then pcall(vim.api.nvim_win_set_cursor, 0, mark) end end, }) @@ -297,9 +286,7 @@ vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('TermClose', { group = augroup, callback = function() - if vim.v.event.status == 0 then - vim.api.nvim_buf_delete(0, {}) - end + if vim.v.event.status == 0 then vim.api.nvim_buf_delete(0, {}) end end, }) @@ -316,21 +303,15 @@ vim.api.nvim_create_autocmd('TermOpen', { -- Auto-resize splits when window is resized vim.api.nvim_create_autocmd('VimResized', { group = augroup, - callback = function() - vim.cmd 'tabdo wincmd =' - end, + callback = function() vim.cmd 'tabdo wincmd =' end, }) -- Create directories when saving files vim.api.nvim_create_autocmd('BufWritePre', { callback = function() local filepath = vim.fn.expand ':p:h' - if filepath:match '^oil://' or vim.uv.fs_realpath(filepath) == nil then - return - end - if vim.fn.isdirectory(filepath) == 0 then - vim.fn.mkdir(filepath, 'p') - end + if filepath:match '^oil://' or vim.uv.fs_realpath(filepath) == nil then return end + if vim.fn.isdirectory(filepath) == 0 then vim.fn.mkdir(filepath, 'p') end end, }) @@ -348,9 +329,7 @@ vim.opt.maxmempattern = 20000 -- Create undo directory if it doesn't exist local undodir = vim.fn.expand '~/.vim/undodir' -if vim.fn.isdirectory(undodir) == 0 then - vim.fn.mkdir(undodir, 'p') -end +if vim.fn.isdirectory(undodir) == 0 then vim.fn.mkdir(undodir, 'p') end -- ============================================================================ -- FLOATING TERMINAL @@ -399,8 +378,7 @@ local function FloatingTerminal() vim.api.nvim_win_set_option(terminal_state.win, 'winblend', 0) -- Set transparent background for the window - vim.api.nvim_win_set_option(terminal_state.win, 'winhighlight', - 'Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder') + vim.api.nvim_win_set_option(terminal_state.win, 'winhighlight', 'Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder') -- Define highlight groups for transparency vim.api.nvim_set_hl(0, 'FloatingTermNormal', { bg = 'none' }) @@ -416,9 +394,7 @@ local function FloatingTerminal() end end - if not has_terminal then - vim.fn.termopen(os.getenv 'SHELL') - end + if not has_terminal then vim.fn.termopen(os.getenv 'SHELL') end terminal_state.is_open = true vim.cmd 'startinsert' @@ -446,8 +422,7 @@ end -- Key mappings vim.keymap.set('n', 'tft', FloatingTerminal, { noremap = true, silent = true, desc = 'Toggle floating terminal' }) -vim.keymap.set('n', 'tt', 'horizontal terminal', - { noremap = true, silent = true, desc = 'Toggle terminal' }) +vim.keymap.set('n', 'tt', 'horizontal terminal', { noremap = true, silent = true, desc = 'Toggle terminal' }) vim.keymap.set('t', '', function() if terminal_state.is_open then vim.api.nvim_win_close(terminal_state.win, false) @@ -461,7 +436,7 @@ end, { noremap = true, silent = true, desc = 'Close floating terminal from termi -- Tab display settings vim.opt.showtabline = 1 -- Always show tabline (0=never, 1=when multiple tabs, 2=always) -vim.opt.tabline = '' -- Use default tabline (empty string uses built-in) +vim.opt.tabline = '' -- Use default tabline (empty string uses built-in) -- Transparent tabline appearance vim.cmd [[ @@ -480,9 +455,7 @@ vim.keymap.set('n', 't<', 'tabmove -1', { desc = 'Move tab left -- Function to open file in new tab local function open_file_in_tab() vim.ui.input({ prompt = 'File to open in new tab: ', completion = 'file' }, function(input) - if input and input ~= '' then - vim.cmd('tabnew ' .. input) - end + if input and input ~= '' then vim.cmd('tabnew ' .. input) end end) end @@ -555,10 +528,7 @@ do end if name == 'LuaSnip' then - if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then - run_build(name, { 'make', 'install_jsregexp' }, - ev.data.path) - end + if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end return end @@ -571,7 +541,6 @@ do }) end - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. require 'kickstart.plugins' require 'custom.plugins' diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua index d71fd515..5bfec172 100644 --- a/lua/custom/plugins/markdown.lua +++ b/lua/custom/plugins/markdown.lua @@ -3,6 +3,6 @@ do vim.pack.add { gh 'OXY2DEV/markview.nvim', gh 'saghen/blink.lib', - gh 'saghen/blink.cmp' + gh 'saghen/blink.cmp', } end diff --git a/lua/custom/plugins/supermaven.lua b/lua/custom/plugins/supermaven.lua index 522b37a0..f2a8d5bc 100644 --- a/lua/custom/plugins/supermaven.lua +++ b/lua/custom/plugins/supermaven.lua @@ -11,11 +11,9 @@ do color = { cterm = 244, }, - log_level = 'info', -- set to "off" to disable logging completely + log_level = 'info', -- set to "off" to disable logging completely disable_inline_completion = false, -- disables inline completion for use with cmp - disable_keymaps = false, -- disables built in keymaps for more manual control - condition = function() - return false - end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true.} + disable_keymaps = false, -- disables built in keymaps for more manual control + condition = function() return false end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true.} } end diff --git a/lua/kickstart/plugins/auto-completion.lua b/lua/kickstart/plugins/auto-completion.lua index 0e42e30d..0b78dc04 100644 --- a/lua/kickstart/plugins/auto-completion.lua +++ b/lua/kickstart/plugins/auto-completion.lua @@ -1,7 +1,7 @@ -- Autocompletion local function gh(repo) return 'https://github.com/' .. repo end do - vim.pack.add({ gh 'saghen/blink.lib' }) + vim.pack.add { gh 'saghen/blink.lib' } vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '2.*' } } vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' } } require('blink.cmp').setup { diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 7c986407..40b70138 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -2,6 +2,6 @@ -- https://github.com/windwp/nvim-autopairs local function gh(repo) return 'https://github.com/' .. repo end do - vim.pack.add { gh 'windwp/nvim-autopairs' } - require('nvim-autopairs').setup {} + vim.pack.add { gh 'windwp/nvim-autopairs' } + require('nvim-autopairs').setup {} end diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 532a7da5..8f91b8a9 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -21,10 +21,8 @@ do vim.keymap.set('n', '', function() require('dap').step_into() end, { desc = 'Debug: Step Into' }) vim.keymap.set('n', '', function() require('dap').step_over() end, { desc = 'Debug: Step Over' }) vim.keymap.set('n', '', function() require('dap').step_out() end, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end, - { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, - { desc = 'Debug: Set Breakpoint' }) + vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end, { desc = 'Debug: Toggle Breakpoint' }) + vim.keymap.set('n', 'B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' }) -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. vim.keymap.set('n', '', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' }) diff --git a/lua/kickstart/plugins/format.lua b/lua/kickstart/plugins/format.lua index da3f6358..6bc66bea 100644 --- a/lua/kickstart/plugins/format.lua +++ b/lua/kickstart/plugins/format.lua @@ -48,6 +48,5 @@ do }, } - vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, - { desc = '[F]ormat buffer' }) + vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) end diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 63ebbfde..eb3f3486 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -35,10 +35,8 @@ do -- Actions -- visual mode - map('v', 'gs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, - { desc = 'git [s]tage hunk' }) - map('v', 'gr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, - { desc = 'git [r]eset hunk' }) + map('v', 'gs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) + map('v', 'gr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) -- normal mode map('n', 'gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) @@ -49,8 +47,7 @@ do map('n', 'gb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) map('n', 'gd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'gD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) - map('n', 'gQ', function() gitsigns.setqflist 'all' end, - { desc = 'git hunk [Q]uickfix list (all files in repo)' }) + map('n', 'gQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' }) map('n', 'gq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) diff --git a/lua/kickstart/plugins/guess-indent.lua b/lua/kickstart/plugins/guess-indent.lua index 8e9d745d..be19f25f 100644 --- a/lua/kickstart/plugins/guess-indent.lua +++ b/lua/kickstart/plugins/guess-indent.lua @@ -1,6 +1,6 @@ local function gh(repo) return 'https://github.com/' .. repo end do vim.pack.add { - gh 'NMAC427/guess-indent.nvim' -- Detect tabstop and shiftwidth automatically + gh 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically } end diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 31f334f3..80701633 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -16,7 +16,7 @@ do svelte = { 'eslint_d' }, kotlin = { 'ktlint' }, terraform = { 'tflint' }, - ruby = { "ruby" }, + ruby = { 'ruby' }, } -- Create autocommand which carries out the actual linting diff --git a/lua/kickstart/plugins/lsp.lua b/lua/kickstart/plugins/lsp.lua index a68981af..b45e0ee1 100644 --- a/lua/kickstart/plugins/lsp.lua +++ b/lua/kickstart/plugins/lsp.lua @@ -3,7 +3,6 @@ do vim.pack.add { gh 'j-hui/fidget.nvim' } require('fidget').setup {} - vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), callback = function(event) @@ -65,9 +64,7 @@ do -- -- This may be unwanted, since they displace some of your code if client and client:supports_method('textDocument/inlayHint', event.buf) then - map('th', - function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, - '[T]oggle Inlay [H]ints') + map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, }) @@ -119,7 +116,6 @@ do }, }, - stylua = {}, -- Used to format Lua code -- Special Lua Config, as recommended by neovim help docs @@ -216,8 +212,6 @@ vim.diagnostic.config { }, } - - -- Globally configure all LSP floating preview popups (like hover, signature help, etc) local open_floating_preview = vim.lsp.util.open_floating_preview function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua index edf030c7..a7dab1ae 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/kickstart/plugins/mini.lua @@ -74,20 +74,14 @@ do } local minifiles_toggle = function(dir) - if not MiniFiles.close() then - MiniFiles.open(dir) - end + if not MiniFiles.close() then MiniFiles.open(dir) end end - local open_file_in_minifiles = function() - minifiles_toggle(vim.fn.expand '%:p') - end + local open_file_in_minifiles = function() minifiles_toggle(vim.fn.expand '%:p') end local set_cwd = function() local path = (MiniFiles.get_fs_entry() or {}).path - if path == nil then - return vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) - end + if path == nil then return vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) end vim.fn.chdir(vim.fs.dirname(path)) end @@ -95,9 +89,7 @@ do local yank_path = function() if MiniFiles.get_explorer_state().target_window ~= nil then local path = (MiniFiles.get_fs_entry() or {}).path - if path == nil then - vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) - end + if path == nil then vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) end vim.fn.setreg(vim.v.register, path) end end diff --git a/lua/kickstart/plugins/snippets.lua b/lua/kickstart/plugins/snippets.lua index 1d77fe5f..c634871b 100644 --- a/lua/kickstart/plugins/snippets.lua +++ b/lua/kickstart/plugins/snippets.lua @@ -3,7 +3,7 @@ do vim.pack.add { { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' } } vim.pack.add { gh 'rafamadriz/friendly-snippets' } require('luasnip.loaders.from_vscode').lazy_load() - local ls = require('luasnip') + local ls = require 'luasnip' ls.setup { history = false, updateevents = 'TextChanged,TextChangedI', @@ -14,20 +14,14 @@ do end vim.keymap.set({ 'i', 's' }, '', function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end + if ls.expand_or_jumpable() then ls.expand_or_jump() end end, { silent = true }) vim.keymap.set({ 'i', 's' }, '', function() - if ls.jumpable(-1) then - ls.jump(-1) - end + if ls.jumpable(-1) then ls.jump(-1) end end, { silent = true }) vim.keymap.set({ 'i', 's' }, '', function() - if ls.jumpable(1) then - ls.jump(1) - end + if ls.jumpable(1) then ls.jump(1) end end, { silent = true }) end diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index c0aa16b0..a93dc691 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -117,15 +117,18 @@ do -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 'f/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[F]ind [/] in Open Files' }) + vim.keymap.set( + 'n', + 'f/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[F]ind [/] in Open Files' } + ) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'fn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[F]ind [N]eovim files' }) + vim.keymap.set('n', 'fn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[F]ind [N]eovim files' }) end diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index 2ea63eea..56867471 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -1,7 +1,7 @@ -- Useful plugin to show you pending keybinds. local function gh(repo) return 'https://github.com/' .. repo end do - vim.pack.add({ gh 'folke/which-key.nvim' }) + vim.pack.add { gh 'folke/which-key.nvim' } require('which-key').setup { -- delay between pressing a key and opening which-key (milliseconds) -- this setting is independent of vim.o.timeoutlen @@ -53,7 +53,7 @@ do { 'w', group = '[W]indow' }, { 'y', group = '[Y]ank' }, { 'S', group = '[S]ession' }, - { 'g', group = 'Git', mode = { 'n', 'v' } }, + { 'g', group = 'Git', mode = { 'n', 'v' } }, { 'q', group = 'Quickfix' }, }, }