@@ -171,6 +171,9 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
171171-- Save file
172172vim .keymap .set (' n' , ' <leader>w' , ' <cmd>w<CR>' , { desc = ' Save file' })
173173
174+ -- Duplicate line (without affecting yank register)
175+ vim .keymap .set (' n' , ' <leader>d' , ' :t.<CR>' , { desc = ' Duplicate line' })
176+
174177-- Diagnostic keymaps
175178vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
176179
@@ -231,6 +234,41 @@ map('n', '<D-k>', ':m .-2<CR>==', { desc = 'Move line up (Cmd)' })
231234map (' v' , ' <D-j>' , " :m '>+1<CR>gv=gv" , { desc = ' Move selection down (Cmd)' })
232235map (' v' , ' <D-k>' , " :m '<-2<CR>gv=gv" , { desc = ' Move selection up (Cmd)' })
233236
237+ -- Jump to last terminal buffer and enter insert mode
238+ map (' n' , ' <leader>tt' , function ()
239+ local term_bufs = vim .tbl_filter (function (buf )
240+ return vim .bo [buf ].buftype == ' terminal'
241+ end , vim .api .nvim_list_bufs ())
242+
243+ if # term_bufs > 0 then
244+ vim .cmd (' buffer ' .. term_bufs [# term_bufs ])
245+ vim .cmd (' startinsert' )
246+ end
247+ end , { desc = ' Jump to last terminal buffer' })
248+
249+ -- Zig debug print variable
250+ map (' n' , ' <leader>pf' , function ()
251+ -- Get the word under cursor
252+ local word = vim .fn .expand (' <cword>' )
253+
254+ -- Get current line number
255+ local line = vim .fn .line (' .' )
256+
257+ -- Get current indentation
258+ local indent = vim .fn .indent (line )
259+ local indent_str = string.rep (' ' , indent )
260+
261+ -- Create the debug print line
262+ local debug_line = indent_str .. ' std.debug.print("' .. word .. ' : {}\\ n", .{' .. word .. ' });'
263+
264+ -- Insert line below and position cursor
265+ vim .fn .append (line , debug_line )
266+
267+ -- Move cursor to the inserted line, at the position after the opening quote
268+ vim .fn .cursor (line + 1 , indent + 19 + # word )
269+ vim .cmd (' startinsert' )
270+ end , { desc = ' Zig debug print variable' })
271+
234272-- [[ Basic Autocommands ]]
235273-- See `:help lua-guide-autocommands`
236274
@@ -245,6 +283,9 @@ vim.api.nvim_create_autocmd('TextYankPost', {
245283 end ,
246284})
247285
286+ -- Make indent guides match comment color
287+ vim .api .nvim_set_hl (0 , ' IblIndent' , { fg = ' #161a1f' }) -- RGB 22, 26, 31
288+
248289-- [[ Install `lazy.nvim` plugin manager ]]
249290-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
250291local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
@@ -271,44 +312,6 @@ vim.opt.rtp:prepend(lazypath)
271312require (' lazy' ).setup ({
272313 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
273314 ' tpope/vim-sleuth' , -- Detect tabstop and shiftwidth automatically
274- -- NOTE: nvim-tree - FQ
275- {
276- ' nvim-tree/nvim-tree.lua' ,
277- dependencies = {
278- ' nvim-tree/nvim-web-devicons' , -- optional, for file icons
279- },
280- version = ' *' ,
281- lazy = false ,
282- config = function ()
283- require (' nvim-tree' ).setup {
284- sync_root_with_cwd = true ,
285- respect_buf_cwd = true ,
286- }
287- -- Optional: Keybinding to toggle nvim-tree
288- vim .keymap .set (' n' , ' <leader>e' , ' :NvimTreeToggle<CR>' , { desc = ' Toggle File Explorer (nvim-tree)' })
289- end ,
290- },
291- -- NOTE: FQ dropbar
292- {
293- ' Bekaboo/dropbar.nvim' ,
294- -- optional, but required for fuzzy finder support
295- dependencies = {
296- ' nvim-telescope/telescope-fzf-native.nvim' ,
297- build = ' make' ,
298- },
299- config = function ()
300- local dropbar_api = require ' dropbar.api'
301- vim .keymap .set (' n' , ' <Leader>;' , dropbar_api .pick , { desc = ' Pick symbols in winbar' })
302- vim .keymap .set (' n' , ' [;' , dropbar_api .goto_context_start , { desc = ' Go to start of current context' })
303- vim .keymap .set (' n' , ' ];' , dropbar_api .select_next_context , { desc = ' Select next context' })
304- end ,
305- },
306- -- --NOTE: Kanso Theme - FQ
307- -- {
308- -- 'webhooked/kanso.nvim',
309- -- lazy = false,
310- -- priority = 1000,
311- -- },
312315 -- NOTE: Plugins can also be added by using a table,
313316 -- with the first argument being the link and the following
314317 -- keys can be used to configure plugin behavior/loading/etc.
0 commit comments