From 0a28cdf9d6f03b86f55a95854fcd2f29a468d476 Mon Sep 17 00:00:00 2001 From: Alexey Svirschevskiy Date: Wed, 26 Jan 2022 19:15:42 +0100 Subject: fix(lsp): avoid accessing undefined user_data (#2216) Co-authored-by: Alexey Svirshchevskiy --- lua/lvim/lsp/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index fb59ca51..3d62461d 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -23,7 +23,7 @@ return { prefix = "", format = function(d) local t = vim.deepcopy(d) - local code = d.code or d.user_data.lsp.code + local code = d.code or (d.user_data and d.user_data.lsp.code) if code then t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "") end -- cgit v1.2.3 From 36f232279be1e8d4b1933fd88ce5121a74a9f054 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Thu, 27 Jan 2022 10:16:20 +0100 Subject: chore(plugins): bump plugin version (#2217) --- lua/lvim/plugins.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lua') diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 90c77f7e..b5c57f24 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -4,25 +4,25 @@ local commit = { cmp_luasnip = "d6f837f4e8fe48eeae288e638691b91b97d1737f", cmp_nvim_lsp = "ebdfc204afb87f15ce3d3d3f5df0b8181443b5ba", cmp_path = "c5230cb439df9547294678d0f1c1465ad7989e5f", - comment = "90df2f87c0b17193d073d1f72cea2e528e5b162d", - dapinstall = "568d946a99edb6780912cb39ca68c368516cd853", + comment = "7365bfe9fc6dc004cc97b8977aa8129999d81bf5", + dapinstall = "24923c3819a450a772bb8f675926d530e829665f", dashboard_nvim = "d82ddae95fd4dc4c3b7bbe87f09b1840fbf20ecb", fixcursorhold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", - friendly_snippets = "a8efb538f4be58b4f4586bc964f9f10496c05e31", - gitsigns = "f43cee333fdfeb27aae86bab73a38c5885d5c7f4", + friendly_snippets = "4f6bd8eb5fbe0e45d57e732783ead2c3a01f549c", + gitsigns = "4a2d30f5fb77750c7a42be9bb58a9cc2c6c7f31d", lua_dev = "a0ee77789d9948adce64d98700cc90cecaef88d5", - lualine = "70691ae350fdbe1f15758e3b8e2973742a7967a9", - luasnip = "0222ee63c9e4b80e6000d064f8efd8edcc6d0c48", + lualine = "9208bae98fd5d1ab6145868a8c48bfee53c1a499", + luasnip = "59576a5cf28556a393eedfe38467e998288fc905", nlsp_settings = "3a3942b5d1da30e3ca0dc431aada3191c5952054", - null_ls = "0adceda4fb3fdd25ff015e68ebe176268b12bb2c", + null_ls = "59067dae4bf2367eb06326e419c23353722ecbec", nvim_autopairs = "97e454ce9b1371373105716d196c1017394bc947", - nvim_cmp = "7cb14b0c0f926e3cd5ac4d2e19634f82534c9d3c", + nvim_cmp = "d93104244c3834fbd8f3dd01da9729920e0b5fe7", nvim_dap = "c9a58267524f560112ecb6faa36ab2b5bc2f78a3", - nvim_lsp_installer = "cc34adb58de9e5a42af730c97ec04fc500bb5e63", - nvim_lspconfig = "ea29110765cb42e842dc8372c793a6173d89b0c4", + nvim_lsp_installer = "88e44bbbe2e03523e08f2bd3c9a954675bc438f4", + nvim_lspconfig = "c51096481dc13193991571b7132740d762902355", nvim_notify = "15f52efacd169ea26b0f4070451d3ea53f98cd5a", - nvim_tree = "0a2f6b0b6ba558a88c77a6b262af647760e6eca8", - nvim_treesitter = "9e90866bcea3e392126c4eb90fde56b1c0b56b69", + nvim_tree = "2dfed89af7724f9e71d2fdbe3cde791a93e9b9e0", + nvim_treesitter = "620cc936ad6b26c59bb2d888b3890bb8d06c50c7", nvim_ts_context_commentstring = "097df33c9ef5bbd3828105e4bee99965b758dc3f", nvim_web_devicons = "634e26818f2bea9161b7efa76735746838971824", packer = "7182f0ddbca2dd6f6723633a84d47f4d26518191", @@ -32,7 +32,7 @@ local commit = { structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", telescope = "0011b1148d3975600f5a9f0be8058cdaac4e30d9", telescope_fzf_native = "b8662b076175e75e6497c59f3e2799b879d7b954", - toggleterm = "f23866b8fbb0703be4e15d50c814ffe496242a67", + toggleterm = "d2ceb2ca3268d09db3033b133c0ee4642e07f059", which_key = "28d2bd129575b5e9ebddd88506601290bb2bb221", } -- cgit v1.2.3 From 31a48325cfa98f75a4b88b1de4e80b7e38cb0e99 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 30 Jan 2022 20:51:45 +0100 Subject: chore(plugins): update plugin version (#2225) * chore(plugins): update plugin version * fix(lvim-info): make the git branch cmd compatible with mac --- lua/lvim/plugins.lua | 18 +++++++++--------- lua/lvim/utils/git.lua | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'lua') diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index b5c57f24..c4c2c61f 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -4,25 +4,25 @@ local commit = { cmp_luasnip = "d6f837f4e8fe48eeae288e638691b91b97d1737f", cmp_nvim_lsp = "ebdfc204afb87f15ce3d3d3f5df0b8181443b5ba", cmp_path = "c5230cb439df9547294678d0f1c1465ad7989e5f", - comment = "7365bfe9fc6dc004cc97b8977aa8129999d81bf5", + comment = "22e71071d9473996563464fde19b108e5504f892", dapinstall = "24923c3819a450a772bb8f675926d530e829665f", dashboard_nvim = "d82ddae95fd4dc4c3b7bbe87f09b1840fbf20ecb", fixcursorhold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", friendly_snippets = "4f6bd8eb5fbe0e45d57e732783ead2c3a01f549c", - gitsigns = "4a2d30f5fb77750c7a42be9bb58a9cc2c6c7f31d", + gitsigns = "2fa3716bc4690da96d885becdf9988603f0756f0", lua_dev = "a0ee77789d9948adce64d98700cc90cecaef88d5", lualine = "9208bae98fd5d1ab6145868a8c48bfee53c1a499", - luasnip = "59576a5cf28556a393eedfe38467e998288fc905", - nlsp_settings = "3a3942b5d1da30e3ca0dc431aada3191c5952054", - null_ls = "59067dae4bf2367eb06326e419c23353722ecbec", + luasnip = "35322c97b041542f95c85e87a8215892ea4137d5", + nlsp_settings = "b4f48afb308e622adc8ea0f3aaff4c1e1344515a", + null_ls = "2ae4a5e2e2b35716c44c104ef1afa35ecb40c444", nvim_autopairs = "97e454ce9b1371373105716d196c1017394bc947", nvim_cmp = "d93104244c3834fbd8f3dd01da9729920e0b5fe7", nvim_dap = "c9a58267524f560112ecb6faa36ab2b5bc2f78a3", - nvim_lsp_installer = "88e44bbbe2e03523e08f2bd3c9a954675bc438f4", - nvim_lspconfig = "c51096481dc13193991571b7132740d762902355", + nvim_lsp_installer = "c2bde3911892a51323219f7cfc9bb50b49afd29f", + nvim_lspconfig = "e7df7ecae0b0d2f997ea65e951ddbe98ca3e154b", nvim_notify = "15f52efacd169ea26b0f4070451d3ea53f98cd5a", nvim_tree = "2dfed89af7724f9e71d2fdbe3cde791a93e9b9e0", - nvim_treesitter = "620cc936ad6b26c59bb2d888b3890bb8d06c50c7", + nvim_treesitter = "cc89dda2410f5aa9160f45a6acd4db0ee26fe632", nvim_ts_context_commentstring = "097df33c9ef5bbd3828105e4bee99965b758dc3f", nvim_web_devicons = "634e26818f2bea9161b7efa76735746838971824", packer = "7182f0ddbca2dd6f6723633a84d47f4d26518191", @@ -30,7 +30,7 @@ local commit = { popup = "b7404d35d5d3548a82149238289fa71f7f6de4ac", project = "cef52b8da07648b750d7f1e8fb93f12cb9482988", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", - telescope = "0011b1148d3975600f5a9f0be8058cdaac4e30d9", + telescope = "3a3c9a3c8ba3fb14121ef5c50a87173dcb969416", telescope_fzf_native = "b8662b076175e75e6497c59f3e2799b879d7b954", toggleterm = "d2ceb2ca3268d09db3033b133c0ee4642e07f059", which_key = "28d2bd129575b5e9ebddd88506601290bb2bb221", diff --git a/lua/lvim/utils/git.lua b/lua/lvim/utils/git.lua index c0a67bf0..8f25a2bb 100644 --- a/lua/lvim/utils/git.lua +++ b/lua/lvim/utils/git.lua @@ -89,7 +89,7 @@ end ---Get the current Lunarvim development branch ---@return string|nil function M.get_lvim_branch() - local ret, branch = git_cmd { args = { "branch", "--show-current" } } + local ret, branch = git_cmd { args = { "rev-parse", "--abbrev-ref", "HEAD" } } if ret ~= 0 or (not branch or branch[1] == "") then Log:error "Unable to retrieve the name of the current branch. Check the log for further information" return -- cgit v1.2.3 From ff9ae8fdc17d06527d7b8a638c551b0a13b734d7 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 30 Jan 2022 20:51:58 +0100 Subject: feat(vue): set volar as default language server instead of vuels (#2230) --- lua/lvim/lsp/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index 3d62461d..9ff58057 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -94,7 +94,7 @@ return { "stylelint_lsp", "tailwindcss", "tflint", - "volar", + "vuels", "zk", }, } -- cgit v1.2.3 From ab1255e10d2cee652195d7fa9081d80ce1db9875 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Wed, 2 Feb 2022 17:11:11 +0100 Subject: chore(plugins): update plugin version (#2236) --- lua/lvim/core/info.lua | 34 ++++++++++++++++++---------------- lua/lvim/plugins.lua | 26 +++++++++++++------------- 2 files changed, 31 insertions(+), 29 deletions(-) (limited to 'lua') diff --git a/lua/lvim/core/info.lua b/lua/lvim/core/info.lua index da295b95..34a5a7dd 100644 --- a/lua/lvim/core/info.lua +++ b/lua/lvim/core/info.lua @@ -161,22 +161,24 @@ function M.toggle_popup(ft) local content_provider = function(popup) local content = {} - for _, section in ipairs { - M.banner, - { "" }, - { "" }, - header, - { "" }, - lsp_info, - { "" }, - override_info, - { "" }, - formatters_info, - { "" }, - linters_info, - { "" }, - code_actions_info, - } do + for _, section in + ipairs { + M.banner, + { "" }, + { "" }, + header, + { "" }, + lsp_info, + { "" }, + override_info, + { "" }, + formatters_info, + { "" }, + linters_info, + { "" }, + code_actions_info, + } + do vim.list_extend(content, section) end diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index c4c2c61f..050bd00b 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -4,33 +4,33 @@ local commit = { cmp_luasnip = "d6f837f4e8fe48eeae288e638691b91b97d1737f", cmp_nvim_lsp = "ebdfc204afb87f15ce3d3d3f5df0b8181443b5ba", cmp_path = "c5230cb439df9547294678d0f1c1465ad7989e5f", - comment = "22e71071d9473996563464fde19b108e5504f892", + comment = "af51a8af6b213336345f36fc7aba65f9c3316696", dapinstall = "24923c3819a450a772bb8f675926d530e829665f", dashboard_nvim = "d82ddae95fd4dc4c3b7bbe87f09b1840fbf20ecb", fixcursorhold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", friendly_snippets = "4f6bd8eb5fbe0e45d57e732783ead2c3a01f549c", - gitsigns = "2fa3716bc4690da96d885becdf9988603f0756f0", + gitsigns = "0cba66ab9ef2316eea742dc9d17f1b7a5bf17f54", lua_dev = "a0ee77789d9948adce64d98700cc90cecaef88d5", - lualine = "9208bae98fd5d1ab6145868a8c48bfee53c1a499", + lualine = "0d0ea77e1a9a0f17e48b87b5931f292a6cf413dd", luasnip = "35322c97b041542f95c85e87a8215892ea4137d5", - nlsp_settings = "b4f48afb308e622adc8ea0f3aaff4c1e1344515a", + nlsp_settings = "35f8082ae5c14d621ae6e5b973ca148eaaf34c9f", null_ls = "2ae4a5e2e2b35716c44c104ef1afa35ecb40c444", nvim_autopairs = "97e454ce9b1371373105716d196c1017394bc947", - nvim_cmp = "d93104244c3834fbd8f3dd01da9729920e0b5fe7", + nvim_cmp = "124f1611f1b7cd9fb2892f0597881e007c99b652", nvim_dap = "c9a58267524f560112ecb6faa36ab2b5bc2f78a3", - nvim_lsp_installer = "c2bde3911892a51323219f7cfc9bb50b49afd29f", - nvim_lspconfig = "e7df7ecae0b0d2f997ea65e951ddbe98ca3e154b", - nvim_notify = "15f52efacd169ea26b0f4070451d3ea53f98cd5a", - nvim_tree = "2dfed89af7724f9e71d2fdbe3cde791a93e9b9e0", - nvim_treesitter = "cc89dda2410f5aa9160f45a6acd4db0ee26fe632", + nvim_lsp_installer = "31f05fef783ae439b4620a8f2937328b170ca0a0", + nvim_lspconfig = "531751ef03d77bf094f1fc07844b6c03ec4862bb", + nvim_notify = "83ebb5971eaecc0b2c70fb4ed540e87cbf50af6a", + nvim_tree = "99d65afd6ef05cc57f835451126e5c44db03cef1", + nvim_treesitter = "c2d25575264e17e868c316c773dcce3ebba2f3f8", nvim_ts_context_commentstring = "097df33c9ef5bbd3828105e4bee99965b758dc3f", - nvim_web_devicons = "634e26818f2bea9161b7efa76735746838971824", + nvim_web_devicons = "2f8439282575ce75784fb22d528dec7fd2e31a2e", packer = "7182f0ddbca2dd6f6723633a84d47f4d26518191", - plenary = "563d9f6d083f0514548f2ac4ad1888326d0a1c66", + plenary = "e86dc9b11241ff69ece50c15a5cdd49d20d4c27c", popup = "b7404d35d5d3548a82149238289fa71f7f6de4ac", project = "cef52b8da07648b750d7f1e8fb93f12cb9482988", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", - telescope = "3a3c9a3c8ba3fb14121ef5c50a87173dcb969416", + telescope = "f262e7d56d37625613c5de0df5a933cccacf13c5", telescope_fzf_native = "b8662b076175e75e6497c59f3e2799b879d7b954", toggleterm = "d2ceb2ca3268d09db3033b133c0ee4642e07f059", which_key = "28d2bd129575b5e9ebddd88506601290bb2bb221", -- cgit v1.2.3 From 1436d9090a31759e8ce1f7d184038230235a84da Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Thu, 3 Feb 2022 08:55:25 +0100 Subject: feat: use schemastore.nvim to provide extended json schema support (#2239) --- lua/lvim/lsp/providers/jsonls.lua | 186 ++------------------------------------ lua/lvim/plugins.lua | 7 ++ 2 files changed, 13 insertions(+), 180 deletions(-) (limited to 'lua') diff --git a/lua/lvim/lsp/providers/jsonls.lua b/lua/lvim/lsp/providers/jsonls.lua index 1fffa686..528c72a0 100644 --- a/lua/lvim/lsp/providers/jsonls.lua +++ b/lua/lvim/lsp/providers/jsonls.lua @@ -1,186 +1,12 @@ -local default_schemas = nil -local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls") -if status_ok then - default_schemas = jsonls_settings.get_default_schemas() -end - -local schemas = { - { - description = "TypeScript compiler configuration file", - fileMatch = { - "tsconfig.json", - "tsconfig.*.json", - }, - url = "https://json.schemastore.org/tsconfig.json", - }, - { - description = "Lerna config", - fileMatch = { "lerna.json" }, - url = "https://json.schemastore.org/lerna.json", - }, - { - description = "Babel configuration", - fileMatch = { - ".babelrc.json", - ".babelrc", - "babel.config.json", - }, - url = "https://json.schemastore.org/babelrc.json", - }, - { - description = "ESLint config", - fileMatch = { - ".eslintrc.json", - ".eslintrc", - }, - url = "https://json.schemastore.org/eslintrc.json", - }, - { - description = "Bucklescript config", - fileMatch = { "bsconfig.json" }, - url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json", - }, - { - description = "Prettier config", - fileMatch = { - ".prettierrc", - ".prettierrc.json", - "prettier.config.json", - }, - url = "https://json.schemastore.org/prettierrc", - }, - { - description = "Vercel Now config", - fileMatch = { "now.json" }, - url = "https://json.schemastore.org/now", - }, - { - description = "Stylelint config", - fileMatch = { - ".stylelintrc", - ".stylelintrc.json", - "stylelint.config.json", - }, - url = "https://json.schemastore.org/stylelintrc", - }, - { - description = "A JSON schema for the ASP.NET LaunchSettings.json files", - fileMatch = { "launchsettings.json" }, - url = "https://json.schemastore.org/launchsettings.json", - }, - { - description = "Schema for CMake Presets", - fileMatch = { - "CMakePresets.json", - "CMakeUserPresets.json", - }, - url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json", - }, - { - description = "Configuration file as an alternative for configuring your repository in the settings page.", - fileMatch = { - ".codeclimate.json", - }, - url = "https://json.schemastore.org/codeclimate.json", - }, - { - description = "LLVM compilation database", - fileMatch = { - "compile_commands.json", - }, - url = "https://json.schemastore.org/compile-commands.json", - }, - { - description = "Config file for Command Task Runner", - fileMatch = { - "commands.json", - }, - url = "https://json.schemastore.org/commands.json", - }, - { - description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.", - fileMatch = { - "*.cf.json", - "cloudformation.json", - }, - url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json", - }, - { - description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.", - fileMatch = { - "serverless.template", - "*.sam.json", - "sam.json", - }, - url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json", - }, - { - description = "Json schema for properties json file for a GitHub Workflow template", - fileMatch = { - ".github/workflow-templates/**.properties.json", - }, - url = "https://json.schemastore.org/github-workflow-template-properties.json", - }, - { - description = "golangci-lint configuration file", - fileMatch = { - ".golangci.toml", - ".golangci.json", - }, - url = "https://json.schemastore.org/golangci-lint.json", - }, - { - description = "JSON schema for the JSON Feed format", - fileMatch = { - "feed.json", - }, - url = "https://json.schemastore.org/feed.json", - versions = { - ["1"] = "https://json.schemastore.org/feed-1.json", - ["1.1"] = "https://json.schemastore.org/feed.json", - }, - }, - { - description = "Packer template JSON configuration", - fileMatch = { - "packer.json", - }, - url = "https://json.schemastore.org/packer.json", - }, - { - description = "NPM configuration file", - fileMatch = { - "package.json", - }, - url = "https://json.schemastore.org/package.json", - }, - { - description = "JSON schema for Visual Studio component configuration files", - fileMatch = { - "*.vsconfig", - }, - url = "https://json.schemastore.org/vsconfig.json", - }, - { - description = "Resume json", - fileMatch = { "resume.json" }, - url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", - }, -} - -local function extend(tab1, tab2) - for _, value in ipairs(tab2) do - table.insert(tab1, value) - end - return tab1 -end - -local extended_schemas = extend(schemas, default_schemas) - +local full_schemas = vim.tbl_deep_extend( + "force", + require("schemastore").json.schemas(), + require("nlspsettings.jsonls").get_default_schemas() +) local opts = { settings = { json = { - schemas = extended_schemas, + schemas = full_schemas, }, }, setup = { diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 050bd00b..b5cfab63 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -29,6 +29,7 @@ local commit = { plenary = "e86dc9b11241ff69ece50c15a5cdd49d20d4c27c", popup = "b7404d35d5d3548a82149238289fa71f7f6de4ac", project = "cef52b8da07648b750d7f1e8fb93f12cb9482988", + schemastore = "058575f0bd94b115604bef9c4c48c5d02e21ffef", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", telescope = "f262e7d56d37625613c5de0df5a933cccacf13c5", telescope_fzf_native = "b8662b076175e75e6497c59f3e2799b879d7b954", @@ -272,4 +273,10 @@ return { end, disable = not lvim.builtin.terminal.active, }, + + -- SchemaStore + { + "b0o/schemastore.nvim", + commit = commit.schemastore, + }, } -- cgit v1.2.3 From 68e841f5493a8a2ded29e13e16bb6f9fc41c59b5 Mon Sep 17 00:00:00 2001 From: Xavier Young <45989017+younger-1@users.noreply.github.com> Date: Fri, 4 Feb 2022 16:42:11 +0800 Subject: fix(lualine): add space to diff components (#1897) --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index b1387afa..c91c8ca2 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -35,7 +35,7 @@ return { diff = { "diff", source = diff_source, - symbols = { added = "  ", modified = "柳", removed = " " }, + symbols = { added = "  ", modified = "柳 ", removed = " " }, diff_color = { added = { fg = colors.green }, modified = { fg = colors.yellow }, -- cgit v1.2.3 From 4378a775f1e9c568d51352776daba263d75bd7c9 Mon Sep 17 00:00:00 2001 From: Jieru Mei Date: Fri, 4 Feb 2022 03:43:36 -0500 Subject: fix(lualine): compacter size for treesitter icon (#2247) --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index c91c8ca2..36441656 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -74,7 +74,7 @@ return { function() local b = vim.api.nvim_get_current_buf() if next(vim.treesitter.highlighter.active[b]) then - return "  " + return "" end return "" end, -- cgit v1.2.3 From f7cae318e606c3683c532403a87c5fb19b3cea42 Mon Sep 17 00:00:00 2001 From: Jieru Mei Date: Fri, 4 Feb 2022 10:55:11 -0500 Subject: fix(lualine): use 1-char width symbol for changed (#2246) --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 36441656..b97f946e 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -35,7 +35,7 @@ return { diff = { "diff", source = diff_source, - symbols = { added = "  ", modified = "柳 ", removed = " " }, + symbols = { added = "  ", modified = " ", removed = " " }, diff_color = { added = { fg = colors.green }, modified = { fg = colors.yellow }, -- cgit v1.2.3 From 9eb8479b39117783602b1c7a1f1e062b55744c92 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 6 Feb 2022 11:10:03 +0100 Subject: chore(plugins): bump version (#2253) --- lua/lvim/lsp/config.lua | 2 ++ lua/lvim/plugins.lua | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'lua') diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index 9ff58057..c2aad074 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -84,6 +84,7 @@ return { "quick_lint_js", "remark_ls", "rome", + "scry", "solang", "solidity_ls", "sorbet", @@ -95,6 +96,7 @@ return { "tailwindcss", "tflint", "vuels", + "zeta_note", "zk", }, } diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index b5cfab63..e897af08 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -3,29 +3,29 @@ local commit = { cmp_buffer = "f83773e2f433a923997c5faad7ea689ec24d1785", cmp_luasnip = "d6f837f4e8fe48eeae288e638691b91b97d1737f", cmp_nvim_lsp = "ebdfc204afb87f15ce3d3d3f5df0b8181443b5ba", - cmp_path = "c5230cb439df9547294678d0f1c1465ad7989e5f", + cmp_path = "466b6b8270f7ba89abd59f402c73f63c7331ff6e", comment = "af51a8af6b213336345f36fc7aba65f9c3316696", dapinstall = "24923c3819a450a772bb8f675926d530e829665f", dashboard_nvim = "d82ddae95fd4dc4c3b7bbe87f09b1840fbf20ecb", fixcursorhold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", - friendly_snippets = "4f6bd8eb5fbe0e45d57e732783ead2c3a01f549c", - gitsigns = "0cba66ab9ef2316eea742dc9d17f1b7a5bf17f54", + friendly_snippets = "2e575549910571ff5abb6b02178c69ad760a4e00", + gitsigns = "672482df3e80e4e30587c54d4c5e3a7f729ce039", lua_dev = "a0ee77789d9948adce64d98700cc90cecaef88d5", - lualine = "0d0ea77e1a9a0f17e48b87b5931f292a6cf413dd", - luasnip = "35322c97b041542f95c85e87a8215892ea4137d5", + lualine = "dc20cbd0a99ff1345a8186ada1fb5fb2ca3e3fdf", + luasnip = "35397b9d1466d80e3b6460256595c20010b89823", nlsp_settings = "35f8082ae5c14d621ae6e5b973ca148eaaf34c9f", - null_ls = "2ae4a5e2e2b35716c44c104ef1afa35ecb40c444", + null_ls = "e8a666829a3d803844f24daa4932e4f5fe76cbeb", nvim_autopairs = "97e454ce9b1371373105716d196c1017394bc947", - nvim_cmp = "124f1611f1b7cd9fb2892f0597881e007c99b652", - nvim_dap = "c9a58267524f560112ecb6faa36ab2b5bc2f78a3", - nvim_lsp_installer = "31f05fef783ae439b4620a8f2937328b170ca0a0", - nvim_lspconfig = "531751ef03d77bf094f1fc07844b6c03ec4862bb", - nvim_notify = "83ebb5971eaecc0b2c70fb4ed540e87cbf50af6a", - nvim_tree = "99d65afd6ef05cc57f835451126e5c44db03cef1", - nvim_treesitter = "c2d25575264e17e868c316c773dcce3ebba2f3f8", + nvim_cmp = "a7fea2ca9f29869c75c3e2ccb683e7740868ba8b", + nvim_dap = "ee39d5d570d07161e16eb73054c295c6561eb2b4", + nvim_lsp_installer = "15adb5d1b6455f1590790a737c183699424abd83", + nvim_lspconfig = "2008c5cebf2b84c5e5f8a566480b022ab2e7ebab", + nvim_notify = "2edf33d0eb3c358716d4474d6081d361c80f7aa3", + nvim_tree = "7b64075bdf66fc31660f35fa67ba71611121ac1d", + nvim_treesitter = "194aaf7159ae929d51b45b59fecf2628f1847c69", nvim_ts_context_commentstring = "097df33c9ef5bbd3828105e4bee99965b758dc3f", nvim_web_devicons = "2f8439282575ce75784fb22d528dec7fd2e31a2e", - packer = "7182f0ddbca2dd6f6723633a84d47f4d26518191", + packer = "e5c8c01374350b4fcfd56da2afc87434c51b3972", plenary = "e86dc9b11241ff69ece50c15a5cdd49d20d4c27c", popup = "b7404d35d5d3548a82149238289fa71f7f6de4ac", project = "cef52b8da07648b750d7f1e8fb93f12cb9482988", -- cgit v1.2.3 From 24537be03e3b7668e565fc652f8a0bfdea715652 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Mon, 7 Feb 2022 18:22:30 +0100 Subject: feat: use bufferline instead of barbar (#2254) --- lua/lvim/core/bufferline.lua | 121 +++++++++++++++++++++++++++++++++++++++++++ lua/lvim/core/which-key.lua | 20 +++---- lua/lvim/keymappings.lua | 4 +- lua/lvim/plugins.lua | 6 +-- 4 files changed, 136 insertions(+), 15 deletions(-) (limited to 'lua') diff --git a/lua/lvim/core/bufferline.lua b/lua/lvim/core/bufferline.lua index 4f7493d6..06de3ac4 100644 --- a/lua/lvim/core/bufferline.lua +++ b/lua/lvim/core/bufferline.lua @@ -1,5 +1,38 @@ local M = {} +local function is_ft(b, ft) + return vim.bo[b].filetype == ft +end + +local function diagnostics_indicator(_, _, diagnostics) + local result = {} + local symbols = { error = "", warning = "", info = "" } + for name, count in pairs(diagnostics) do + if symbols[name] and count > 0 then + table.insert(result, symbols[name] .. count) + end + end + result = table.concat(result, " ") + return #result > 0 and result or "" +end + +local function custom_filter(buf, buf_nums) + local logs = vim.tbl_filter(function(b) + return is_ft(b, "log") + end, buf_nums) + if vim.tbl_isempty(logs) then + return true + end + local tab_num = vim.fn.tabpagenr() + local last_tab = vim.fn.tabpagenr "$" + local is_log = is_ft(buf, "log") + if last_tab == 1 then + return true + end + -- only show log buffers in secondary tabs + return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log) +end + M.config = function() lvim.builtin.bufferline = { active = true, @@ -7,11 +40,99 @@ M.config = function() keymap = { normal_mode = {}, }, + highlights = { + background = { + gui = "italic", + }, + buffer_selected = { + gui = "bold", + }, + }, + options = { + numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function + close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" + right_mouse_command = "vert sbuffer %d", -- can be a string | function, see "Mouse actions" + left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" + middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" + -- NOTE: this plugin is designed with this icon in mind, + -- and so changing this is NOT recommended, this is intended + -- as an escape hatch for people who cannot bear it for whatever reason + indicator_icon = "▎", + buffer_close_icon = "", + modified_icon = "●", + close_icon = "", + left_trunc_marker = "", + right_trunc_marker = "", + --- name_formatter can be used to change the buffer's label in the bufferline. + --- Please note some names can/will break the + --- bufferline so use this at your discretion knowing that it has + --- some limitations that will *NOT* be fixed. + name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" + -- remove extension from markdown files for example + if buf.name:match "%.md" then + return vim.fn.fnamemodify(buf.name, ":t:r") + end + end, + max_name_length = 18, + max_prefix_length = 15, -- prefix used when a buffer is de-duplicated + tab_size = 18, + diagnostics = "nvim_lsp", + diagnostics_update_in_insert = false, + diagnostics_indicator = diagnostics_indicator, + -- NOTE: this will be called a lot so don't do any heavy processing here + custom_filter = custom_filter, + offsets = { + { + filetype = "undotree", + text = "Undotree", + highlight = "PanelHeading", + padding = 1, + }, + { + filetype = "NvimTree", + text = "Explorer", + highlight = "PanelHeading", + padding = 1, + }, + { + filetype = "DiffviewFiles", + text = "Diff View", + highlight = "PanelHeading", + padding = 1, + }, + { + filetype = "flutterToolsOutline", + text = "Flutter Outline", + highlight = "PanelHeading", + }, + { + filetype = "packer", + text = "Packer", + highlight = "PanelHeading", + padding = 1, + }, + }, + show_buffer_icons = true, -- disable filetype icons for buffers + show_buffer_close_icons = true, + show_close_icon = false, + show_tab_indicators = true, + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + -- can also be a table containing 2 custom separators + -- [focused and unfocused]. eg: { '|', '|' } + separator_style = "thin", + enforce_regular_tabs = false, + always_show_bufferline = false, + sort_by = "id", + }, } end M.setup = function() require("lvim.keymappings").load(lvim.builtin.bufferline.keymap) + require("bufferline").setup { + options = lvim.builtin.bufferline.options, + highlights = lvim.builtin.bufferline.highlights, + } if lvim.builtin.bufferline.on_config_done then lvim.builtin.bufferline.on_config_done() diff --git a/lua/lvim/core/which-key.lua b/lua/lvim/core/which-key.lua index 8691a9a6..194cb314 100644 --- a/lua/lvim/core/which-key.lua +++ b/lua/lvim/core/which-key.lua @@ -67,30 +67,30 @@ M.config = function() ["w"] = { "w!", "Save" }, ["q"] = { "q!", "Quit" }, ["/"] = { "lua require('Comment.api').toggle_current_linewise()", "Comment" }, - ["c"] = { "BufferClose!", "Close Buffer" }, + ["c"] = { "bdelete!", "Close Buffer" }, ["f"] = { require("lvim.core.telescope.custom-finders").find_project_files, "Find File" }, ["h"] = { "nohlsearch", "No Highlight" }, b = { name = "Buffers", - j = { "BufferPick", "Jump" }, + j = { "BufferLinePick", "Jump" }, f = { "Telescope buffers", "Find" }, - b = { "b#", "Previous" }, - w = { "BufferWipeout", "Wipeout" }, + b = { "BufferLineCyclePrev", "Previous" }, + -- w = { "BufferWipeout", "Wipeout" }, -- TODO: implement this for bufferline e = { - "BufferCloseAllButCurrent", - "Close all but current", + "BufferLinePickClose", + "Pick which buffer to close", }, - h = { "BufferCloseBuffersLeft", "Close all to the left" }, + h = { "BufferLineCloseLeft", "Close all to the left" }, l = { - "BufferCloseBuffersRight", + "BufferLineCloseRight", "Close all to the right", }, D = { - "BufferOrderByDirectory", + "BufferLineSortByDirectory", "Sort by directory", }, L = { - "BufferOrderByLanguage", + "BufferLineSortByExtension", "Sort by language", }, }, diff --git a/lua/lvim/keymappings.lua b/lua/lvim/keymappings.lua index d0763ca1..19f638e4 100644 --- a/lua/lvim/keymappings.lua +++ b/lua/lvim/keymappings.lua @@ -56,8 +56,8 @@ local defaults = { [""] = ":vertical resize +2", -- Tab switch buffer - [""] = ":BufferNext", - [""] = ":BufferPrevious", + [""] = ":BufferLineCycleNext", + [""] = ":BufferLineCyclePrev", -- Move current line / block with Alt-j/k a la vscode. [""] = ":m .+1==", diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index e897af08..5a5932bb 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -1,5 +1,5 @@ local commit = { - barbar = "6e638309efcad2f308eb9c5eaccf6f62b794bbab", + bufferline = "7451dfc97d28e6783dbeb1cdcff12619a9323c98", cmp_buffer = "f83773e2f433a923997c5faad7ea689ec24d1785", cmp_luasnip = "d6f837f4e8fe48eeae288e638691b91b97d1737f", cmp_nvim_lsp = "ebdfc204afb87f15ce3d3d3f5df0b8181443b5ba", @@ -224,8 +224,8 @@ return { }, { - "romgrk/barbar.nvim", - commit = commit.barbar, + "akinsho/bufferline.nvim", + commit = commit.bufferline, config = function() require("lvim.core.bufferline").setup() end, -- cgit v1.2.3 From de3909fac935c215ddeaf8fb0da14bc155aa5f7e Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Wed, 9 Feb 2022 14:20:47 +0330 Subject: chore(plugins): bump version (#2261) --- lua/lvim/lsp/config.lua | 1 + lua/lvim/plugins.lua | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'lua') diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index c2aad074..26b1b489 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -95,6 +95,7 @@ return { "stylelint_lsp", "tailwindcss", "tflint", + "verible", "vuels", "zeta_note", "zk", diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 5a5932bb..dbf0e978 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -9,27 +9,27 @@ local commit = { dashboard_nvim = "d82ddae95fd4dc4c3b7bbe87f09b1840fbf20ecb", fixcursorhold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", friendly_snippets = "2e575549910571ff5abb6b02178c69ad760a4e00", - gitsigns = "672482df3e80e4e30587c54d4c5e3a7f729ce039", + gitsigns = "e2b2730254df7648c79794555978f10fceb4b163", lua_dev = "a0ee77789d9948adce64d98700cc90cecaef88d5", - lualine = "dc20cbd0a99ff1345a8186ada1fb5fb2ca3e3fdf", - luasnip = "35397b9d1466d80e3b6460256595c20010b89823", + lualine = "98dc2dd3a2a07c251bcbd43048157aa56f901402", + luasnip = "5a6a1503fc6b005737fc823e1cb90ce86249c2a0", nlsp_settings = "35f8082ae5c14d621ae6e5b973ca148eaaf34c9f", - null_ls = "e8a666829a3d803844f24daa4932e4f5fe76cbeb", + null_ls = "b1dbbc3807fcb82d6f562145debe6321610bef98", nvim_autopairs = "97e454ce9b1371373105716d196c1017394bc947", nvim_cmp = "a7fea2ca9f29869c75c3e2ccb683e7740868ba8b", nvim_dap = "ee39d5d570d07161e16eb73054c295c6561eb2b4", - nvim_lsp_installer = "15adb5d1b6455f1590790a737c183699424abd83", + nvim_lsp_installer = "8c32ee62b8a08f3a3d66d87a83b59bb37d57a388", nvim_lspconfig = "2008c5cebf2b84c5e5f8a566480b022ab2e7ebab", nvim_notify = "2edf33d0eb3c358716d4474d6081d361c80f7aa3", - nvim_tree = "7b64075bdf66fc31660f35fa67ba71611121ac1d", - nvim_treesitter = "194aaf7159ae929d51b45b59fecf2628f1847c69", + nvim_tree = "7a19c3e747f8953ed50c2f97a7d070f7a86190e8", + nvim_treesitter = "b1ef4033222fa86cbe5c6a0abf70098f157546d4", nvim_ts_context_commentstring = "097df33c9ef5bbd3828105e4bee99965b758dc3f", - nvim_web_devicons = "2f8439282575ce75784fb22d528dec7fd2e31a2e", + nvim_web_devicons = "e3294f687626b40754bb40ac2d636d166098b2fb", packer = "e5c8c01374350b4fcfd56da2afc87434c51b3972", plenary = "e86dc9b11241ff69ece50c15a5cdd49d20d4c27c", popup = "b7404d35d5d3548a82149238289fa71f7f6de4ac", project = "cef52b8da07648b750d7f1e8fb93f12cb9482988", - schemastore = "058575f0bd94b115604bef9c4c48c5d02e21ffef", + schemastore = "a678baca09b8458b4c8695c259c88a0d8eb8acb9", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", telescope = "f262e7d56d37625613c5de0df5a933cccacf13c5", telescope_fzf_native = "b8662b076175e75e6497c59f3e2799b879d7b954", -- cgit v1.2.3 From 564798b83e40e622fb5c1b6f3803b80f42d092ec Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Fri, 11 Feb 2022 16:41:30 +0100 Subject: refactor(nvim-tree): remove unused code (#2266) --- lua/lvim/core/nvimtree.lua | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'lua') diff --git a/lua/lvim/core/nvimtree.lua b/lua/lvim/core/nvimtree.lua index 287791b8..17b8f36a 100644 --- a/lua/lvim/core/nvimtree.lua +++ b/lua/lvim/core/nvimtree.lua @@ -136,34 +136,6 @@ function M.setup() } end - local function on_open() - if package.loaded["bufferline.state"] and lvim.builtin.nvimtree.setup.view.side == "left" then - require("bufferline.state").set_offset(lvim.builtin.nvimtree.setup.view.width + 1, "") - end - end - - local function on_close() - local bufnr = vim.api.nvim_get_current_buf() - local ft = vim.api.nvim_buf_get_option(bufnr, "filetype") - if ft == "NvimTree" and package.loaded["bufferline.state"] then - require("bufferline.state").set_offset(0) - end - end - - local tree_view = require "nvim-tree.view" - local default_open = tree_view.open - local default_close = tree_view.close - - tree_view.open = function() - on_open() - default_open() - end - - tree_view.close = function() - on_close() - default_close() - end - if lvim.builtin.nvimtree.on_config_done then lvim.builtin.nvimtree.on_config_done(nvim_tree_config) end -- cgit v1.2.3