1
0

neovim: Replace packer with lazy.nvim

This commit is contained in:
2025-09-20 22:03:23 +02:00
parent ee8818dc43
commit f33ecb78ee
5 changed files with 295 additions and 270 deletions

View File

@@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@@ -0,0 +1,68 @@
--
-- ALE
--
-- Run linters only on save
vim.g.ale_lint_on_text_changed = 'never'
vim.g.ale_lint_on_insert_leave = 0
-- Include the linter name (e.g. 'hack' or 'hhast'), code, and message in errors
vim.g.ale_echo_msg_format = '[%linter%] %s'
vim.g.ale_linters = {
hack = {'hack', 'hhast'},
haskell = {"hlint"},
javascript = {'eslint'},
d = {'dmd'},
php = {'phpcs', 'phpstan'},
ruby = {'rubocop'},
cpp = {},
asm = {},
}
vim.g.ale_ruby_rubocop_executable = 'bundle'
vim.g.ale_cpp_cc_options = '-std=c++17 -Wall'
vim.g.ale_open_list = 1
vim.g.ale_disable_lsp = 1
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
--
-- Telescope
--
require('telescope').setup {
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
}
}
}
}
require("telescope").load_extension("ui-select")
vim.api.nvim_set_keymap('n', '<leader>ff', "<cmd>lua require('telescope.builtin').find_files()<cr>",
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>fg', "<cmd>lua require('telescope.builtin').live_grep()<cr>",
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>fb', "<cmd>lua require('telescope.builtin').buffers()<cr>",
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>fh', "<cmd>lua require('telescope.builtin').help_tags()<cr>",
{ noremap = true, silent = true })
--
-- Vista
--
vim.g.vista_default_executive = 'nvim_lsp'
--
-- Vdebug
--
vim.g.vdebug_options = { port = '9000' }
--
-- sonokai
--
vim.g.sonokai_style = "shusia"