Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc24b68260 | |||
b75ed594a9 | |||
4f2bb725be | |||
2f0bfbbad8 | |||
01a6085b2b | |||
2b5ae7b63c | |||
dc40f02f35 | |||
4b367952f6 | |||
7c9abd7463 | |||
868ccedff2 | |||
29632c6b29 | |||
5b7ae96c5d | |||
e9fb81e94d | |||
b172f47f27 | |||
9cfe88c7ba | |||
163a4f9275 | |||
076b2e432e | |||
5bf45e3139 | |||
eba510ec69 | |||
39fa63646d | |||
e975f021ea | |||
bf66e71adc | |||
cd96e3d9e5 | |||
5559228300 | |||
3dcc074693 | |||
58c3842faa | |||
89db0157b1 | |||
7443effe26 |
61
CHANGELOG.md
61
CHANGELOG.md
@ -1,5 +1,66 @@
|
||||
# Changelog
|
||||
|
||||
## [3.7.1](https://github.com/LazyVim/LazyVim/compare/v3.7.0...v3.7.1) (2023-05-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mini.comment:** removed dirty upvalues hack for mini.comments. no longer needed ([b75ed59](https://github.com/LazyVim/LazyVim/commit/b75ed594a932e6e01d8c1ee5b23215221164d494))
|
||||
|
||||
## [3.7.0](https://github.com/LazyVim/LazyVim/compare/v3.6.2...v3.7.0) (2023-05-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **go:** add workaround to get semantic token highlighting ([#815](https://github.com/LazyVim/LazyVim/issues/815)) ([2b5ae7b](https://github.com/LazyVim/LazyVim/commit/2b5ae7b63c8233bbb11a922c852b8adeacd94b86))
|
||||
|
||||
## [3.6.2](https://github.com/LazyVim/LazyVim/compare/v3.6.1...v3.6.2) (2023-05-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **tailwind:** nil check on filetypes_exclude. See [#816](https://github.com/LazyVim/LazyVim/issues/816) ([4b36795](https://github.com/LazyVim/LazyVim/commit/4b367952f6214e1ae213eba2ae706df691ff57fa))
|
||||
* **vscode:** only remap keybinds when running in vscode ([7c9abd7](https://github.com/LazyVim/LazyVim/commit/7c9abd7463a27b7a7fd8a0c7e59653a7602613b6))
|
||||
|
||||
## [3.6.1](https://github.com/LazyVim/LazyVim/compare/v3.6.0...v3.6.1) (2023-05-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **go:** actually set semantic tokens ([#811](https://github.com/LazyVim/LazyVim/issues/811)) ([29632c6](https://github.com/LazyVim/LazyVim/commit/29632c6b294465e5abc6472fffc866ec1841e37a))
|
||||
|
||||
## [3.6.0](https://github.com/LazyVim/LazyVim/compare/v3.5.0...v3.6.0) (2023-05-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **go:** add go lang extras ([#795](https://github.com/LazyVim/LazyVim/issues/795)) ([163a4f9](https://github.com/LazyVim/LazyVim/commit/163a4f927514ad6ea1aa06db2ad754fb954d87f5))
|
||||
* **typescript:** added dap config for typescript. Will only be enabled when dap is also enabled ([e9fb81e](https://github.com/LazyVim/LazyVim/commit/e9fb81e94d7f461b63994e3111d5c17fc84dec80))
|
||||
* **vscode:** add `vscode=true` to any plugin spec you want to activate in vscode ([39fa636](https://github.com/LazyVim/LazyVim/commit/39fa63646d14665861558c4ee7704ef51eb1b7f6))
|
||||
* **vscode:** better vscode support ([5bf45e3](https://github.com/LazyVim/LazyVim/commit/5bf45e3139aa3a8cf8e1bf9fd2a2d422fe1c6cf7))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **go:** extend mason ensure_installed ([b172f47](https://github.com/LazyVim/LazyVim/commit/b172f47f278df105bbbf60b5c0e411fda01c1819))
|
||||
* **neotest:** pass opts to neotest ([bf66e71](https://github.com/LazyVim/LazyVim/commit/bf66e71adcf0346a3d6edd92a14e0fcd350f5b26))
|
||||
* remove debug notify ([#808](https://github.com/LazyVim/LazyVim/issues/808)) ([9cfe88c](https://github.com/LazyVim/LazyVim/commit/9cfe88c7ba1ff2b36a0cc32e96d5be1d6e5ee833))
|
||||
* **vscode:** added ts-context-commentstring ([e975f02](https://github.com/LazyVim/LazyVim/commit/e975f021eaf1eb33fb8793c8e922ab11a8b682f2))
|
||||
* **vscode:** properly cleanup disabled deps ([eba510e](https://github.com/LazyVim/LazyVim/commit/eba510ec6934a22f3654a83ed89216bb96e7374c))
|
||||
|
||||
## [3.5.0](https://github.com/LazyVim/LazyVim/compare/v3.4.0...v3.5.0) (2023-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **mini.comment:** added ts-context-commentstring back and made it work with mini.comment ([89db015](https://github.com/LazyVim/LazyVim/commit/89db0157b1621deffc83a4e00cb2be13e2827a5d))
|
||||
* **test:** added easy way to configure adapters ([7443eff](https://github.com/LazyVim/LazyVim/commit/7443effe269ad3b2d491f43439b48f1d072c9210))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **vscode:** support older Neovim versions. Fixes [#798](https://github.com/LazyVim/LazyVim/issues/798) ([3dcc074](https://github.com/LazyVim/LazyVim/commit/3dcc074693c3560982d6e500aa073140a9c5c0ed))
|
||||
|
||||
## [3.4.0](https://github.com/LazyVim/LazyVim/compare/v3.3.0...v3.4.0) (2023-05-22)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 May 22
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 May 25
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -161,6 +161,8 @@ function M.load(name)
|
||||
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
|
||||
vim.cmd([[do VimResized]])
|
||||
end
|
||||
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false })
|
||||
end
|
||||
|
||||
M.did_init = false
|
||||
|
@ -1,5 +1,4 @@
|
||||
-- This file is automatically loaded by lazyvim.config.init
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
@ -9,6 +8,9 @@ local function map(mode, lhs, rhs, opts)
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
if opts.remap and not vim.g.vscode then
|
||||
opts.remap = nil
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
end
|
||||
@ -18,10 +20,10 @@ map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
|
||||
@ -129,12 +131,12 @@ map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd
|
||||
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||
|
||||
-- windows
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other window" })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window" })
|
||||
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below" })
|
||||
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right" })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below" })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right" })
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
|
||||
-- tabs
|
||||
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
||||
|
@ -131,10 +131,17 @@ return {
|
||||
},
|
||||
|
||||
-- comments
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring", lazy = true },
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- better text-objects
|
||||
|
77
lua/lazyvim/plugins/extras/lang/go.lua
Normal file
77
lua/lazyvim/plugins/extras/lang/go.lua
Normal file
@ -0,0 +1,77 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
semanticTokens = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
gopls = function()
|
||||
-- workaround for gopls not supporting semantictokensprovider
|
||||
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
||||
require("lazyvim.util").on_attach(function(client, _)
|
||||
if client.name == "gopls" then
|
||||
if not client.server_capabilities.semanticTokensProvider then
|
||||
local semantic = client.config.capabilities.textDocument.semanticTokens
|
||||
client.server_capabilities.semanticTokensProvider = {
|
||||
full = true,
|
||||
legend = {
|
||||
tokenTypes = semantic.tokenTypes,
|
||||
tokenModifiers = semantic.tokenModifiers,
|
||||
},
|
||||
range = true,
|
||||
}
|
||||
end
|
||||
end
|
||||
end)
|
||||
-- end workaround
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "delve")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"nvim-neotest/neotest-go",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-go"] = {
|
||||
-- Here we can set options for neotest-go, e.g.
|
||||
-- args = { "-tags=integration" }
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -12,7 +12,7 @@ return {
|
||||
local tw = require("lspconfig.server_configurations.tailwindcss")
|
||||
--- @param ft string
|
||||
opts.filetypes = vim.tbl_filter(function(ft)
|
||||
return not vim.tbl_contains(opts.filetypes_exclude, ft)
|
||||
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
||||
end, tw.default_config.filetypes)
|
||||
end,
|
||||
},
|
||||
|
@ -62,4 +62,56 @@ return {
|
||||
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "js-debug-adapter")
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
if not dap.adapters["pwa-node"] then
|
||||
require("dap").adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "node",
|
||||
-- 💀 Make sure to update this path to point to your installation
|
||||
args = {
|
||||
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
|
||||
.. "/js-debug/src/dapDebugServer.js",
|
||||
"${port}",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
for _, language in ipairs({ "typescript", "javascript" }) do
|
||||
if not dap.configurations[language] then
|
||||
dap.configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -10,6 +10,18 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
opts = {
|
||||
-- Can be a list of adapters like what neotest expects,
|
||||
-- or a table of adapter names, mapped to adapter configs.
|
||||
-- The adapter will then be automatically loaded with the config.
|
||||
adapters = {},
|
||||
-- Example for loading neotest-go with a custom config
|
||||
-- adapters = {
|
||||
-- ["neotest-go"] = {
|
||||
-- args = { "-tags=integration" },
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
@ -22,6 +34,22 @@ return {
|
||||
},
|
||||
}, neotest_ns)
|
||||
|
||||
if opts.adapters then
|
||||
local adapters = {}
|
||||
for name, config in pairs(opts.adapters or {}) do
|
||||
if type(name) == "number" then
|
||||
adapters[#adapters + 1] = config
|
||||
elseif config ~= false then
|
||||
local adapter = require(name)
|
||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
||||
adapter = adapter(config)
|
||||
end
|
||||
adapters[#adapters + 1] = adapter
|
||||
end
|
||||
end
|
||||
opts.adapters = adapters
|
||||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
|
@ -12,7 +12,9 @@ local enabled = {
|
||||
"mini.surround",
|
||||
"nvim-treesitter",
|
||||
"nvim-treesitter-textobjects",
|
||||
"nvim-ts-context-commentstring",
|
||||
"vim-repeat",
|
||||
"LazyVim",
|
||||
}
|
||||
|
||||
local Config = require("lazy.core.config")
|
||||
@ -20,35 +22,44 @@ local Plugin = require("lazy.core.plugin")
|
||||
Config.options.checker.enabled = false
|
||||
Config.options.change_detection.enabled = false
|
||||
|
||||
local update_state = Plugin.update_state
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
Plugin.update_state = function()
|
||||
-- Config.spec.disabled = {}
|
||||
for name, plugin in pairs(Config.plugins) do
|
||||
if not vim.list_contains(enabled, plugin.name) then
|
||||
Config.plugins[name] = nil
|
||||
-- HACK: disable all plugins except the ones we want
|
||||
local fix_disabled = Plugin.Spec.fix_disabled
|
||||
function Plugin.Spec.fix_disabled(self)
|
||||
for _, plugin in pairs(self.plugins) do
|
||||
if not (vim.tbl_contains(enabled, plugin.name) or plugin.vscode) then
|
||||
plugin.enabled = false
|
||||
end
|
||||
end
|
||||
fix_disabled(self)
|
||||
end
|
||||
|
||||
-- HACK: don't clean plugins in vscode
|
||||
local update_state = Plugin.update_state
|
||||
function Plugin.update_state()
|
||||
update_state()
|
||||
Config.to_clean = {}
|
||||
end
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
map("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
map("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
|
||||
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
|
||||
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
-- Add some vscode specific keymaps
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimKeymaps",
|
||||
callback = function()
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
vim.keymap.set("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
config = function(_, opts)
|
||||
opts = opts or {}
|
||||
-- disable the colorscheme
|
||||
opts.colorscheme = function() end
|
||||
require("lazyvim").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { highlight = { enable = false } },
|
||||
|
@ -151,8 +151,7 @@ return {
|
||||
end
|
||||
|
||||
if have_mason then
|
||||
mlsp.setup({ ensure_installed = ensure_installed })
|
||||
mlsp.setup_handlers({ setup })
|
||||
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
|
||||
end
|
||||
|
||||
if Util.lsp_get_config("denols") and Util.lsp_get_config("tsserver") then
|
||||
|
@ -27,6 +27,20 @@ function M.fg(name)
|
||||
return fg and { fg = string.format("#%06x", fg) }
|
||||
end
|
||||
|
||||
function M.get_upvalue(func, name)
|
||||
local i = 1
|
||||
while true do
|
||||
local n, v = debug.getupvalue(func, i)
|
||||
if not n then
|
||||
break
|
||||
end
|
||||
if n == name then
|
||||
return v
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
---@param fn fun()
|
||||
function M.on_very_lazy(fn)
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
|
Reference in New Issue
Block a user