mirror of
https://github.com/runyanjake/dotfiles.git
synced 2026-02-03 16:47:29 -08:00
Update to modern LazyVim conventions.
This commit is contained in:
parent
fc4affddb7
commit
c1c8b47925
@ -26,11 +26,16 @@ sudo apt install build-essential
|
||||
```
|
||||
|
||||
1. Install the latest version of Neovim from the Neovim Launchpad PPA. Ubuntu apt has an older version, and since then much has changed, so we'll prefer the latest stable from the PPA.
|
||||
```
|
||||
```ubuntu
|
||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||
sudo apt update
|
||||
sudo apt install neovim
|
||||
```
|
||||
|
||||
```macos
|
||||
brew install neovim
|
||||
```
|
||||
|
||||
2. Ensure that the nvim runtimepath is correctly configured to include `~/.config.nvim`.
|
||||
You can check that by executing this nvim command: `:echo &runtimepath`.
|
||||
3. Both `init.lua` as well as the `lua/` folder and its contents should be symlinked to `~/.config/nvim` (Might need to create the nvim folder if first time).
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
-- config files
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
require("config.options")
|
||||
require("config.mappings")
|
||||
require("config.autocmds")
|
||||
|
||||
-- lazy nvim plugin manager
|
||||
-- require("config.lazy")
|
||||
|
||||
-- manual inclusion of plugins
|
||||
require("plugins.helloWorld")
|
||||
|
||||
require("config.lazy")
|
||||
|
||||
@ -1,17 +1,27 @@
|
||||
-- install lazy.nvim
|
||||
-- 1. Correct Path & UV check
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
-- 2. Improved system call with error reporting
|
||||
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)
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
-- 3. Explicit setup table
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
lazy = false, -- Load custom plugins on startup by default
|
||||
},
|
||||
})
|
||||
|
||||
16
neovim/lua/plugins/coding.lua
Normal file
16
neovim/lua/plugins/coding.lua
Normal file
@ -0,0 +1,16 @@
|
||||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
version = "*",
|
||||
opts = {
|
||||
keymap = { preset = 'default' },
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
-- hello.lua
|
||||
|
||||
-- Define a function that prints a greeting
|
||||
local function hello_world()
|
||||
print("Hello, Neovim!")
|
||||
end
|
||||
|
||||
-- Create a command ":SayHello" that runs the say_hello function
|
||||
vim.api.nvim_create_user_command('HelloWorld', hello_world, {})
|
||||
|
||||
30
neovim/lua/plugins/snacks.lua
Normal file
30
neovim/lua/plugins/snacks.lua
Normal file
@ -0,0 +1,30 @@
|
||||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
opts = {
|
||||
picker = { enabled = true },
|
||||
explorer = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
|
||||
bigfile = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader><space>", function() Snacks.picker.smart() end, desc = "Smart Find Files" },
|
||||
{ "<leader>ff", function() Snacks.picker.files() end, desc = "Find Files" },
|
||||
{ "<leader>fg", function() Snacks.picker.grep() end, desc = "Grep" },
|
||||
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||
{ "<leader>fr", function() Snacks.picker.recent() end, desc = "Recent" },
|
||||
{ "<leader>e", function() Snacks.explorer() end, desc = "File Explorer" },
|
||||
{ "<leader>bd", function() Snacks.bufdelete() end, desc = "Delete Buffer" },
|
||||
{ "<leader>.", function() Snacks.scratch() end, desc = "Toggle Scratchpad" },
|
||||
},
|
||||
},
|
||||
}
|
||||
10
neovim/lua/plugins/theme.lua
Normal file
10
neovim/lua/plugins/theme.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd([[colorscheme tokyonight]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user