feat: config refresh
This commit is contained in:
parent
a24128cfca
commit
f956194c53
16 changed files with 217 additions and 233 deletions
19
lua/config/autocmds.lua
Normal file
19
lua/config/autocmds.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("wf_" .. name, { clear = true })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("spellcheck"),
|
||||
pattern = { "gitcommit", "markdown", "md", "mdx" },
|
||||
callback = function()
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("prose"),
|
||||
pattern = { "gitcommit", "markdown", "md", "mdx" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
end,
|
||||
})
|
12
lua/config/keybinds.lua
Normal file
12
lua/config/keybinds.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
vim.keymap.set("n", "<C-h>", "<cmd>wincmd h<CR>", { desc = "Go to split on left" })
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>wincmd j<CR>", { desc = "Go to split above" })
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>wincmd k<CR>", { desc = "Go to split below" })
|
||||
vim.keymap.set("n", "<C-l>", "<cmd>wincmd l<CR>", { desc = "Go to split on right" })
|
||||
|
||||
vim.keymap.set("n", "<leader>|", "<C-w>v", { desc = "Split window right" })
|
||||
vim.keymap.set("n", "<leader>-", "<C-w>s", { desc = "Split window below" })
|
||||
vim.keymap.set("n", "<leader>wd", "<C-w>c", { desc = "Delete window" })
|
||||
|
||||
vim.keymap.set("n", "<Leader>y", '"*y', { desc = "Yank into system clipboard" })
|
||||
vim.keymap.set("v", "<Leader>y", '"*y', { desc = "Yank into system clipboard" })
|
||||
|
35
lua/config/lazy.lua
Normal file
35
lua/config/lazy.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
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)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
46
lua/config/options.lua
Normal file
46
lua/config/options.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.opt.belloff = "all"
|
||||
vim.opt.backspace = "2"
|
||||
vim.opt.showcmd = true
|
||||
vim.opt.laststatus = 3 -- global status bar
|
||||
vim.opt.swapfile = false
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.smarttab = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.copyindent = true
|
||||
|
||||
vim.opt.scrolloff = 2
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.wrap = false
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.cmdheight = 2
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.fillchars = {
|
||||
foldopen = "",
|
||||
foldclose = "",
|
||||
-- fold = "⸱",
|
||||
fold = " ",
|
||||
foldsep = " ",
|
||||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
|
||||
vim.opt.foldlevel = 99
|
||||
vim.opt.foldmethod = "indent"
|
||||
|
||||
vim.opt.termguicolors = true
|
Loading…
Add table
Add a link
Reference in a new issue