nvim: bootstrap minimal nix-first config
This commit is contained in:
parent
8a2e735875
commit
d90c74150f
14 changed files with 557 additions and 12 deletions
9
.config/nvim/lua/config/autocmds.lua
Normal file
9
.config/nvim/lua/config/autocmds.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local group = vim.api.nvim_create_augroup("user-autocmds", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = group,
|
||||
desc = "Highlight on yank",
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
10
.config/nvim/lua/config/keymaps.lua
Normal file
10
.config/nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clear search highlight" })
|
||||
map("n", "<leader>w", "<cmd>write<cr>", { desc = "Write buffer" })
|
||||
map("n", "<leader>q", "<cmd>quit<cr>", { desc = "Quit window" })
|
||||
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||
37
.config/nvim/lua/config/lazy.lua
Normal file
37
.config/nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
local output = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", repo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ output, "WarningMsg" },
|
||||
}, true, {})
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
install = {
|
||||
colorscheme = { "habamax", "tokyonight" },
|
||||
},
|
||||
checker = { enabled = false },
|
||||
change_detection = { notify = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
22
.config/nvim/lua/config/options.lua
Normal file
22
.config/nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local opt = vim.opt
|
||||
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.mouse = "a"
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
opt.expandtab = true
|
||||
opt.termguicolors = true
|
||||
opt.signcolumn = "yes"
|
||||
opt.updatetime = 250
|
||||
opt.timeoutlen = 300
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
opt.scrolloff = 4
|
||||
opt.cursorline = true
|
||||
opt.wrap = false
|
||||
opt.undofile = true
|
||||
opt.clipboard = "unnamedplus"
|
||||
opt.completeopt = { "menu", "menuone", "noselect" }
|
||||
Loading…
Add table
Add a link
Reference in a new issue