mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 10:35:08 +02:00
Merge branch 'rolling'
This commit is contained in:
commit
6fbefdacd3
22 changed files with 263 additions and 182 deletions
|
@ -33,7 +33,7 @@ body:
|
|||
- type: input
|
||||
id: nvim-version
|
||||
attributes:
|
||||
label: Neovim version (>= 0.7)
|
||||
label: Neovim version (>= 0.7.2)
|
||||
description: "Output of `nvim --version`"
|
||||
placeholder: |
|
||||
NVIM v0.8.0-dev+199-g2875d45e7
|
||||
|
|
33
.github/workflows/install.yaml
vendored
33
.github/workflows/install.yaml
vendored
|
@ -6,6 +6,7 @@ on:
|
|||
- "master"
|
||||
- "rolling"
|
||||
paths:
|
||||
- '.github/workflows/**'
|
||||
- 'lua/**'
|
||||
- 'snapshots/**'
|
||||
- 'tests/**'
|
||||
|
@ -13,33 +14,53 @@ on:
|
|||
|
||||
jobs:
|
||||
unixish:
|
||||
name: ${{ matrix.os }} ${{ matrix.runner }}
|
||||
name: ${{ matrix.os }} ${{ matrix.runner }} (${{ matrix.neovim }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-20.04
|
||||
- runner: ubuntu-latest
|
||||
os: linux
|
||||
- runner: macos-10.15
|
||||
neovim: v0.7.0
|
||||
- runner: macos-latest
|
||||
os: osx
|
||||
neovim: v0.7.0
|
||||
- runner: ubuntu-22.04
|
||||
os: linux
|
||||
neovim: nightly
|
||||
- runner: macos-12
|
||||
os: osx
|
||||
neovim: nightly
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install neovim binary
|
||||
- name: Install neovim binary from release
|
||||
env:
|
||||
RELEASE_VER: ${{ matrix.neovim }}
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
bash ./utils/installer/install-neovim-from-release
|
||||
|
||||
- name: Install LunarVim
|
||||
timeout-minutes: 4
|
||||
env:
|
||||
LV_BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
LV_REMOTE: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
||||
LUNARVIM_LOG_LEVEL: "debug"
|
||||
run: |
|
||||
./utils/installer/install.sh --local --no-install-dependencies
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
installer_url="https://raw.githubusercontent.com/${LV_REMOTE}/${LV_BRANCH}/utils/installer/install.sh"
|
||||
curl -LSsO "$installer_url"
|
||||
bash ./install.sh --no-install-dependencies
|
||||
|
||||
- name: Run unit-tests
|
||||
# NOTE: make sure to adjust the timeout if you start adding a lot of tests
|
||||
timeout-minutes: 4
|
||||
run: make test
|
||||
run: |
|
||||
nvim --version
|
||||
make test
|
||||
|
||||
windows:
|
||||
name: "windows-latest"
|
||||
|
|
|
@ -8,7 +8,7 @@ return {
|
|||
---@usage timeout number timeout in ms for the format request (Default: 1000)
|
||||
timeout = 1000,
|
||||
---@usage filter func to select client
|
||||
filter = require("lvim.lsp.handlers").format_filter,
|
||||
filter = require("lvim.lsp.utils").format_filter,
|
||||
},
|
||||
keys = {},
|
||||
|
||||
|
|
|
@ -65,6 +65,12 @@ M.defaults = {
|
|||
print(require("lvim.utils.git").get_lvim_version())
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "LvimOpenlog",
|
||||
fn = function()
|
||||
vim.fn.execute("edit " .. require("lvim.core.log").get_path())
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function M.load(collection)
|
||||
|
|
|
@ -26,9 +26,12 @@ function M.config()
|
|||
---operator-pending mapping
|
||||
---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}`
|
||||
basic = true,
|
||||
---extended mapping
|
||||
---Extra mapping
|
||||
---Includes `gco`, `gcO`, `gcA`
|
||||
extra = true,
|
||||
---Extended mapping
|
||||
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
|
||||
extra = false,
|
||||
extended = false,
|
||||
},
|
||||
|
||||
---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
|
||||
|
|
|
@ -12,17 +12,27 @@ vim.tbl_add_reverse_lookup(Log.levels)
|
|||
local notify_opts = {}
|
||||
|
||||
function Log:set_level(level)
|
||||
-- package.loaded["lvim.core.log"] = nil
|
||||
local log_level = Log.levels[level:upper()]
|
||||
local status_ok, logger = pcall(require("structlog").get_logger, "lvim")
|
||||
if status_ok then
|
||||
for _, s in ipairs(logger.sinks) do
|
||||
s.level = log_level
|
||||
local logger_ok, _ = xpcall(function()
|
||||
local log_level = Log.levels[level:upper()]
|
||||
local structlog = require "structlog"
|
||||
if structlog then
|
||||
local logger = structlog.get_logger "lvim"
|
||||
for _, s in ipairs(logger.sinks) do
|
||||
s.level = log_level
|
||||
end
|
||||
end
|
||||
end, debug.traceback)
|
||||
if not logger_ok then
|
||||
Log:debug("Unable to set logger's level: " .. debug.traceback())
|
||||
end
|
||||
|
||||
package.loaded["packer.log"] = nil
|
||||
require("packer.log").new { level = lvim.log.level }
|
||||
local packer_ok, _ = xpcall(function()
|
||||
package.loaded["packer.log"] = nil
|
||||
require("packer.log").new { level = lvim.log.level }
|
||||
end, debug.traceback)
|
||||
if not packer_ok then
|
||||
Log:debug("Unable to set packer's log level: " .. debug.traceback())
|
||||
end
|
||||
end
|
||||
|
||||
function Log:init()
|
||||
|
@ -36,7 +46,7 @@ function Log:init()
|
|||
lvim = {
|
||||
sinks = {
|
||||
structlog.sinks.Console(log_level, {
|
||||
async = false,
|
||||
async = true,
|
||||
processors = {
|
||||
structlog.processors.Namer(),
|
||||
structlog.processors.StackWriter({ "line", "file" }, { max_parents = 0, stack_level = 2 }),
|
||||
|
|
|
@ -55,33 +55,35 @@ function M.view_lunarvim_changelog()
|
|||
}
|
||||
opts.entry_maker = make_entry.gen_from_git_commits(opts)
|
||||
|
||||
pickers.new(opts, {
|
||||
prompt_title = "~ LunarVim Changelog ~",
|
||||
pickers
|
||||
.new(opts, {
|
||||
prompt_title = "~ LunarVim Changelog ~",
|
||||
|
||||
finder = finders.new_oneshot_job(
|
||||
vim.tbl_flatten {
|
||||
"git",
|
||||
"log",
|
||||
"--pretty=oneline",
|
||||
"--abbrev-commit",
|
||||
finder = finders.new_oneshot_job(
|
||||
vim.tbl_flatten {
|
||||
"git",
|
||||
"log",
|
||||
"--pretty=oneline",
|
||||
"--abbrev-commit",
|
||||
},
|
||||
opts
|
||||
),
|
||||
previewer = {
|
||||
previewers.git_commit_diff_as_was.new(opts),
|
||||
},
|
||||
opts
|
||||
),
|
||||
previewer = {
|
||||
previewers.git_commit_diff_as_was.new(opts),
|
||||
},
|
||||
|
||||
--TODO: consider opening a diff view when pressing enter
|
||||
attach_mappings = function(_, map)
|
||||
map("i", "<enter>", copy_to_clipboard_action)
|
||||
map("n", "<enter>", copy_to_clipboard_action)
|
||||
map("i", "<esc>", actions._close)
|
||||
map("n", "<esc>", actions._close)
|
||||
map("n", "q", actions._close)
|
||||
return true
|
||||
end,
|
||||
sorter = sorters.generic_sorter,
|
||||
}):find()
|
||||
--TODO: consider opening a diff view when pressing enter
|
||||
attach_mappings = function(_, map)
|
||||
map("i", "<enter>", copy_to_clipboard_action)
|
||||
map("n", "<enter>", copy_to_clipboard_action)
|
||||
map("i", "<esc>", actions._close)
|
||||
map("n", "<esc>", actions._close)
|
||||
map("n", "q", actions._close)
|
||||
return true
|
||||
end,
|
||||
sorter = sorters.generic_sorter,
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
-- Smartly opens either git_files or find_files, depending on whether the working directory is
|
||||
|
|
|
@ -41,7 +41,6 @@ M.config = function()
|
|||
-- lvim.builtin.terminal.execs[#lvim.builtin.terminal.execs+1] = {"gdb", "tg", "GNU Debugger"}
|
||||
execs = {
|
||||
{ "lazygit", "<leader>gg", "LazyGit", "float" },
|
||||
{ "lazygit", "<c-\\><c-g>", "LazyGit", "float" },
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -76,23 +75,9 @@ M.add_exec = function(opts)
|
|||
return
|
||||
end
|
||||
|
||||
local exec_func = string.format(
|
||||
"<cmd>lua require('lvim.core.terminal')._exec_toggle({ cmd = '%s', count = %d, direction = '%s'})<CR>",
|
||||
opts.cmd,
|
||||
opts.count,
|
||||
opts.direction
|
||||
)
|
||||
|
||||
require("lvim.keymappings").load {
|
||||
normal_mode = { [opts.keymap] = exec_func },
|
||||
term_mode = { [opts.keymap] = exec_func },
|
||||
}
|
||||
|
||||
local wk_status_ok, wk = pcall(require, "which-key")
|
||||
if not wk_status_ok then
|
||||
return
|
||||
end
|
||||
wk.register({ [opts.keymap] = { opts.label } }, { mode = "n" })
|
||||
vim.keymap.set({ "n", "t" }, opts.keymap, function()
|
||||
M._exec_toggle { cmd = opts.cmd, count = opts.count, direction = opts.direction }
|
||||
end, { desc = opts.label, noremap = true, silent = true })
|
||||
end
|
||||
|
||||
M._exec_toggle = function(opts)
|
||||
|
|
|
@ -39,6 +39,8 @@ local skipped_servers = {
|
|||
|
||||
local skipped_filetypes = { "markdown", "rst", "plaintext" }
|
||||
|
||||
local join_paths = require("lvim.utils").join_paths
|
||||
|
||||
return {
|
||||
templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
|
||||
diagnostics = {
|
||||
|
@ -119,6 +121,34 @@ return {
|
|||
insert_mode = {},
|
||||
visual_mode = {},
|
||||
},
|
||||
buffer_options = {
|
||||
--- enable completion triggered by <c-x><c-o>
|
||||
omnifunc = "v:lua.vim.lsp.omnifunc",
|
||||
--- use gq for formatting
|
||||
formatexpr = "v:lua.vim.lsp.formatexpr(#{timeout_ms:500})",
|
||||
},
|
||||
---@usage list of settings of nvim-lsp-installer
|
||||
installer = {
|
||||
setup = {
|
||||
ensure_installed = {},
|
||||
ui = {
|
||||
icons = {
|
||||
server_installed = "✓",
|
||||
server_pending = "",
|
||||
server_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
nlsp_settings = {
|
||||
setup = {
|
||||
config_home = join_paths(get_config_dir(), "lsp-settings"),
|
||||
-- set to false to overwrite schemastore.nvim
|
||||
append_default_schemas = true,
|
||||
ignored_servers = {},
|
||||
loader = "json",
|
||||
},
|
||||
},
|
||||
null_ls = {
|
||||
setup = {},
|
||||
config = {},
|
||||
|
|
|
@ -3,6 +3,12 @@ local Log = require "lvim.core.log"
|
|||
local utils = require "lvim.utils"
|
||||
local autocmds = require "lvim.core.autocmds"
|
||||
|
||||
local function add_lsp_buffer_options(bufnr)
|
||||
for k, v in pairs(lvim.lsp.buffer_options) do
|
||||
vim.api.nvim_buf_set_option(bufnr, k, v)
|
||||
end
|
||||
end
|
||||
|
||||
local function add_lsp_buffer_keybindings(bufnr)
|
||||
local mappings = {
|
||||
normal_mode = "n",
|
||||
|
@ -10,21 +16,10 @@ local function add_lsp_buffer_keybindings(bufnr)
|
|||
visual_mode = "v",
|
||||
}
|
||||
|
||||
if lvim.builtin.which_key.active then
|
||||
-- Remap using which_key
|
||||
local status_ok, wk = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
for mode_name, mode_char in pairs(mappings) do
|
||||
wk.register(lvim.lsp.buffer_mappings[mode_name], { mode = mode_char, buffer = bufnr })
|
||||
end
|
||||
else
|
||||
-- Remap using nvim api
|
||||
for mode_name, mode_char in pairs(mappings) do
|
||||
for key, remap in pairs(lvim.lsp.buffer_mappings[mode_name]) do
|
||||
vim.api.nvim_buf_set_keymap(bufnr, mode_char, key, remap[1], { noremap = true, silent = true })
|
||||
end
|
||||
for mode_name, mode_char in pairs(mappings) do
|
||||
for key, remap in pairs(lvim.lsp.buffer_mappings[mode_name]) do
|
||||
local opts = { buffer = bufnr, desc = remap[2], noremap = true, silent = true }
|
||||
vim.keymap.set(mode_char, key, remap[1], opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -78,14 +73,7 @@ function M.common_on_attach(client, bufnr)
|
|||
lu.setup_codelens_refresh(client, bufnr)
|
||||
end
|
||||
add_lsp_buffer_keybindings(bufnr)
|
||||
end
|
||||
|
||||
local function bootstrap_nlsp(opts)
|
||||
opts = opts or {}
|
||||
local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings")
|
||||
if lsp_settings_status_ok then
|
||||
lsp_settings.setup(opts)
|
||||
end
|
||||
add_lsp_buffer_options(bufnr)
|
||||
end
|
||||
|
||||
function M.get_common_opts()
|
||||
|
@ -117,15 +105,13 @@ function M.setup()
|
|||
require("lvim.lsp.templates").generate_templates()
|
||||
end
|
||||
|
||||
bootstrap_nlsp {
|
||||
config_home = utils.join_paths(get_config_dir(), "lsp-settings"),
|
||||
append_default_schemas = true,
|
||||
}
|
||||
pcall(function()
|
||||
require("nlspsettings").setup(lvim.lsp.nlsp_settings.setup)
|
||||
end)
|
||||
|
||||
require("nvim-lsp-installer").setup {
|
||||
-- use the default nvim_data_dir, since the server binaries are independent
|
||||
install_root_dir = utils.join_paths(vim.call("stdpath", "data"), "lsp_servers"),
|
||||
}
|
||||
pcall(function()
|
||||
require("nvim-lsp-installer").setup(lvim.lsp.installer.setup)
|
||||
end)
|
||||
|
||||
require("lvim.lsp.null-ls").setup()
|
||||
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
local full_schemas = vim.tbl_deep_extend(
|
||||
"force",
|
||||
require("schemastore").json.schemas(),
|
||||
require("nlspsettings.jsonls").get_default_schemas()
|
||||
)
|
||||
local opts = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = full_schemas,
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
|
|
|
@ -17,12 +17,20 @@ end
|
|||
|
||||
local skipped_filetypes = lvim.lsp.automatic_configuration.skipped_filetypes
|
||||
local skipped_servers = lvim.lsp.automatic_configuration.skipped_servers
|
||||
local ensure_installed_servers = lvim.lsp.installer.setup.ensure_installed
|
||||
|
||||
---Check if we should skip generating an ftplugin file based on the server_name
|
||||
---@param server_name string name of a valid language server
|
||||
local function should_skip(server_name)
|
||||
-- ensure_installed_servers should take priority over skipped_servers
|
||||
return vim.tbl_contains(skipped_servers, server_name) and not vim.tbl_contains(ensure_installed_servers, server_name)
|
||||
end
|
||||
|
||||
---Generates an ftplugin file based on the server_name in the selected directory
|
||||
---@param server_name string name of a valid language server, e.g. pyright, gopls, tsserver, etc.
|
||||
---@param dir string the full path to the desired directory
|
||||
function M.generate_ftplugin(server_name, dir)
|
||||
if vim.tbl_contains(skipped_servers, server_name) then
|
||||
if should_skip(server_name) then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
@ -130,45 +130,46 @@ function M.setup_codelens_refresh(client, bufnr)
|
|||
end
|
||||
|
||||
---filter passed to vim.lsp.buf.format
|
||||
---gives higher priority to null-ls
|
||||
---@param clients table clients attached to a buffer
|
||||
---@return table chosen clients
|
||||
function M.format_filter(clients)
|
||||
return vim.tbl_filter(function(client)
|
||||
local status_ok, formatting_supported = pcall(function()
|
||||
return client.supports_method "textDocument/formatting"
|
||||
end)
|
||||
-- give higher prio to null-ls
|
||||
if status_ok and formatting_supported and client.name == "null-ls" then
|
||||
return "null-ls"
|
||||
else
|
||||
return status_ok and formatting_supported and client.name
|
||||
end
|
||||
end, clients)
|
||||
---always selects null-ls if it's available and caches the value per buffer
|
||||
---@param client table client attached to a buffer
|
||||
---@return boolean if client matches
|
||||
function M.format_filter(client)
|
||||
local filetype = vim.bo.filetype
|
||||
local n = require "null-ls"
|
||||
local s = require "null-ls.sources"
|
||||
local method = n.methods.FORMATTING
|
||||
local avalable_formatters = s.get_available(filetype, method)
|
||||
|
||||
if #avalable_formatters > 0 then
|
||||
return client.name == "null-ls"
|
||||
elseif client.supports_method "textDocument/formatting" then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
---Provide vim.lsp.buf.format for nvim <0.8
|
||||
---@param opts table
|
||||
function M.format(opts)
|
||||
opts = opts or { filter = M.format_filter }
|
||||
opts = opts or {}
|
||||
opts.filter = opts.filter or M.format_filter
|
||||
|
||||
if vim.lsp.buf.format then
|
||||
return vim.lsp.buf.format(opts)
|
||||
end
|
||||
|
||||
local bufnr = opts.bufnr or vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.buf_get_clients(bufnr)
|
||||
|
||||
---@type table|nil
|
||||
local clients = vim.lsp.get_active_clients {
|
||||
id = opts.id,
|
||||
bufnr = bufnr,
|
||||
name = opts.name,
|
||||
}
|
||||
|
||||
if opts.filter then
|
||||
clients = opts.filter(clients)
|
||||
elseif opts.id then
|
||||
clients = vim.tbl_filter(function(client)
|
||||
return client.id == opts.id
|
||||
end, clients)
|
||||
elseif opts.name then
|
||||
clients = vim.tbl_filter(function(client)
|
||||
return client.name == opts.name
|
||||
end, clients)
|
||||
clients = vim.tbl_filter(opts.filter, clients)
|
||||
end
|
||||
|
||||
clients = vim.tbl_filter(function(client)
|
||||
|
|
|
@ -20,6 +20,7 @@ function plugin_loader.init(opts)
|
|||
package_root = opts.package_root or join_paths(vim.fn.stdpath "data", "site", "pack"),
|
||||
compile_path = compile_path,
|
||||
snapshot_path = snapshot_path,
|
||||
max_jobs = 40,
|
||||
log = { level = "warn" },
|
||||
git = {
|
||||
clone_timeout = 300,
|
||||
|
|
|
@ -12,6 +12,7 @@ local core_plugins = {
|
|||
},
|
||||
{
|
||||
"lunarvim/onedarker.nvim",
|
||||
branch = "freeze",
|
||||
config = function()
|
||||
pcall(function()
|
||||
if lvim and lvim.colorscheme == "onedarker" then
|
||||
|
@ -37,6 +38,7 @@ local core_plugins = {
|
|||
-- Telescope
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
config = function()
|
||||
require("lvim.core.telescope").setup()
|
||||
end,
|
||||
|
|
|
@ -13,16 +13,14 @@ local function git_cmd(opts)
|
|||
opts.cwd = opts.cwd or get_lvim_base_dir()
|
||||
|
||||
local stderr = {}
|
||||
local stdout, ret = Job
|
||||
:new({
|
||||
command = "git",
|
||||
args = opts.args,
|
||||
cwd = opts.cwd,
|
||||
on_stderr = function(_, data)
|
||||
table.insert(stderr, data)
|
||||
end,
|
||||
})
|
||||
:sync()
|
||||
local stdout, ret = Job:new({
|
||||
command = "git",
|
||||
args = opts.args,
|
||||
cwd = opts.cwd,
|
||||
on_stderr = function(_, data)
|
||||
table.insert(stderr, data)
|
||||
end,
|
||||
}):sync()
|
||||
|
||||
if not vim.tbl_isempty(stderr) then
|
||||
Log:debug(stderr)
|
||||
|
@ -32,20 +30,20 @@ local function git_cmd(opts)
|
|||
Log:debug(stdout)
|
||||
end
|
||||
|
||||
return ret, stdout
|
||||
return ret, stdout, stderr
|
||||
end
|
||||
|
||||
local function safe_deep_fetch()
|
||||
local ret, result = git_cmd { args = { "rev-parse", "--is-shallow-repository" } }
|
||||
local ret, result, error = git_cmd { args = { "rev-parse", "--is-shallow-repository" } }
|
||||
if ret ~= 0 then
|
||||
Log:error "Git fetch failed! Check the log for further information"
|
||||
Log:error(vim.inspect(error))
|
||||
return
|
||||
end
|
||||
-- git fetch --unshallow will cause an error on a a complete clone
|
||||
local fetch_mode = result[1] == "true" and "--unshallow" or "--all"
|
||||
ret = git_cmd { args = { "fetch", fetch_mode } }
|
||||
if ret ~= 0 then
|
||||
Log:error "Git fetch failed! Check the log for further information"
|
||||
Log:error("Git fetch failed! Please pull the changes manually in " .. get_lvim_base_dir())
|
||||
return
|
||||
end
|
||||
return true
|
||||
|
@ -55,12 +53,12 @@ end
|
|||
function M.update_base_lvim()
|
||||
Log:info "Checking for updates"
|
||||
|
||||
local ret = git_cmd { args = { "fetch" } }
|
||||
if ret ~= 0 then
|
||||
Log:error "Update failed! Check the log for further information"
|
||||
if not safe_deep_fetch() then
|
||||
return
|
||||
end
|
||||
|
||||
local ret
|
||||
|
||||
ret = git_cmd { args = { "diff", "--quiet", "@{upstream}" } }
|
||||
if ret == 0 then
|
||||
Log:info "LunarVim is already up-to-date"
|
||||
|
@ -69,7 +67,7 @@ function M.update_base_lvim()
|
|||
|
||||
ret = git_cmd { args = { "merge", "--ff-only", "--progress" } }
|
||||
if ret ~= 0 then
|
||||
Log:error "Update failed! Please pull the changes manually instead."
|
||||
Log:error("Update failed! Please pull the changes manually in " .. get_lvim_base_dir())
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
{
|
||||
"Comment.nvim": {
|
||||
"commit": "3c69bab"
|
||||
"commit": "2e0572c"
|
||||
},
|
||||
"FixCursorHold.nvim": {
|
||||
"commit": "1bfb32e"
|
||||
"commit": "5aa5ff1"
|
||||
},
|
||||
"LuaSnip": {
|
||||
"commit": "79b2019"
|
||||
"commit": "be3083b"
|
||||
},
|
||||
"alpha-nvim": {
|
||||
"commit": "ef27a59"
|
||||
"commit": "14974c3"
|
||||
},
|
||||
"bufferline.nvim": {
|
||||
"commit": "c78b3ec"
|
||||
"commit": "d7b775a"
|
||||
},
|
||||
"cmp-buffer": {
|
||||
"commit": "12463cf"
|
||||
"commit": "62fc67a"
|
||||
},
|
||||
"cmp-nvim-lsp": {
|
||||
"commit": "affe808"
|
||||
},
|
||||
"cmp-path": {
|
||||
"commit": "466b6b8"
|
||||
"commit": "981baf9"
|
||||
},
|
||||
"cmp_luasnip": {
|
||||
"commit": "a9de941"
|
||||
|
@ -30,61 +30,61 @@
|
|||
"commit": "bbda2b0"
|
||||
},
|
||||
"friendly-snippets": {
|
||||
"commit": "d27a83a"
|
||||
"commit": "40c306b"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"commit": "c18e016"
|
||||
"commit": "bb6c3bf"
|
||||
},
|
||||
"lua-dev.nvim": {
|
||||
"commit": "54149d1"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"commit": "3362b28"
|
||||
"commit": "8d956c1"
|
||||
},
|
||||
"nlsp-settings.nvim": {
|
||||
"commit": "62d72bc"
|
||||
"commit": "6c4e1a4"
|
||||
},
|
||||
"null-ls.nvim": {
|
||||
"commit": "ff40739"
|
||||
"commit": "9c396ab"
|
||||
},
|
||||
"nvim-autopairs": {
|
||||
"commit": "fa6876f"
|
||||
"commit": "972a797"
|
||||
},
|
||||
"nvim-cmp": {
|
||||
"commit": "df6734a"
|
||||
"commit": "c4dcb12"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"commit": "014ebd5"
|
||||
"commit": "c0f43f4"
|
||||
},
|
||||
"nvim-lsp-installer": {
|
||||
"commit": "2408a0f"
|
||||
"commit": "45571e1"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"commit": "10c3934"
|
||||
"commit": "3479473"
|
||||
},
|
||||
"nvim-notify": {
|
||||
"commit": "8960269"
|
||||
"commit": "74ba257"
|
||||
},
|
||||
"nvim-tree.lua": {
|
||||
"commit": "bdb6d4a"
|
||||
"commit": "08ab346"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"commit": "518e275"
|
||||
"commit": "07b7221"
|
||||
},
|
||||
"nvim-ts-context-commentstring": {
|
||||
"commit": "8834375"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"commit": "8d2c533"
|
||||
"commit": "2d02a56"
|
||||
},
|
||||
"onedarker.nvim": {
|
||||
"commit": "b00dd21"
|
||||
},
|
||||
"packer.nvim": {
|
||||
"commit": "00ec5ad"
|
||||
"commit": "494fd59"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"commit": "968a4b9"
|
||||
"commit": "986ad71"
|
||||
},
|
||||
"popup.nvim": {
|
||||
"commit": "b7404d3"
|
||||
|
@ -93,7 +93,7 @@
|
|||
"commit": "541115e"
|
||||
},
|
||||
"schemastore.nvim": {
|
||||
"commit": "a32911d"
|
||||
"commit": "fbc7c71"
|
||||
},
|
||||
"structlog.nvim": {
|
||||
"commit": "232a8e2"
|
||||
|
@ -102,10 +102,10 @@
|
|||
"commit": "6a33ece"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"commit": "d96eaa9"
|
||||
"commit": "273ccff"
|
||||
},
|
||||
"toggleterm.nvim": {
|
||||
"commit": "aaeed9e"
|
||||
"commit": "9db6f98"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"commit": "f03a259"
|
||||
|
|
|
@ -3,16 +3,14 @@ local M = {}
|
|||
function M.search_file(file, args)
|
||||
local Job = require "plenary.job"
|
||||
local stderr = {}
|
||||
local stdout, ret = Job
|
||||
:new({
|
||||
command = "grep",
|
||||
args = { args, file },
|
||||
cwd = get_cache_dir(),
|
||||
on_stderr = function(_, data)
|
||||
table.insert(stderr, data)
|
||||
end,
|
||||
})
|
||||
:sync()
|
||||
local stdout, ret = Job:new({
|
||||
command = "grep",
|
||||
args = { args, file },
|
||||
cwd = get_cache_dir(),
|
||||
on_stderr = function(_, data)
|
||||
table.insert(stderr, data)
|
||||
end,
|
||||
}):sync()
|
||||
return ret, stdout, stderr
|
||||
end
|
||||
|
||||
|
|
|
@ -84,6 +84,20 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|||
|
||||
-- generic LSP settings
|
||||
|
||||
-- -- make sure server will always be installed even if the server is in skipped_servers list
|
||||
-- lvim.lsp.installer.setup.ensure_installed = {
|
||||
-- "sumeko_lua",
|
||||
-- "jsonls",
|
||||
-- }
|
||||
-- -- change UI setting of `LspInstallInfo`
|
||||
-- -- see <https://github.com/williamboman/nvim-lsp-installer#default-configuration>
|
||||
-- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false
|
||||
-- lvim.lsp.installer.setup.ui.border = "rounded"
|
||||
-- lvim.lsp.installer.setup.ui.keymaps = {
|
||||
-- uninstall_server = "d",
|
||||
-- toggle_server_expand = "o",
|
||||
-- }
|
||||
|
||||
-- ---@usage disable automatic installation of servers
|
||||
-- lvim.lsp.automatic_servers_installation = false
|
||||
|
||||
|
@ -94,7 +108,7 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
||||
|
||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype
|
||||
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
|
||||
-- vim.tbl_map(function(server)
|
||||
-- return server ~= "emmet_ls"
|
||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
||||
|
|
|
@ -99,6 +99,20 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|||
|
||||
-- generic LSP settings
|
||||
|
||||
-- -- make sure server will always be installed even if the server is in skipped_servers list
|
||||
-- lvim.lsp.installer.setup.ensure_installed = {
|
||||
-- "sumeko_lua",
|
||||
-- "jsonls",
|
||||
-- }
|
||||
-- -- change UI setting of `LspInstallInfo`
|
||||
-- -- see <https://github.com/williamboman/nvim-lsp-installer#default-configuration>
|
||||
-- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false
|
||||
-- lvim.lsp.installer.setup.ui.border = "rounded"
|
||||
-- lvim.lsp.installer.setup.ui.keymaps = {
|
||||
-- uninstall_server = "d",
|
||||
-- toggle_server_expand = "o",
|
||||
-- }
|
||||
|
||||
-- ---@usage disable automatic installation of servers
|
||||
-- lvim.lsp.automatic_servers_installation = false
|
||||
|
||||
|
@ -109,7 +123,7 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
||||
|
||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype
|
||||
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
|
||||
-- vim.tbl_map(function(server)
|
||||
-- return server ~= "emmet_ls"
|
||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
||||
|
|
|
@ -72,6 +72,10 @@ function install_neovim() {
|
|||
pushd "$DOWNLOAD_DIR"
|
||||
tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz"
|
||||
popd
|
||||
if [ ! -d "$DOWNLOAD_DIR/$RELEASE_NAME" ]; then
|
||||
# fallback to archive name
|
||||
RELEASE_NAME="$ARCHIVE_NAME"
|
||||
fi
|
||||
# https://dev.to/ackshaey/macos-vs-linux-the-cp-command-will-trip-you-up-2p00
|
||||
cp -r "$DOWNLOAD_DIR/$RELEASE_NAME/." "$LV_INSTALL_PREFIX"
|
||||
echo "Installation complete!"
|
||||
|
|
|
@ -15,6 +15,8 @@ declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}"
|
|||
declare -r LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}"
|
||||
declare -r LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
|
||||
|
||||
declare -r LUNARVIM_LOG_LEVEL="${LUNARVIM_LOG_LEVEL:-warn}"
|
||||
|
||||
declare BASEDIR
|
||||
BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
BASEDIR="$(dirname -- "$(dirname -- "$BASEDIR")")"
|
||||
|
@ -209,7 +211,7 @@ function check_neovim_min_version() {
|
|||
function verify_core_plugins() {
|
||||
msg "Verifying core plugins"
|
||||
if ! bash "$LUNARVIM_BASE_DIR/utils/ci/verify_plugins.sh"; then
|
||||
echo "[ERROR]: Unable to verify plugins, makde sure to manually run ':PackerSync' when starting lvim for the first time."
|
||||
echo "[ERROR]: Unable to verify plugins, make sure to manually run ':PackerSync' when starting lvim for the first time."
|
||||
exit 1
|
||||
fi
|
||||
echo "Verification complete!"
|
||||
|
@ -423,6 +425,7 @@ function setup_lvim() {
|
|||
echo "Preparing Packer setup"
|
||||
|
||||
"$INSTALL_PREFIX/bin/lvim" --headless \
|
||||
-c "lua require('lvim.core.log'):set_level([[$LUNARVIM_LOG_LEVEL]])" \
|
||||
-c 'autocmd User PackerComplete quitall' \
|
||||
-c 'PackerSync'
|
||||
|
||||
|
|
Loading…
Reference in a new issue