From c429651e954525b013ce3e2926a5085c8a14a63e Mon Sep 17 00:00:00 2001 From: Matthew Leong Date: Tue, 10 Jan 2023 08:17:49 -0800 Subject: [PATCH] fix(telescope): fix init mapping --- lazy-lock.json | 18 ++-- lua/cosmic/core/user.lua | 1 + lua/cosmic/plugins/telescope/init.lua | 2 +- lua/cosmic/plugins/which-key/init.lua | 133 +++++++++++++------------- 4 files changed, 75 insertions(+), 79 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 36b5ac6..ecc0f59 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -11,13 +11,13 @@ "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cosmic-ui": { "branch": "main", "commit": "c0b14531999f2bfef3d927c4dcd57a1a8fed5ee9" }, "friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" }, - "gitsigns.nvim": { "branch": "main", "commit": "114362a85e51918ab2965181ffa31932c181f32f" }, - "lazy.nvim": { "branch": "main", "commit": "e6ee0fa6103e9514e85a96fc16902ad7f777b53f" }, + "gitsigns.nvim": { "branch": "main", "commit": "c6f45ccfe22009e88f9d799cfca3c28791fa78cd" }, + "lazy.nvim": { "branch": "main", "commit": "8756c0950ca9053713262abd1092f6d100adc9a5" }, "lsp_lines.nvim": { "branch": "main", "commit": "ec98b45c8280e5ef8c84028d4f38aa447276c002" }, "lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "3751eb5c56c67b51e68a1f4a0da28ae74ab771c1" }, - "mason.nvim": { "branch": "main", "commit": "a4ebe1f14ba31242cd09f9e0709d5b1f9d2bcecb" }, - "noice.nvim": { "branch": "main", "commit": "eadc279a27abc34ffcde84596e24e7780add11b1" }, + "mason.nvim": { "branch": "main", "commit": "ca8afdf6f44e70461c113d89e7718154c65d2e97" }, + "noice.nvim": { "branch": "main", "commit": "567ad5b7cb0b96af89c6b7a8184284db48375aa3" }, "nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" }, "null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" }, "nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" }, @@ -26,20 +26,20 @@ "nvim-lsp-ts-utils": { "branch": "main", "commit": "0a6a16ef292c9b61eac6dad00d52666c7f84b0e7" }, "nvim-lspconfig": { "branch": "master", "commit": "7b98aadc6e85db4fc3af6c1ec22c4774d965506e" }, "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, - "nvim-tree.lua": { "branch": "master", "commit": "677d54afee1dfa7a30eb9e16ab7d9d1affc6484b" }, - "nvim-treesitter": { "branch": "master", "commit": "5fb315df12a3091f241b0326aed0ec70381adbd8" }, + "nvim-tree.lua": { "branch": "master", "commit": "3ce0a8e770f70a135ef969e0a640bd8d05baf42c" }, + "nvim-treesitter": { "branch": "master", "commit": "5b1299868302184f2e15819a719df698ad1aa251" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "75f5895cc662d61eb919da8050b7a0124400d589" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" }, "nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" }, - "plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" }, + "plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, - "telescope.nvim": { "branch": "master", "commit": "04af51dbfb17c2afa0b8d82b0e842e0638201ca9" }, + "telescope.nvim": { "branch": "master", "commit": "e8c01bab917537ba4f54193c29b77bf4a04584d3" }, "todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" }, "tokyonight.nvim": { "branch": "main", "commit": "def91651c41f6d1d43ebcb50763324d35331baee" }, "vim-floaterm": { "branch": "master", "commit": "280b34a0760801168a67f952542b6c49292aa5f3" }, "vim-fugitive": { "branch": "master", "commit": "99cdb88bc64063dc4656ae53496f06fb2a394cd4" }, "vim-hcl": { "branch": "main", "commit": "1e1116c17a5774851360ea8077f349e36fc733c1" }, - "which-key.nvim": { "branch": "main", "commit": "85f69b07afce4ea77c58ae9a3aeb4e6c918b4d34" } + "which-key.nvim": { "branch": "main", "commit": "68bacb61267b87de657793bacf3a18618a5fb0e1" } } \ No newline at end of file diff --git a/lua/cosmic/core/user.lua b/lua/cosmic/core/user.lua index 2907622..033a402 100644 --- a/lua/cosmic/core/user.lua +++ b/lua/cosmic/core/user.lua @@ -50,6 +50,7 @@ local default_config = { sumneko_lua = { format = false, }, + gopls = true, html = true, tsserver = { format = false, diff --git a/lua/cosmic/plugins/telescope/init.lua b/lua/cosmic/plugins/telescope/init.lua index 1838a08..4e6bd08 100644 --- a/lua/cosmic/plugins/telescope/init.lua +++ b/lua/cosmic/plugins/telescope/init.lua @@ -46,7 +46,7 @@ return { keys = { { 'ff', - 'lua require("cosmic.plugins.telescope.mappings").project_files()', + 'lua require("cosmic.plugins.telescope.utils").project_files()', desc = 'Find project file', }, }, diff --git a/lua/cosmic/plugins/which-key/init.lua b/lua/cosmic/plugins/which-key/init.lua index 3e08c92..9813072 100644 --- a/lua/cosmic/plugins/which-key/init.lua +++ b/lua/cosmic/plugins/which-key/init.lua @@ -1,79 +1,74 @@ local user_config = require('cosmic.core.user') return { - { -- color scheme - 'folke/which-key.nvim', - config = function() - local wk = require('which-key') - wk.setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - window = { - border = user_config.border, -- none, single, double, shadow - position = 'bottom', -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 3, 2, 3, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 20, - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 8, -- spacing between columns - align = 'center', -- align columns left, center or right - }, - }) + 'folke/which-key.nvim', + config = function() + local wk = require('which-key') + wk.setup({ + window = { + border = user_config.border, + position = 'bottom', + margin = { 1, 0, 1, 0 }, + padding = { 3, 2, 3, 2 }, + winblend = 20, + }, + layout = { + height = { min = 4, max = 25 }, + width = { min = 20, max = 50 }, + spacing = 8, + align = 'center', + }, + }) - wk.register({ - [''] = { - b = { - name = '+buffer', + wk.register({ + [''] = { + b = { + name = '+buffer', + }, + c = { + name = '+quickfix', + }, + f = { + name = '+find', + }, + h = { + name = '+gitsigns', + t = { + name = '+toggle', }, - c = { - name = '+quickfix', - }, - f = { - name = '+find', - }, - h = { - name = '+gitsigns', - t = { - name = '+toggle', - }, - }, - l = { - name = '+lsp', - d = { - name = '+diagnostics', - }, - t = { - name = '+toggle', - }, - w = { - name = '+workspace', - }, - }, - g = { - name = '+goto (lsp)', - }, - n = { - name = '+tree', - }, - s = { - name = '+session', + }, + l = { + name = '+lsp', + d = { + name = '+diagnostics', }, t = { - name = '+tab', + name = '+toggle', }, - v = { - name = '+vcs (git)', - t = { - name = '+toggle', - }, + w = { + name = '+workspace', }, }, - }) - end, - event = 'VeryLazy', - enabled = not vim.tbl_contains(user_config.disable_builtin_plugins, 'which-key'), - }, + g = { + name = '+goto', + }, + n = { + name = '+tree', + }, + s = { + name = '+session', + }, + t = { + name = '+tab', + }, + v = { + name = '+vcs (git)', + t = { + name = '+toggle', + }, + }, + }, + }) + end, + event = 'VeryLazy', + enabled = not vim.tbl_contains(user_config.disable_builtin_plugins, 'which-key'), }