fix: styling issues

This commit is contained in:
Guust Taillieu 2026-06-20 15:06:13 +02:00
parent 93ea6464c5
commit 5ea28f0a93
15 changed files with 92 additions and 148 deletions

139
init.lua
View File

@ -29,7 +29,7 @@
vim.g.have_nerd_font = true vim.g.have_nerd_font = true
-- Key mappings -- 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) vim.g.maplocalleader = ' ' -- Set local leader key (NEW)
-- Make background transparent -- 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, 'NormalNC', { bg = 'none' })
vim.api.nvim_set_hl(0, 'EndOfBuffer', { 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.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 -- Basic settings
vim.opt.relativenumber = true -- Relative line numbers vim.opt.relativenumber = true -- Relative line numbers
vim.opt.cursorline = true -- Highlight current line vim.opt.cursorline = true -- Highlight current line
vim.opt.wrap = false -- Don't wrap lines vim.opt.wrap = false -- Don't wrap lines
vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor
vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor
-- Indentation -- Indentation
vim.opt.tabstop = 2 -- Tab width vim.opt.tabstop = 2 -- Tab width
vim.opt.shiftwidth = 2 -- Indent width vim.opt.shiftwidth = 2 -- Indent width
vim.opt.softtabstop = 2 -- Soft tab stop vim.opt.softtabstop = 2 -- Soft tab stop
vim.opt.expandtab = true -- Use spaces instead of tabs vim.opt.expandtab = true -- Use spaces instead of tabs
vim.opt.smartindent = true -- Smart auto-indenting 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 vim.o.breakindent = true
-- Search settings -- Search settings
vim.opt.ignorecase = true -- Case insensitive search vim.opt.ignorecase = true -- Case insensitive search
vim.opt.smartcase = true -- Case sensitive if uppercase in search vim.opt.smartcase = true -- Case sensitive if uppercase in search
vim.opt.hlsearch = false -- Don't highlight search results vim.opt.hlsearch = false -- Don't highlight search results
vim.opt.incsearch = true -- Show matches as you type vim.opt.incsearch = true -- Show matches as you type
-- Visual settings -- Visual settings
vim.opt.termguicolors = true -- Enable 24-bit colors vim.opt.termguicolors = true -- Enable 24-bit colors
@ -83,45 +83,43 @@ vim.opt.listchars = { tab = ' ', trail = '·', nbsp = '␣' } -- Sets how white
-- Folding settings -- Folding settings
vim.opt.foldmethod = 'expr' -- Use expression for folding vim.opt.foldmethod = 'expr' -- Use expression for folding
-- vim.wo.vim.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- Use treesitter 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 -- File handling
vim.opt.backup = false -- Don't create backup files vim.opt.backup = false -- Don't create backup files
vim.opt.writebackup = false -- Don't create backup before writing vim.opt.writebackup = false -- Don't create backup before writing
vim.opt.swapfile = false -- Don't create swap files vim.opt.swapfile = false -- Don't create swap files
vim.opt.undofile = true -- Persistent undo vim.opt.undofile = true -- Persistent undo
vim.o.undofile = true -- Save undo history vim.o.undofile = true -- Save undo history
vim.opt.undodir = vim.fn.expand '~/.vim/undodir' -- Undo directory vim.opt.undodir = vim.fn.expand '~/.vim/undodir' -- Undo directory
vim.opt.updatetime = 250 -- Faster completion vim.opt.updatetime = 250 -- Faster completion
vim.opt.timeoutlen = 500 -- Key timeout duration vim.opt.timeoutlen = 500 -- Key timeout duration
vim.opt.ttimeoutlen = 0 -- Key code timeout vim.opt.ttimeoutlen = 0 -- Key code timeout
vim.opt.autoread = true -- Auto reload files changed outside vim vim.opt.autoread = true -- Auto reload files changed outside vim
vim.opt.autowrite = false -- Don't auto save vim.opt.autowrite = false -- Don't auto save
-- Behavior settings -- Behavior settings
vim.opt.hidden = true -- Allow hidden buffers vim.opt.hidden = true -- Allow hidden buffers
vim.opt.errorbells = false -- No error bells vim.opt.errorbells = false -- No error bells
vim.opt.backspace = 'indent,eol,start' -- Better backspace behavior vim.opt.backspace = 'indent,eol,start' -- Better backspace behavior
vim.opt.autochdir = false -- Don't auto change directory vim.opt.autochdir = false -- Don't auto change directory
vim.opt.iskeyword:append '-' -- Treat dash as part of word vim.opt.iskeyword:append '-' -- Treat dash as part of word
vim.opt.path:append '**' -- include subdirectories in search vim.opt.path:append '**' -- include subdirectories in search
vim.opt.selection = 'exclusive' -- Selection behavior vim.opt.selection = 'exclusive' -- Selection behavior
vim.opt.mouse = 'a' -- Enable mouse support vim.opt.mouse = 'a' -- Enable mouse support
vim.opt.clipboard:append 'unnamedplus' -- Use system clipboard vim.opt.clipboard:append 'unnamedplus' -- Use system clipboard
vim.opt.modifiable = true -- Allow buffer modifications vim.opt.modifiable = true -- Allow buffer modifications
vim.opt.encoding = 'UTF-8' -- Set encoding vim.opt.encoding = 'UTF-8' -- Set encoding
vim.opt.splitbelow = true -- Horizontal splits go below vim.opt.splitbelow = true -- Horizontal splits go below
vim.opt.splitright = true -- Vertical splits go right vim.opt.splitright = true -- Vertical splits go right
vim.o.inccommand = 'split' 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. -- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent. -- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'` -- See `:help 'clipboard'`
vim.schedule(function() vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
vim.o.clipboard = 'unnamedplus'
end)
-- Don't show the mode, since it's already in the status line -- Don't show the mode, since it's already in the status line
vim.o.showmode = false vim.o.showmode = false
@ -169,7 +167,6 @@ vim.keymap.set('n', '^[[1;9l', '<C-w>L', { desc = 'Move window to the right' })
vim.keymap.set('n', '^[[1;9j', '<C-w>J', { desc = 'Move window to the lower' }) vim.keymap.set('n', '^[[1;9j', '<C-w>J', { desc = 'Move window to the lower' })
vim.keymap.set('n', '^[[1;9k', '<C-w>K', { desc = 'Move window to the upper' }) vim.keymap.set('n', '^[[1;9k', '<C-w>K', { desc = 'Move window to the upper' })
vim.diagnostic.config { vim.diagnostic.config {
update_in_insert = false, update_in_insert = false,
severity_sort = true, severity_sort = true,
@ -177,7 +174,7 @@ vim.diagnostic.config {
underline = { severity = { min = vim.diagnostic.severity.WARN } }, underline = { severity = { min = vim.diagnostic.severity.WARN } },
-- Can switch between these as you prefer -- 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 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` -- 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', '<leader>ya', function()
end) end)
-- Delete all content of the current buffer -- Delete all content of the current buffer
vim.keymap.set('n', '<leader>da', function() vim.keymap.set('n', '<leader>da', function() vim.api.nvim_buf_set_lines(0, 0, -1, false, {}) end)
vim.api.nvim_buf_set_lines(0, 0, -1, false, {})
end)
-- Select all content of the current buffer -- Select all content of the current buffer
vim.keymap.set('n', '<leader>sa', function() vim.keymap.set('n', '<leader>sa', function() vim.api.nvim_feedkeys('ggVG', 'n', false) end)
vim.api.nvim_feedkeys('ggVG', 'n', false)
end)
-- Basic autocommands -- Basic autocommands
local augroup = vim.api.nvim_create_augroup('UserConfig', {}) 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', { vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text', desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function() callback = function() vim.hl.on_yank() end,
vim.hl.on_yank()
end,
}) })
-- Return to last edit position when opening files -- Return to last edit position when opening files
@ -268,9 +259,7 @@ vim.api.nvim_create_autocmd('BufReadPost', {
callback = function() callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"') local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0) local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then if mark[1] > 0 and mark[1] <= lcount then pcall(vim.api.nvim_win_set_cursor, 0, mark) end
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end, end,
}) })
@ -297,9 +286,7 @@ vim.api.nvim_create_autocmd('FileType', {
vim.api.nvim_create_autocmd('TermClose', { vim.api.nvim_create_autocmd('TermClose', {
group = augroup, group = augroup,
callback = function() callback = function()
if vim.v.event.status == 0 then if vim.v.event.status == 0 then vim.api.nvim_buf_delete(0, {}) end
vim.api.nvim_buf_delete(0, {})
end
end, end,
}) })
@ -316,21 +303,15 @@ vim.api.nvim_create_autocmd('TermOpen', {
-- Auto-resize splits when window is resized -- Auto-resize splits when window is resized
vim.api.nvim_create_autocmd('VimResized', { vim.api.nvim_create_autocmd('VimResized', {
group = augroup, group = augroup,
callback = function() callback = function() vim.cmd 'tabdo wincmd =' end,
vim.cmd 'tabdo wincmd ='
end,
}) })
-- Create directories when saving files -- Create directories when saving files
vim.api.nvim_create_autocmd('BufWritePre', { vim.api.nvim_create_autocmd('BufWritePre', {
callback = function() callback = function()
local filepath = vim.fn.expand '<afile>:p:h' local filepath = vim.fn.expand '<afile>:p:h'
if filepath:match '^oil://' or vim.uv.fs_realpath(filepath) == nil then if filepath:match '^oil://' or vim.uv.fs_realpath(filepath) == nil then return end
return if vim.fn.isdirectory(filepath) == 0 then vim.fn.mkdir(filepath, 'p') end
end
if vim.fn.isdirectory(filepath) == 0 then
vim.fn.mkdir(filepath, 'p')
end
end, end,
}) })
@ -348,9 +329,7 @@ vim.opt.maxmempattern = 20000
-- Create undo directory if it doesn't exist -- Create undo directory if it doesn't exist
local undodir = vim.fn.expand '~/.vim/undodir' local undodir = vim.fn.expand '~/.vim/undodir'
if vim.fn.isdirectory(undodir) == 0 then if vim.fn.isdirectory(undodir) == 0 then vim.fn.mkdir(undodir, 'p') end
vim.fn.mkdir(undodir, 'p')
end
-- ============================================================================ -- ============================================================================
-- FLOATING TERMINAL -- FLOATING TERMINAL
@ -399,8 +378,7 @@ local function FloatingTerminal()
vim.api.nvim_win_set_option(terminal_state.win, 'winblend', 0) vim.api.nvim_win_set_option(terminal_state.win, 'winblend', 0)
-- Set transparent background for the window -- Set transparent background for the window
vim.api.nvim_win_set_option(terminal_state.win, 'winhighlight', vim.api.nvim_win_set_option(terminal_state.win, 'winhighlight', 'Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder')
'Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder')
-- Define highlight groups for transparency -- Define highlight groups for transparency
vim.api.nvim_set_hl(0, 'FloatingTermNormal', { bg = 'none' }) vim.api.nvim_set_hl(0, 'FloatingTermNormal', { bg = 'none' })
@ -416,9 +394,7 @@ local function FloatingTerminal()
end end
end end
if not has_terminal then if not has_terminal then vim.fn.termopen(os.getenv 'SHELL') end
vim.fn.termopen(os.getenv 'SHELL')
end
terminal_state.is_open = true terminal_state.is_open = true
vim.cmd 'startinsert' vim.cmd 'startinsert'
@ -446,8 +422,7 @@ end
-- Key mappings -- Key mappings
vim.keymap.set('n', '<leader>tft', FloatingTerminal, { noremap = true, silent = true, desc = 'Toggle floating terminal' }) vim.keymap.set('n', '<leader>tft', FloatingTerminal, { noremap = true, silent = true, desc = 'Toggle floating terminal' })
vim.keymap.set('n', '<leader>tt', '<cmd>horizontal terminal<CR>', vim.keymap.set('n', '<leader>tt', '<cmd>horizontal terminal<CR>', { noremap = true, silent = true, desc = 'Toggle terminal' })
{ noremap = true, silent = true, desc = 'Toggle terminal' })
vim.keymap.set('t', '<Esc>', function() vim.keymap.set('t', '<Esc>', function()
if terminal_state.is_open then if terminal_state.is_open then
vim.api.nvim_win_close(terminal_state.win, false) 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 -- Tab display settings
vim.opt.showtabline = 1 -- Always show tabline (0=never, 1=when multiple tabs, 2=always) 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 -- Transparent tabline appearance
vim.cmd [[ vim.cmd [[
@ -480,9 +455,7 @@ vim.keymap.set('n', '<leader>t<', '<cmd>tabmove -1<CR>', { desc = 'Move tab left
-- Function to open file in new tab -- Function to open file in new tab
local function open_file_in_tab() local function open_file_in_tab()
vim.ui.input({ prompt = 'File to open in new tab: ', completion = 'file' }, function(input) vim.ui.input({ prompt = 'File to open in new tab: ', completion = 'file' }, function(input)
if input and input ~= '' then if input and input ~= '' then vim.cmd('tabnew ' .. input) end
vim.cmd('tabnew ' .. input)
end
end) end)
end end
@ -555,10 +528,7 @@ do
end end
if name == 'LuaSnip' then if name == 'LuaSnip' then
if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end
run_build(name, { 'make', 'install_jsregexp' },
ev.data.path)
end
return return
end end
@ -571,7 +541,6 @@ do
}) })
end end
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
require 'kickstart.plugins' require 'kickstart.plugins'
require 'custom.plugins' require 'custom.plugins'

View File

@ -3,6 +3,6 @@ do
vim.pack.add { vim.pack.add {
gh 'OXY2DEV/markview.nvim', gh 'OXY2DEV/markview.nvim',
gh 'saghen/blink.lib', gh 'saghen/blink.lib',
gh 'saghen/blink.cmp' gh 'saghen/blink.cmp',
} }
end end

View File

@ -11,11 +11,9 @@ do
color = { color = {
cterm = 244, 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_inline_completion = false, -- disables inline completion for use with cmp
disable_keymaps = false, -- disables built in keymaps for more manual control disable_keymaps = false, -- disables built in keymaps for more manual control
condition = function() condition = function() return false end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true.}
return false
end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true.}
} }
end end

View File

@ -1,7 +1,7 @@
-- Autocompletion -- Autocompletion
local function gh(repo) return 'https://github.com/' .. repo end local function gh(repo) return 'https://github.com/' .. repo end
do 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 '2.*' } }
vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' } } vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' } }
require('blink.cmp').setup { require('blink.cmp').setup {

View File

@ -2,6 +2,6 @@
-- https://github.com/windwp/nvim-autopairs -- https://github.com/windwp/nvim-autopairs
local function gh(repo) return 'https://github.com/' .. repo end local function gh(repo) return 'https://github.com/' .. repo end
do do
vim.pack.add { gh 'windwp/nvim-autopairs' } vim.pack.add { gh 'windwp/nvim-autopairs' }
require('nvim-autopairs').setup {} require('nvim-autopairs').setup {}
end end

View File

@ -21,10 +21,8 @@ do
vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' }) vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' }) vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F3>', function() require('dap').step_out() end, { desc = 'Debug: Step Out' }) vim.keymap.set('n', '<F3>', function() require('dap').step_out() end, { desc = 'Debug: Step Out' })
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end, vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end, { desc = 'Debug: Toggle Breakpoint' })
{ desc = 'Debug: Toggle Breakpoint' }) vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' })
vim.keymap.set('n', '<leader>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. -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
vim.keymap.set('n', '<F7>', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' }) vim.keymap.set('n', '<F7>', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' })

View File

@ -48,6 +48,5 @@ do
}, },
} }
vim.keymap.set({ 'n', 'v' }, '<leader>f', function() require('conform').format { async = true } end, vim.keymap.set({ 'n', 'v' }, '<leader>f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' })
{ desc = '[F]ormat buffer' })
end end

View File

@ -35,10 +35,8 @@ do
-- Actions -- Actions
-- visual mode -- visual mode
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
{ desc = 'git [s]tage hunk' }) map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end,
{ desc = 'git [r]eset hunk' })
-- normal mode -- normal mode
map('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
@ -49,8 +47,7 @@ do
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
map('n', '<leader>gd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', '<leader>gd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>gD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) map('n', '<leader>gD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>gQ', function() gitsigns.setqflist 'all' end, map('n', '<leader>gQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
{ desc = 'git hunk [Q]uickfix list (all files in repo)' })
map('n', '<leader>gq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) map('n', '<leader>gq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
-- Toggles -- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })

View File

@ -1,6 +1,6 @@
local function gh(repo) return 'https://github.com/' .. repo end local function gh(repo) return 'https://github.com/' .. repo end
do do
vim.pack.add { vim.pack.add {
gh 'NMAC427/guess-indent.nvim' -- Detect tabstop and shiftwidth automatically gh 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
} }
end end

View File

@ -16,7 +16,7 @@ do
svelte = { 'eslint_d' }, svelte = { 'eslint_d' },
kotlin = { 'ktlint' }, kotlin = { 'ktlint' },
terraform = { 'tflint' }, terraform = { 'tflint' },
ruby = { "ruby" }, ruby = { 'ruby' },
} }
-- Create autocommand which carries out the actual linting -- Create autocommand which carries out the actual linting

View File

@ -3,7 +3,6 @@ do
vim.pack.add { gh 'j-hui/fidget.nvim' } vim.pack.add { gh 'j-hui/fidget.nvim' }
require('fidget').setup {} require('fidget').setup {}
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event) callback = function(event)
@ -65,9 +64,7 @@ do
-- --
-- This may be unwanted, since they displace some of your code -- This may be unwanted, since they displace some of your code
if client and client:supports_method('textDocument/inlayHint', event.buf) then if client and client:supports_method('textDocument/inlayHint', event.buf) then
map('<leader>th', map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')
function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end,
'[T]oggle Inlay [H]ints')
end end
end, end,
}) })
@ -119,7 +116,6 @@ do
}, },
}, },
stylua = {}, -- Used to format Lua code stylua = {}, -- Used to format Lua code
-- Special Lua Config, as recommended by neovim help docs -- 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) -- Globally configure all LSP floating preview popups (like hover, signature help, etc)
local open_floating_preview = vim.lsp.util.open_floating_preview local open_floating_preview = vim.lsp.util.open_floating_preview
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)

View File

@ -74,20 +74,14 @@ do
} }
local minifiles_toggle = function(dir) local minifiles_toggle = function(dir)
if not MiniFiles.close() then if not MiniFiles.close() then MiniFiles.open(dir) end
MiniFiles.open(dir)
end
end end
local open_file_in_minifiles = function() local open_file_in_minifiles = function() minifiles_toggle(vim.fn.expand '%:p') end
minifiles_toggle(vim.fn.expand '%:p')
end
local set_cwd = function() local set_cwd = function()
local path = (MiniFiles.get_fs_entry() or {}).path local path = (MiniFiles.get_fs_entry() or {}).path
if path == nil then if path == nil then return vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) end
return vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR)
end
vim.fn.chdir(vim.fs.dirname(path)) vim.fn.chdir(vim.fs.dirname(path))
end end
@ -95,9 +89,7 @@ do
local yank_path = function() local yank_path = function()
if MiniFiles.get_explorer_state().target_window ~= nil then if MiniFiles.get_explorer_state().target_window ~= nil then
local path = (MiniFiles.get_fs_entry() or {}).path local path = (MiniFiles.get_fs_entry() or {}).path
if path == nil then if path == nil then vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR) end
vim.notify('Cursor is not on valid entry', vim.log.levels.ERROR)
end
vim.fn.setreg(vim.v.register, path) vim.fn.setreg(vim.v.register, path)
end end
end end

View File

@ -3,7 +3,7 @@ do
vim.pack.add { { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' } } vim.pack.add { { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' } }
vim.pack.add { gh 'rafamadriz/friendly-snippets' } vim.pack.add { gh 'rafamadriz/friendly-snippets' }
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
local ls = require('luasnip') local ls = require 'luasnip'
ls.setup { ls.setup {
history = false, history = false,
updateevents = 'TextChanged,TextChangedI', updateevents = 'TextChanged,TextChangedI',
@ -14,20 +14,14 @@ do
end end
vim.keymap.set({ 'i', 's' }, '<c-k>', function() vim.keymap.set({ 'i', 's' }, '<c-k>', function()
if ls.expand_or_jumpable() then if ls.expand_or_jumpable() then ls.expand_or_jump() end
ls.expand_or_jump()
end
end, { silent = true }) end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<c-j>', function() vim.keymap.set({ 'i', 's' }, '<c-j>', function()
if ls.jumpable(-1) then if ls.jumpable(-1) then ls.jump(-1) end
ls.jump(-1)
end
end, { silent = true }) end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<c-l>', function() vim.keymap.set({ 'i', 's' }, '<c-l>', function()
if ls.jumpable(1) then if ls.jumpable(1) then ls.jump(1) end
ls.jump(1)
end
end, { silent = true }) end, { silent = true })
end end

View File

@ -117,15 +117,18 @@ do
-- It's also possible to pass additional configuration options. -- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys -- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set('n', '<leader>f/', function() vim.keymap.set(
builtin.live_grep { 'n',
grep_open_files = true, '<leader>f/',
prompt_title = 'Live Grep in Open Files', function()
} builtin.live_grep {
end, { desc = '[F]ind [/] in Open Files' }) 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 -- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>fn', function() vim.keymap.set('n', '<leader>fn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[F]ind [N]eovim files' })
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[F]ind [N]eovim files' })
end end

View File

@ -1,7 +1,7 @@
-- Useful plugin to show you pending keybinds. -- Useful plugin to show you pending keybinds.
local function gh(repo) return 'https://github.com/' .. repo end local function gh(repo) return 'https://github.com/' .. repo end
do do
vim.pack.add({ gh 'folke/which-key.nvim' }) vim.pack.add { gh 'folke/which-key.nvim' }
require('which-key').setup { require('which-key').setup {
-- delay between pressing a key and opening which-key (milliseconds) -- delay between pressing a key and opening which-key (milliseconds)
-- this setting is independent of vim.o.timeoutlen -- this setting is independent of vim.o.timeoutlen
@ -53,7 +53,7 @@ do
{ '<leader>w', group = '[W]indow' }, { '<leader>w', group = '[W]indow' },
{ '<leader>y', group = '[Y]ank' }, { '<leader>y', group = '[Y]ank' },
{ '<leader>S', group = '[S]ession' }, { '<leader>S', group = '[S]ession' },
{ '<leader>g', group = 'Git', mode = { 'n', 'v' } }, { '<leader>g', group = 'Git', mode = { 'n', 'v' } },
{ '<leader>q', group = 'Quickfix' }, { '<leader>q', group = 'Quickfix' },
}, },
} }