2024-10-10 00:21:39 -07:00
|
|
|
require("keymaps")
|
2024-10-09 17:13:16 -07:00
|
|
|
require("plugins")
|
|
|
|
|
2024-10-10 00:21:39 -07:00
|
|
|
require("scripts.autoroot")
|
|
|
|
|
2024-10-09 17:13:16 -07:00
|
|
|
vim.opt.relativenumber = true
|
|
|
|
vim.opt.number = true
|
|
|
|
|
|
|
|
-- Global statusline
|
|
|
|
vim.opt.laststatus = 3
|
|
|
|
-- Persistent undos across session
|
|
|
|
vim.opt.undofile = true
|
|
|
|
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
vim.opt.shiftwidth = 2
|
|
|
|
|
|
|
|
vim.treesitter.indent = true
|
|
|
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
|
|
|
vim.opt.foldmethod = "expr"
|
|
|
|
vim.opt.foldenable = false
|
|
|
|
|
2024-10-10 00:21:39 -07:00
|
|
|
vim.cmd.colorscheme("rose-pine")
|
|
|
|
|
2024-10-10 13:36:56 -07:00
|
|
|
require("nvim-treesitter.configs").setup({
|
2024-10-10 00:21:39 -07:00
|
|
|
ensure_installed = {},
|
|
|
|
sync_install = false,
|
|
|
|
auto_install = false,
|
2024-10-10 13:36:56 -07:00
|
|
|
modules = { "highlight", "incremental_selection", "indent" },
|
2024-10-10 00:21:39 -07:00
|
|
|
ignore_install = {},
|
|
|
|
highlight = { enable = true },
|
|
|
|
disable = function(_, buf)
|
2024-10-10 13:36:56 -07:00
|
|
|
local max_filesize = 100 * 1024 -- 100 KB
|
|
|
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
|
|
if ok and stats and stats.size > max_filesize then
|
|
|
|
return true
|
|
|
|
end
|
2024-10-10 00:21:39 -07:00
|
|
|
end,
|
2024-10-10 13:36:56 -07:00
|
|
|
additional_vim_regex_highlighting = false,
|
|
|
|
incremental_selection = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
init_selection = "<CR>",
|
|
|
|
node_incremental = "<C-k>",
|
|
|
|
scope_incremental = "<BS>",
|
|
|
|
node_decremental = "<C-j>",
|
|
|
|
},
|
|
|
|
},
|
2024-10-10 00:21:39 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd({
|
|
|
|
"TermOpen",
|
|
|
|
}, {
|
|
|
|
group = vim.api.nvim_create_augroup("terminal", {}),
|
|
|
|
callback = function()
|
2024-10-10 13:36:56 -07:00
|
|
|
vim.cmd("setlocal nonumber norelativenumber")
|
2024-10-10 00:21:39 -07:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
|
|
|
callback = function()
|
2024-10-10 13:36:56 -07:00
|
|
|
vim.highlight.on_yank({ higroup = "Visual", timeout = 300 })
|
2024-10-10 00:21:39 -07:00
|
|
|
end,
|
|
|
|
})
|