diff --git a/init.lua b/init.lua index e077754..8261e48 100644 --- a/init.lua +++ b/init.lua @@ -21,6 +21,7 @@ require("lazy").setup({ 'stevearc/conform.nvim', --auto formats certain text 'tpope/vim-commentary', -- commenting lines with shortcut 'vigoux/ltex-ls.nvim', -- grammer checking + 'pynappo/hyprlang-to-lua.nvim', -- 'vimpostor/vim-tpipeline', -- integrate with tmux status-line 'kshenoy/vim-signature', -- tag lines 'mg979/vim-visual-multi', -- work on multiple lines at once @@ -35,7 +36,6 @@ require("lazy").setup({ { "nvzone/typr", dependencies = "nvzone/volt", cmd = { "Typr", "TyprStats" }, }, --typing practice { 'nvim-telescope/telescope.nvim', tag = 'v0.2.0', dependencies = { 'nvim-lua/plenary.nvim', 'BurntSushi/ripgrep', 'sharkdp/fd' } }, -- fuzyfinding over lists { 'norcalli/nvim-colorizer.lua', config = function() require('colorizer').setup{"*"} end,}, -- preview colors - { 'NMAC427/guess-indent.nvim', config = function() require('guess-indent').setup {} end,}, -- Detect tabstop and shiftwidth automatically { 'edluffy/hologram.nvim', auto_display = true,}, --image viewer { "denialofsandwich/sudo.nvim", dependencies = { "MunifTanjim/nui.nvim", },config = true, }, --write restricted files without restart { 'akinsho/toggleterm.nvim', version = "*", config = true}, -- terminal toggling and commands diff --git a/lazy-lock.json b/lazy-lock.json index 91726f5..f7a6f50 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,48 +3,49 @@ "base16-nvim": { "branch": "master", "commit": "23e5128eb5f629c29532c24a1e733cbe019f05bb" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "conform.nvim": { "branch": "master", "commit": "dca1a190aa85f9065979ef35802fb77131911106" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "dashboard-nvim": { "branch": "master", "commit": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fd": { "branch": "master", "commit": "7f1b1471d5e3f88087eaad77885dc70968750bb3" }, - "fzf-lua": { "branch": "main", "commit": "33fe4b6f0c817c4d99a7baeea82c4d17e57efd64" }, + "distant.nvim": { "branch": "v0.3", "commit": "67d6b066e8490725718b79f643966f4eafc7da3c" }, + "fd": { "branch": "master", "commit": "42b2ab8a84ddedf80eeed9079128c60161f64658" }, + "fzf-lua": { "branch": "main", "commit": "fea9eedc6894c44d44cbb772a5cd11c93b82d7a1" }, "gemini-cli.nvim": { "branch": "main", "commit": "c9fd62adda823628f5131a939d9c56ef7a898600" }, "gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, "hex.nvim": { "branch": "master", "commit": "b46e63356a69e8d6f046c38a9708d55d17f15038" }, "hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" }, + "hyprlang-to-lua.nvim": { "branch": "main", "commit": "477430d9f379736bc2260086eb63517bb585b5d8" }, "inc-rename.nvim": { "branch": "main", "commit": "0074b551a17338ccdcd299bd86687cc651bcb33d" }, "jq.nvim": { "branch": "main", "commit": "70e12681b1026ba7c06c691fd815eed0e2244b81" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "log-highlight.nvim": { "branch": "main", "commit": "b2e00cfd41ca94338265a595f3f3f423d9f9322e" }, "ltex-ls.nvim": { "branch": "main", "commit": "968eac261279d88d7f1ed556aa2dbc535a7489fe" }, "lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "51feb0ada33d18f3c5c71ffb46005dbf8b33bef4" }, - "mason.nvim": { "branch": "main", "commit": "e54f5bf5f12c560da31c17eee5b3e1bd369f3ff9" }, - "mini.nvim": { "branch": "main", "commit": "199b3344d4c0dab13e45483834ce11bb7744fa3a" }, - "mini.pick": { "branch": "main", "commit": "437d44eb57312f23e6b931704694fc294922cd88" }, - "neogit": { "branch": "master", "commit": "395ac481e197784e410b59b987fadaf9e7481df1" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7b01e2974a47d489bb92f47a41e4c0088ea8f86e" }, + "mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" }, + "mini.nvim": { "branch": "main", "commit": "9d0b9b7188d5c24b5a87f0d8b383ec8bda7a0de4" }, + "mini.pick": { "branch": "main", "commit": "26f94e9c84f529d713de00b900c0a307ca260f35" }, + "neogit": { "branch": "master", "commit": "99326a1310fb2d616b455d2fd16d01bf00682f06" }, "neoscroll.nvim": { "branch": "master", "commit": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8" }, "nui-components.nvim": { "branch": "main", "commit": "1654dd709f13874089eefc80d82e0eb667f7fdfb" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, + "nvim-dap": { "branch": "master", "commit": "531771530d4f82ad2d21e436e3cc052d68d7aebb" }, "nvim-java": { "branch": "main", "commit": "602a5f7fa92f9c1d425a2159133ff9de86842f0a" }, - "nvim-lspconfig": { "branch": "master", "commit": "451d4ef9abd4f0f08e379ef0d55d1c391b6125a7" }, - "nvim-man": { "branch": "master", "commit": "7fe6b3b78c71c9ef834c49e3dcbd955f7ed5c6cb" }, + "nvim-lspconfig": { "branch": "master", "commit": "9573948c38bfabeec353ae7dd7d3ffec4c506a6b" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, - "nvim-tree.lua": { "branch": "master", "commit": "f9bfc0059eca24546b69a7006110463da4808f8f" }, + "nvim-tree.lua": { "branch": "master", "commit": "07f541fcaa4a5ae019598240362449ab7e9812b3" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-web-devicons": { "branch": "master", "commit": "2795c26c916bb3c57dde308b82be51971fa92747" }, - "obsidian.nvim": { "branch": "main", "commit": "ed6f386abe83e4dafa9afecf50cd9d9fff072a07" }, + "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, + "obsidian.nvim": { "branch": "main", "commit": "d2349fdeb2c1e30cc2126fc6c7712f5103de8d15" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "render-markdown.nvim": { "branch": "main", "commit": "629eb9533ec989d9d5c6cab8f3ad5372422c24e0" }, + "render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" }, "resize.nvim": { "branch": "main", "commit": "0b8943ef2ce54e65b9e56974e94dee593b28e7b5" }, - "ripgrep": { "branch": "master", "commit": "4519153e5e461527f4bca45b042fff45c4ec6fb9" }, - "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, + "ripgrep": { "branch": "master", "commit": "4857d6fa67db69a95cd4b6f2adda5d807d4d0119" }, + "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "sudo.nvim": { "branch": "main", "commit": "10c211716f0f0149ea91732bc12338ade76d4af8" }, "telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" }, @@ -57,7 +58,7 @@ "vim-signature": { "branch": "master", "commit": "6bc3dd1294a22e897f0dcf8dd72b85f350e306bc" }, "vim-termhere": { "branch": "main", "commit": "b66d429dd48b74802f09fd059bc499c253372a1c" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "vimtex": { "branch": "master", "commit": "97e11bd4f56d46a87f8593d6ccb27820e19c4ab0" }, + "vimtex": { "branch": "master", "commit": "24e229914182ff301496a3e2c4214b28c4928d3f" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 3a30d5a..813cfaa 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -1,3 +1,7 @@ +-- lua/autocommands.lua +-- Defines autocommands to run on certain events happening +-- TODO clean this with functions + -- [[dynamically change kitty window opacity when opening and closing]] -- Define the target opacities local nvim_opacity = "0.85" diff --git a/lua/keybinds.lua b/lua/keybinds.lua index 9a1d6dd..050c056 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -1,82 +1,126 @@ --/lua/keybinds.lua -- This file defines all of the kybinds for nvim. -- vim.keymap.set('mode','key','action', {desc = 'description'}) +local utils = require("custom-functions") -- move betwwen buffer easier -vim.keymap.set('n', '', ':bnext') -vim.keymap.set('n', '', ':bprev') -vim.keymap.set('n', 'x', ':bdelete') - --- resizing pains with resize.lua shortcut -vim.keymap.set('n', '', "lua require('resize').ResizeLeft()") -vim.keymap.set('n', '', "lua require('resize').ResizeRight()") -vim.keymap.set('n', '', "lua require('resize').ResizeUp()") -vim.keymap.set('n', '', "lua require('resize').ResizeDown()") - --- termunal interface shortcuts -vim.keymap.set('n', '', 'nohlsearch') +vim.keymap.set('n','' ,':bnext') +vim.keymap.set('n','' ,':bprev') +vim.keymap.set('n','x' ,':bdelete') +-- resizing pains with resize.lua shortcut +vim.keymap.set('n','' ,"lua require('resize').ResizeLeft()") +vim.keymap.set('n','' ,"lua require('resize').ResizeRight()") +vim.keymap.set('n','' ,"lua require('resize').ResizeUp()") +vim.keymap.set('n','' ,"lua require('resize').ResizeDown()") +-- terminal interface shortcuts +vim.keymap.set('n','' ,'nohlsearch') +vim.keymap.set('t','' ,'' ,{ desc = 'Exit terminal mode' }) +vim.keymap.set('n','r' ,'TermExec cmd="clear && make"' ,{ desc = '[r]un make in terminal' }) +vim.keymap.set('n','n' ,'ToggleTerm direction=vertical name=compile size=70', { desc = 'open a [n]ew terminal' }) +vim.keymap.set('n','t' ,'ToggleTerm' ,{desc = '[T]oggle all terminals'}) +vim.keymap.set("n","e" ,"NvimTreeToggle" ,{desc = 'open [E]xplorer'}) +vim.keymap.set("n", "l" ,utils.runLastCommand ,{ desc = "Run [L]ast command in terminal 1" }) -- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) --- vim.keymap.set("n", "a", ":IncRename ", {desc = 'ren[A]me variable under cursor'}) -vim .keymap.set('n','r','TermExec cmd="clear && make"', { desc = '[r]un make in terminal' }) -vim .keymap .set('n','n', 'ToggleTerm direction=vertical name=compile size=70', { desc = 'open a [n]ew terminal' }) -vim.keymap.set('n','t', 'ToggleTerm', {desc = '[T]oggle all terminals'}) -vim.keymap.set("n", "l", function() - -- Get terminal ID 1 - -- Save position and buffer context - local term = require("toggleterm.terminal").get(1) - if term then - local original_window = vim.api.nvim_get_current_win() - local saved_view = vim.fn.winsaveview() - -- Using \r (carriage return) or \n\n often bypasses shell interceptors - -- term:send("clear\r") - term:send("test_dev.sh\r") - vim.api.nvim_set_current_win(original_window) - vim.fn.winrestview(saved_view) - else - vim.notify("Terminal 1 is not open yet!", vim.log.levels.WARN) - end - -- Return logic -end, { desc = "Run [L]ast command in terminal 1" }) +vim.keymap.set('n', 'q' ,vim.diagnostic.setloclist ,{ desc = 'Open diagnostic [Q]uickfix list' }) --- TIP: Disable arrow keys in normal mode -vim.keymap.set('n', '', 'echo "Use h to move!!"') -vim.keymap.set('n', '', 'echo "Use l to move!!"') -vim.keymap.set('n', '', 'echo "Use k to move!!"') -vim.keymap.set('n', '', 'echo "Use j to move!!"') +-- Disable arrow keys in normal mode +vim.keymap.set('n','' ,'echo "Use h to move!!"') +vim.keymap.set('n','' ,'echo "Use l to move!!"') +vim.keymap.set('n','' ,'echo "Use k to move!!"') +vim.keymap.set('n','' ,'echo "Use j to move!!"') --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- -- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n','' ,'' ,{ desc = 'Move focus to the left window' }) +vim.keymap.set('n','' ,'' ,{ desc = 'Move focus to the right window' }) +vim.keymap.set('n','' ,'' ,{ desc = 'Move focus to the lower window' }) +vim.keymap.set('n','' ,'' ,{ desc = 'Move focus to the upper window' }) -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) -vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) -vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +vim.keymap.set("n","" ,"H" ,{ desc = "Move window to the left" }) +vim.keymap.set("n","" ,"L" ,{ desc = "Move window to the right" }) +vim.keymap.set("n","" ,"J" ,{ desc = "Move window to the lower" }) +vim.keymap.set("n","" ,"K" ,{ desc = "Move window to the upper" }) -vim.keymap.set("n", "e", "NvimTreeToggle", {desc = 'open [E]xplorer'}) +-- [[ Basic QOL +-- vim.keymap.set("n", "a", ":IncRename ", {desc = 'ren[A]me variable under cursor'}) - -- gemini CLI bindings -vim.keymap.set('n', "a/", "Gemini toggle", { desc = "Toggle Gemini CLI" }) -vim.keymap.set('n', "aa", "Gemini toggle", { desc = "Toggle Gemini CLI" }) -vim.keymap.set('n', "aq", "Gemini ask", { desc = "Ask Gemini", }) -vim.keymap.set('n', "af", "Gemini add_file", { desc = "Add File"} ) +-- PLUGIN KEYBINDS +-- gemini CLI bindngs +-- TODO better AI implementation +vim.keymap.set('n',"a/" ,"Gemini toggle" ,{ desc = "Toggle Gemini CLI" }) +vim.keymap.set('n',"aa" ,"Gemini toggle" ,{ desc = "Toggle Gemini CLI" }) +vim.keymap.set('n',"aq" ,"Gemini ask" ,{ desc = "Ask Gemini", }) +vim.keymap.set('n',"af" ,"Gemini add_file" ,{ desc = "Add File"} ) --- spellcheck keybind to toggle on current buffer -vim.keymap.set('n', "ze", "setlocal spell", { desc = "enable spellecheck on buffer" }) -vim.keymap.set('n', "zd", "setlocal nospell", { desc = "Disable spellecheck on buffer" }) +--spellcheck keybind to toggle on current buffer +vim.keymap.set('n',"ze" ,"setlocal spell" ,{ desc = "enable spellecheck on buffer" }) +vim.keymap.set('n',"zd" ,"setlocal nospell" ,{ desc = "Disable spellecheck on buffer" }) ---basic qol --- Bitburner Sync Keybinds -vim.keymap.set('n', 'bp', 'BBPull', { desc = '[B]itburner [P]ull' }) -vim.keymap.set('n', 'bu', 'BBPush', { desc = '[B]itburner [U]pload/Push' }) -vim.keymap.set('n', 'br', 'BBRam', { desc = '[B]itburner [R]am check' }) --Hex Editing -vim.keymap.set('n', 'hh', 'Hex', { desc = 'open [H]ex view of a file' }) +vim.keymap.set('n', 'hh' ,'Hex' ,{ desc = 'open [H]ex view of a file' }) + +--Neogit +-- gg bound to UI toggle +vim.keymap.set('n', 'gg' ,'Neogit' ,{ desc = 'open Neo[g]it interface' }) +vim.keymap.set('n', 'gc' ,'Neogit commit' ,{ desc = 'open Neogit [c]ommit page' }) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lua/options.lua b/lua/options.lua index 6f94d1d..d9a41b8 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -52,6 +52,10 @@ vim.o.scrolloff = 25 -- See `:help 'confirm'` vim.o.confirm = true +-- vim.opt.expandtab = false -- Do NOT turn tabs into spaces +-- vim.opt.tabstop = 4 -- A literal \t character looks 4 columns wide +-- vim.opt.shiftwidth = 4 -- Number of spaces for automated indentation (<< or >>) +-- vim.opt.softtabstop = 0 -- Let the backspace key delete a full hard tab vim.opt.termguicolors = true -- required for colorizer diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index efaea73..05d0eb7 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -72,6 +72,14 @@ return { -- adds lsp functionality and api for included languages }, }, }, - } -} + } + }, + { + 'NMAC427/guess-indent.nvim', + config = function() + require('guess-indent').setup ({ + filetype_exclude = {"lua"}, + }) + end, + }, -- Detect tabstop and shiftwidth automatically }