dotfiles/nvim/.config/nvim/init.lua

58 lines
1.4 KiB
Lua

vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.g.have_nerd_font = true
require("project_dotfiles_autocommands")
require("options.default")
require("lazy_bootstrap")
require("lazy").setup({ { import = "plugins" } })
require("prose_mode")
--BG HACKS
vim.api.nvim_create_autocmd({ "BufEnter", "BufCreate", "BufAdd" }, {
callback = function()
local buftype = vim.bo.buftype
if buftype == "help" then
--print("This Window is bufType:" .. buftype)
vim.o.winhl = "Normal:CursorColumn"
else
vim.o.winhl = "Normal:Normal"
end
end,
})
require("keymaps")
vim.cmd("colorscheme rose-pine")
--CMD LINE HACKS
vim.opt.cmdheight = 0
vim.api.nvim_create_autocmd({ "RecordingEnter" }, {
callback = function()
vim.opt.cmdheight = 1
end,
})
vim.api.nvim_create_autocmd({ "RecordingLeave" }, {
callback = function()
vim.opt.cmdheight = 0
end,
})
--formatted cwd function
vim.api.nvim_create_autocmd({ "DirChanged", "VimEnter" }, {
callback = function()
local cwdString = vim.fn.getcwd()
local length = cwdString:len()
local _, j = string.find(cwdString, "/home/andrzej/")
if j ~= nil then
cwdString = "~" .. string.sub(cwdString, j, length)
length = cwdString:len()
end
length = cwdString:len()
local desiredLength = 40
if desiredLength < length then
vim.g.cwdShortened = "..." .. cwdString:sub(length - 16, length)
else
vim.g.cwdShortened = cwdString
end
end,
})