mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 09:01:16 +00:00
net config
This commit is contained in:
parent
93b7b93d64
commit
dd59a54b92
36 changed files with 960 additions and 631 deletions
78
init.lua
78
init.lua
|
|
@ -1,6 +1,24 @@
|
|||
-- Set leader keys before lazy
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Global mapping helpers
|
||||
_G.map = function(mode, lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
_G.bmap = function(buf, mode, lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = buf
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
|
|
@ -12,55 +30,6 @@ if not vim.loop.fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Basic settings
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- NvChad base46 cache path (must be before lazy setup)
|
||||
vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46_cache/"
|
||||
|
||||
-- Essential vim options
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.wrap = true
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undodir"
|
||||
vim.opt.undofile = true
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.colorcolumn = ""
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.showmode = false -- Disable built-in mode display
|
||||
vim.opt.shortmess:append("S") -- Disable native search count display
|
||||
vim.opt.ruler = false -- Disable native ruler (NvChad statusline shows position)
|
||||
vim.opt.cmdheight = 0 -- Hide command line when not in use
|
||||
vim.opt.laststatus = 3 -- Global statusline at the very bottom
|
||||
vim.opt.fillchars = { vert = "│", fold = "─", foldsep = "│", diff = "─" }
|
||||
|
||||
-- Keymaps
|
||||
vim.keymap.set("n", "<leader>q", ":q<CR>", { desc = "Quit" })
|
||||
|
||||
-- Buffer navigation (using native commands since tabufline is disabled)
|
||||
vim.keymap.set("n", "<Tab>", "<cmd>bnext<CR>", { desc = "Next buffer" })
|
||||
vim.keymap.set("n", "<S-Tab>", "<cmd>bprev<CR>", { desc = "Previous buffer" })
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>bdelete<CR>", { desc = "Close buffer" })
|
||||
vim.keymap.set("n", "<leader>b", "<cmd>enew<CR>", { desc = "New buffer" })
|
||||
|
||||
-- Load plugins
|
||||
require("lazy").setup("plugins", {
|
||||
defaults = { lazy = true },
|
||||
|
|
@ -79,10 +48,5 @@ require("lazy").setup("plugins", {
|
|||
},
|
||||
})
|
||||
|
||||
-- Load NvChad base46 highlights (safe load)
|
||||
local cache = vim.g.base46_cache
|
||||
if vim.uv.fs_stat(cache) then
|
||||
for _, v in ipairs(vim.fn.readdir(cache)) do
|
||||
dofile(cache .. v)
|
||||
end
|
||||
end
|
||||
-- Setup custom statusline
|
||||
require("config.statusline").setup()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue