-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
101 lines (93 loc) · 3.81 KB
/
Copy pathinit.lua
File metadata and controls
101 lines (93 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
-- Neovim config — symlinked to ~/.config/nvim/init.lua
-- Replicates the capabilities shown in Kun's video: relative numbers,
-- Space-f (find files) and Space-s (live grep) via Telescope, rose-pine theme.
-- ── Leader (must be set before plugins/keymaps) ──────────────
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- ── Core options ─────────────────────────────────────────────
local o = vim.opt
o.number = true
o.relativenumber = true -- relative numbers (the "11k to jump" trick from the video)
o.mouse = "a"
o.clipboard = "unnamedplus" -- system clipboard
o.termguicolors = true -- truecolor (pairs with tmux RGB override)
o.ignorecase = true
o.smartcase = true
o.expandtab = true
o.shiftwidth = 2
o.tabstop = 2
o.smartindent = true
o.wrap = false
o.scrolloff = 8
o.signcolumn = "yes"
o.undofile = true
o.splitright = true
o.splitbelow = true
o.updatetime = 250
o.timeoutlen = 400
-- ── Non-plugin keymaps ───────────────────────────────────────
local map = vim.keymap.set
map("n", "<leader>w", "<cmd>write<cr>", { desc = "Save" })
map("n", "<leader>q", "<cmd>quit<cr>", { desc = "Quit" })
map("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clear search highlight" })
map("n", "<C-h>", "<C-w>h"); map("n", "<C-j>", "<C-w>j")
map("n", "<C-k>", "<C-w>k"); map("n", "<C-l>", "<C-w>l")
map("v", "J", ":m '>+1<cr>gv=gv", { desc = "Move selection down" })
map("v", "K", ":m '<-2<cr>gv=gv", { desc = "Move selection up" })
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Briefly highlight yanked text",
callback = function() (vim.hl or vim.highlight).on_yank() end,
})
-- ── Bootstrap lazy.nvim (plugin manager) ─────────────────────
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- ── Plugins ──────────────────────────────────────────────────
require("lazy").setup({
-- Theme (matches the WezTerm rose-pine scheme)
{
"rose-pine/neovim",
name = "rose-pine",
priority = 1000,
config = function()
require("rose-pine").setup({ variant = "moon" })
vim.cmd.colorscheme("rose-pine-moon")
end,
},
-- Fuzzy finder: the Space-f / Space-s workflow from the video
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local builtin = require("telescope.builtin")
map("n", "<leader>f", builtin.find_files, { desc = "Find files" })
map("n", "<leader>s", builtin.live_grep, { desc = "Search (grep) in project" })
map("n", "<leader>b", builtin.buffers, { desc = "Open buffers" })
map("n", "<leader>h", builtin.help_tags, { desc = "Help tags" })
end,
},
-- Treesitter syntax. Parsers are compiled on demand (needs a C compiler);
-- none are forced at install time so first sync stays fast.
{
"nvim-treesitter/nvim-treesitter",
branch = "master", -- classic API; the new `main` branch dropped .configs
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {}, -- add languages as you need them: :TSInstall lua
auto_install = false,
highlight = { enable = true },
})
end,
},
}, {
-- lazy.nvim options
install = { colorscheme = { "rose-pine-moon" } },
checker = { enabled = false },
})