diff --git a/lazy-lock.json b/lazy-lock.json index 00576a2..4caaaab 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -49,5 +49,6 @@ "tokyonight.nvim": { "branch": "main", "commit": "c5df636ce62a8aab7565f35da143cfd672526302" }, "trouble.nvim": { "branch": "main", "commit": "d56bfc0c501ced4002a57cb60433362fb2ce9c4d" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, - "vim-matchup": { "branch": "master", "commit": "1e276be9306490e439784cf5e8abe1f93b4a41b6" } + "vim-matchup": { "branch": "master", "commit": "1e276be9306490e439784cf5e8abe1f93b4a41b6" }, + "which-key.nvim": { "branch": "main", "commit": "4acffc92953a90a790603bfdab7c92319ab167b1" } } \ No newline at end of file diff --git a/lua/.luarc.json b/lua/.luarc.json new file mode 100644 index 0000000..bcbc12f --- /dev/null +++ b/lua/.luarc.json @@ -0,0 +1,58 @@ +{ + "workspace.library": [ + "/Users/ghost/.local/share/nvim/lazy/neodev.nvim/types/stable", + "/Users/ghost/Documents/DEV/IDE/nvim-macos/share/nvim/runtime/lua", + "/Users/ghost/.local/share/nvim/lazy/glow.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/vim-illuminate/lua", + "/Users/ghost/.local/share/nvim/lazy/telescope.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/todo-comments.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/lsp_signature.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/indent-blankline.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/guess-indent.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/plenary.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/gitsigns.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/trouble.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/barbar.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-cmp/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-code-action-menu/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-lspconfig/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp-nvim-lsp/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-ts-autotag/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-ts-context-commentstring/lua", + "/Users/ghost/.local/share/nvim/lazy/lazy.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/git-blame.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/tokyonight.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp_luasnip/lua", + "/Users/ghost/.local/share/nvim/lazy/lualine.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/smart-splits.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/mason-lspconfig.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-treesitter/lua", + "/Users/ghost/.local/share/nvim/lazy/neo-tree.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/toggleterm.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/symbols-outline.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/mason.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-dap-ui/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp-cmdline/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp-path/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp-buffer/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-web-devicons/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-dap/lua", + "/Users/ghost/.local/share/nvim/lazy/neodev.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/Comment.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/filetype.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/cmp-nvim-lua/lua", + "/Users/ghost/.local/share/nvim/lazy/vim-matchup/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-dap-go/lua", + "/Users/ghost/.local/share/nvim/lazy/bigfile.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/LuaSnip/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-colorizer.lua/lua", + "/Users/ghost/.local/share/nvim/lazy/diffview.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/nvim-autopairs/lua", + "/Users/ghost/.local/share/nvim/lazy/nui.nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/alpha-nvim/lua", + "/Users/ghost/.local/share/nvim/lazy/cosmic-ui/lua", + "/Users/ghost/.config/nvim/lua", + "${3rd}/luv/library" + ] +} \ No newline at end of file diff --git a/lua/plugins/config/whichkey.lua b/lua/plugins/config/whichkey.lua new file mode 100644 index 0000000..e6effbd --- /dev/null +++ b/lua/plugins/config/whichkey.lua @@ -0,0 +1,78 @@ +local wk = require("which-key") + +wk.setup { + ignore_missing = true, + key_labels = { + [""] = "SPC" + } +} + +wk.register({ + [""] = { + f = { + name = "Find", + f = { "Telescope fd", "find file" }, + w = { "Telescope live_grep", "live grep" }, + s = { "Telescope spell_suggest", "spell suggest" }, + b = { "Telescope buffers", "all buffers" }, + t = { "TodoTelescope", "todos" }, + ["."] = { "Telescope keymaps", "keymaps" } + }, + + l = { + name = "LSP", + r = { "lua require('cosmic-ui').rename()", "rename" }, + d = { "Telescope diagnostics", "diagnostics" }, + f = { "lua vim.lsp.buf.format { async = true }", "format" }, + a = { "CodeActionMenu", "code action" } + }, + + b = { + name = "Buffer", + p = { "BufferPick", "pick buffer" }, + q = { "BufferMovePrevious", "move buffer left" }, + w = { "BufferMoveNext", "move buffer right" }, + x = { "BufferCloseAllButCurrent", "close all but current" } + }, + + g = { + name = "Git", + b = { "Gitsigns blame_line", "blame line" }, + B = { "DiffviewOpen", "diff view & merge tool" }, + d = { "Gitsigns diffthis", "diff" }, + s = { "Telescope git_status", "git status" }, + c = { "Telescope git_commits", "commits" }, + C = { "DiffviewClose", "close diffview & merge tool" } + }, + + x = { "BufferClose", "close buffer" }, + c = { "Telescope colorscheme", "colorscheme" }, + s = { "SymbolsOutline", "symbols outline" }, + h = { "noh", "no highlight" }, + k = { "lua vim.lsp.buf.hover()", "hover" } + }, + + t = { + name = "Trouble", + t = { "TroubleToggle", "toggle trouble" } + }, + + g = { + d = { "lua vim.lsp.buf.definition()", "definition" }, + D = { "lua vim.lsp.buf.declaration()", "declaration" }, + i = { "lua vim.lsp.buf.implementation()", "implementation" }, + t = { "lua vim.lsp.buf.type_definition()", "type definition" } + }, + + K = { "lua require('lsp_signature').toggle_float_win()", "hover" }, + + -- Nvim Tree + [""] = { "Neotree toggle", "toggle neotree" }, + + -- Switching Buffers + [""] = { "BufferNext", "next buffer" }, + [""] = { "BufferPrevious", "previous buffer" }, + + -- Find in file + [""] = { "Telescope current_buffer_fuzzy_find", "find in file" } +}) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 9dfe089..0687663 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -151,5 +151,12 @@ return { lazy = true, dependencies = "mfussenegger/nvim-dap", config = true + }, + + { + "folke/which-key.nvim", + config = function() + require("plugins.config.whichkey") + end } } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 053055b..6c5a112 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -6,15 +6,17 @@ return { build = "make" }, cmd = "Telescope", - opts = { - defaults = { - layout_strategy = "vertical" - }, - - file_ignore_patterns = { "node_modules" } - }, config = function() local telescope = require("telescope") + + telescope.setup { + defaults = { + layout_strategy = "vertical" + }, + + file_ignore_patterns = { "node_modules" } + } + telescope.load_extension("fzf") end }