Nvim switch from NvChad to LazyVim
This commit is contained in:
@@ -1 +0,0 @@
|
||||
require "nvchad.autocmds"
|
||||
@@ -1,24 +0,0 @@
|
||||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
|
||||
-- Please read that file to know all available options :(
|
||||
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "rosepine",
|
||||
|
||||
-- hl_override = {
|
||||
-- Comment = { italic = true },
|
||||
-- ["@comment"] = { italic = true },
|
||||
-- },
|
||||
}
|
||||
|
||||
-- M.nvdash = { load_on_startup = true }
|
||||
-- M.ui = {
|
||||
-- tabufline = {
|
||||
-- lazyload = false
|
||||
-- }
|
||||
-- }
|
||||
|
||||
return M
|
||||
2
config/nvim/lua/config/autocmds.lua
Normal file
2
config/nvim/lua/config/autocmds.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
22
config/nvim/lua/config/keymaps.lua
Normal file
22
config/nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
-- DAP (override LazyVim defaults with previous muscle-memory bindings)
|
||||
map("n", "<Leader>dl", function() require("dap").step_into() end, { desc = "Debugger step into" })
|
||||
map("n", "<Leader>dj", function() require("dap").step_over() end, { desc = "Debugger step over" })
|
||||
map("n", "<Leader>dk", function() require("dap").step_out() end, { desc = "Debugger step out" })
|
||||
map("n", "<Leader>dc", function() require("dap").continue() end, { desc = "Debugger continue" })
|
||||
map("n", "<Leader>db", function() require("dap").toggle_breakpoint() end, { desc = "Debugger toggle breakpoint" })
|
||||
map("n", "<Leader>dd", function()
|
||||
require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||
end, { desc = "Debugger conditional breakpoint" })
|
||||
map("n", "<Leader>de", function() require("dap").terminate() end, { desc = "Debugger terminate" })
|
||||
map("n", "<Leader>dr", function() require("dap").run_last() end, { desc = "Debugger run last" })
|
||||
|
||||
-- rustaceanvim
|
||||
map("n", "<Leader>dt", "<cmd>RustLsp testables<CR>", { desc = "Rust testables" })
|
||||
41
config/nvim/lua/config/lazy.lua
Normal file
41
config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
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)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
lazy = false,
|
||||
version = false,
|
||||
},
|
||||
install = { colorscheme = { "rose-pine", "tokyonight", "habamax" } },
|
||||
checker = { enabled = true, notify = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
2
config/nvim/lua/config/options.lua
Normal file
2
config/nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
@@ -1,15 +0,0 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
return options
|
||||
@@ -1,47 +0,0 @@
|
||||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local servers = { "html", "cssls" }
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
-- read :h vim.lsp.config for changing options of lsp servers
|
||||
@@ -1,28 +0,0 @@
|
||||
require "nvchad.mappings"
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||
|
||||
-- Nvim DAP
|
||||
map("n", "<Leader>dl", "<cmd>lua require'dap'.step_into()<CR>", { desc = "Debugger step into" })
|
||||
map("n", "<Leader>dj", "<cmd>lua require'dap'.step_over()<CR>", { desc = "Debugger step over" })
|
||||
map("n", "<Leader>dk", "<cmd>lua require'dap'.step_out()<CR>", { desc = "Debugger step out" })
|
||||
map("n", "<Leader>dc", "<cmd>lua require'dap'.continue()<CR>", { desc = "Debugger continue" })
|
||||
map("n", "<Leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Debugger toggle breakpoint" })
|
||||
map(
|
||||
"n",
|
||||
"<Leader>dd",
|
||||
"<cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>",
|
||||
{ desc = "Debugger set conditional breakpoint" }
|
||||
)
|
||||
map("n", "<Leader>de", "<cmd>lua require'dap'.terminate()<CR>", { desc = "Debugger reset" })
|
||||
map("n", "<Leader>dr", "<cmd>lua require'dap'.run_last()<CR>", { desc = "Debugger run last" })
|
||||
|
||||
-- rustaceanvim
|
||||
map("n", "<Leader>dt", "<cmd>lua vim.cmd('RustLsp testables')<CR>", { desc = "Debugger testables" })
|
||||
@@ -1,6 +0,0 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
8
config/nvim/lua/plugins/colorscheme.lua
Normal file
8
config/nvim/lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
{ "rose-pine/neovim", name = "rose-pine", lazy = false, priority = 1000 },
|
||||
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = { colorscheme = "rose-pine" },
|
||||
},
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
-- event = 'BufWritePre', -- uncomment for format on save
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
-- To avoid being surprised by breaking changes,
|
||||
-- I recommend you set a version range
|
||||
version = '^9',
|
||||
-- This plugin implements proper lazy-loading (see :h lua-plugin-lazy).
|
||||
-- No need for lazy.nvim to lazy-load it.
|
||||
lazy = false,
|
||||
config = function()
|
||||
local mason_registry = require('mason-registry')
|
||||
local codelldb = mason_registry.get_package('codelldb')
|
||||
local extension_path = codelldb:get_install_path() .. "/extension/"
|
||||
local codelldb_path = extension_path .. "adapter/codelldb"
|
||||
local liblldb_ext = vim.uv.os_uname().sysname == "Darwin" and "dylib" or "so"
|
||||
local liblldb_path = extension_path .. "lldb/lib/liblldb." .. liblldb_ext
|
||||
local cfg = require('rustaceanvim.config')
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
dap = {
|
||||
adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path),
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
config = function()
|
||||
local dap, dapui = require('dap'), require('dapui')
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' },
|
||||
config = function()
|
||||
require('dapui').setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{ import = "nvchad.blink.lazyspec" },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vim", "lua", "vimdoc",
|
||||
"html", "css"
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
13
config/nvim/lua/plugins/tmux-navigator.lua
Normal file
13
config/nvim/lua/plugins/tmux-navigator.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user