mbp
This commit is contained in:
parent
ee0ee40cf3
commit
4095694799
79
init.lua
79
init.lua
|
|
@ -171,6 +171,9 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|||
-- Save file
|
||||
vim.keymap.set('n', '<leader>w', '<cmd>w<CR>', { desc = 'Save file' })
|
||||
|
||||
-- Duplicate line (without affecting yank register)
|
||||
vim.keymap.set('n', '<leader>d', ':t.<CR>', { desc = 'Duplicate line' })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||
|
||||
|
|
@ -231,6 +234,41 @@ map('n', '<D-k>', ':m .-2<CR>==', { desc = 'Move line up (Cmd)' })
|
|||
map('v', '<D-j>', ":m '>+1<CR>gv=gv", { desc = 'Move selection down (Cmd)' })
|
||||
map('v', '<D-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up (Cmd)' })
|
||||
|
||||
-- Jump to last terminal buffer and enter insert mode
|
||||
map('n', '<leader>tt', function()
|
||||
local term_bufs = vim.tbl_filter(function(buf)
|
||||
return vim.bo[buf].buftype == 'terminal'
|
||||
end, vim.api.nvim_list_bufs())
|
||||
|
||||
if #term_bufs > 0 then
|
||||
vim.cmd('buffer ' .. term_bufs[#term_bufs])
|
||||
vim.cmd('startinsert')
|
||||
end
|
||||
end, { desc = 'Jump to last terminal buffer' })
|
||||
|
||||
-- Zig debug print variable
|
||||
map('n', '<leader>pf', function()
|
||||
-- Get the word under cursor
|
||||
local word = vim.fn.expand('<cword>')
|
||||
|
||||
-- Get current line number
|
||||
local line = vim.fn.line('.')
|
||||
|
||||
-- Get current indentation
|
||||
local indent = vim.fn.indent(line)
|
||||
local indent_str = string.rep(' ', indent)
|
||||
|
||||
-- Create the debug print line
|
||||
local debug_line = indent_str .. 'std.debug.print("' .. word .. ': {}\\n", .{' .. word .. '});'
|
||||
|
||||
-- Insert line below and position cursor
|
||||
vim.fn.append(line, debug_line)
|
||||
|
||||
-- Move cursor to the inserted line, at the position after the opening quote
|
||||
vim.fn.cursor(line + 1, indent + 19 + #word)
|
||||
vim.cmd('startinsert')
|
||||
end, { desc = 'Zig debug print variable' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
|
|
@ -245,6 +283,9 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Make indent guides match comment color
|
||||
vim.api.nvim_set_hl(0, 'IblIndent', { fg = '#161a1f' }) -- RGB 22, 26, 31
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
|
|
@ -271,44 +312,6 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require('lazy').setup({
|
||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
--NOTE: nvim-tree - FQ
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons', -- optional, for file icons
|
||||
},
|
||||
version = '*',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('nvim-tree').setup {
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
}
|
||||
-- Optional: Keybinding to toggle nvim-tree
|
||||
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = 'Toggle File Explorer (nvim-tree)' })
|
||||
end,
|
||||
},
|
||||
-- NOTE: FQ dropbar
|
||||
{
|
||||
'Bekaboo/dropbar.nvim',
|
||||
-- optional, but required for fuzzy finder support
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
},
|
||||
config = function()
|
||||
local dropbar_api = require 'dropbar.api'
|
||||
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' })
|
||||
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' })
|
||||
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
|
||||
end,
|
||||
},
|
||||
-- --NOTE: Kanso Theme - FQ
|
||||
-- {
|
||||
-- 'webhooked/kanso.nvim',
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- },
|
||||
-- NOTE: Plugins can also be added by using a table,
|
||||
-- with the first argument being the link and the following
|
||||
-- keys can be used to configure plugin behavior/loading/etc.
|
||||
|
|
|
|||
|
|
@ -6,19 +6,21 @@
|
|||
"dropbar.nvim": { "branch": "master", "commit": "b695c346fd180d504c1d135435cbcfba08ad3946" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "88205953bd748322b49b26e1dfb0389932520dc9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
||||
"hover.nvim": { "branch": "main", "commit": "3b49066e09e03e63be6d6f43ae2b8bcd58301f63" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"kanso.nvim": { "branch": "main", "commit": "62e9c5d669567d086474b2b6863e0724c71c6c99" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "be159e939543777bbfe9e1fe5389984c4570afce" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" },
|
||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||
"mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9276b82935bf6b951d08c864eb5ac3f85d6b743b" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "6b5b36659688767fb9f133bb83024ab1466fe5cd" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"mini.nvim": { "branch": "main", "commit": "4eaa8f4034535c372f6ca04b2772897048296dab" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "321bc61580fd066b76861c32de3319c3a6d089e7" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"precognition.nvim": { "branch": "main", "commit": "2aae2687207029b3611a0e19a289f9e1c7efbe16" },
|
||||
|
|
@ -27,5 +29,5 @@
|
|||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
'Bekaboo/dropbar.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
},
|
||||
config = function()
|
||||
local dropbar_api = require 'dropbar.api'
|
||||
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' })
|
||||
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' })
|
||||
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
return {
|
||||
'lewis6991/hover.nvim',
|
||||
config = function()
|
||||
require('hover').setup {
|
||||
init = function()
|
||||
-- Require providers
|
||||
require 'hover.providers.lsp'
|
||||
require 'hover.providers.diagnostic'
|
||||
require 'hover.providers.man'
|
||||
require 'hover.providers.dictionary'
|
||||
end,
|
||||
preview_opts = {
|
||||
border = 'rounded',
|
||||
},
|
||||
preview_window = false,
|
||||
title = true,
|
||||
mouse_providers = {
|
||||
'LSP',
|
||||
},
|
||||
mouse_delay = 1000,
|
||||
}
|
||||
|
||||
-- Setup keymaps
|
||||
vim.keymap.set('n', 'K', require('hover').hover, { desc = 'hover.nvim' })
|
||||
vim.keymap.set('n', 'gK', require('hover').hover_select, { desc = 'hover.nvim (select)' })
|
||||
vim.keymap.set('n', '<C-p>', function()
|
||||
require('hover').hover_switch 'previous'
|
||||
end, { desc = 'hover.nvim (previous source)' })
|
||||
vim.keymap.set('n', '<C-n>', function()
|
||||
require('hover').hover_switch 'next'
|
||||
end, { desc = 'hover.nvim (next source)' })
|
||||
|
||||
-- Mouse support
|
||||
vim.keymap.set('n', '<MouseMove>', require('hover').hover_mouse, { desc = 'hover.nvim (mouse)' })
|
||||
vim.o.mousemoveevent = true
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons', -- optional, for file icons
|
||||
},
|
||||
version = '*',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('nvim-tree').setup {
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
}
|
||||
-- Keybinding to toggle nvim-tree
|
||||
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = 'Toggle File Explorer (nvim-tree)' })
|
||||
end,
|
||||
}
|
||||
|
|
@ -4,6 +4,17 @@ return {
|
|||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
opts = {
|
||||
indent = {
|
||||
char = '▏', -- Thinner character (alternatives: '│', '┊', '┆', '¦', '|', '⁞')
|
||||
smart_indent_cap = true,
|
||||
},
|
||||
scope = {
|
||||
enabled = false, -- Disable scope highlighting
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue