2022-04-29 11:40:44 +00:00
|
|
|
if require("esensar.init.first_load")() then
|
2022-04-28 13:53:54 +00:00
|
|
|
return
|
2021-02-23 11:27:32 +00:00
|
|
|
end
|
|
|
|
|
2021-11-05 19:58:26 +00:00
|
|
|
-- Allow `require('impatient')` to fail, in case plugins are not yet installed
|
2022-04-29 07:46:45 +00:00
|
|
|
local _ = pcall(require, "impatient")
|
2021-11-05 19:58:26 +00:00
|
|
|
|
2022-04-28 13:53:54 +00:00
|
|
|
vim.cmd([[filetype plugin indent on]])
|
2021-03-30 14:17:37 +00:00
|
|
|
|
2021-02-23 11:27:32 +00:00
|
|
|
vim.api.nvim_exec('let $OVIMHOME = $HOME."/.vim"', false)
|
|
|
|
vim.api.nvim_exec('let $VIMHOME = $HOME."/.config/nvim"', false)
|
|
|
|
vim.api.nvim_exec('let $NVIMHOME = $HOME."/.local/share/nvim"', false)
|
2022-05-08 15:37:20 +00:00
|
|
|
vim.api.nvim_exec('let $VIMPLUGINS = expand($VIMHOME."/lua/esensar/init/plugins.lua")', false)
|
2021-02-23 11:27:32 +00:00
|
|
|
|
|
|
|
-- Leader config to <Space>
|
2021-12-02 15:12:10 +00:00
|
|
|
vim.g.mapleader = " "
|
2022-05-04 12:06:58 +00:00
|
|
|
vim.g.maplocalleader = " "
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2022-04-29 11:40:44 +00:00
|
|
|
require("esensar.init.plugins")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2022-04-29 11:40:44 +00:00
|
|
|
require("esensar.init.options")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2022-04-29 11:40:44 +00:00
|
|
|
require("esensar.lsp")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
|
|
|
-- Colorscheme
|
2021-12-02 15:12:10 +00:00
|
|
|
vim.cmd("syntax on")
|
2022-04-29 11:40:44 +00:00
|
|
|
require("esensar.init.colors")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2022-04-28 13:53:54 +00:00
|
|
|
vim.keymap.set("n", "Q", "gq", { noremap = false })
|
2022-04-27 14:07:16 +00:00
|
|
|
vim.keymap.set("i", "<C-U>", "<C-G>u<C-U>")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2021-12-02 15:12:10 +00:00
|
|
|
vim.cmd("command! Wq :wq")
|
|
|
|
vim.cmd("command! W :w")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
2022-04-27 14:07:16 +00:00
|
|
|
vim.keymap.set("n", "<Leader>c", ":ccl <bar> lcl<CR>")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
|
|
|
-- Allow recursive searches
|
2021-12-02 15:12:10 +00:00
|
|
|
vim.cmd("set path+=**")
|
2021-02-23 11:27:32 +00:00
|
|
|
|
|
|
|
-- automatically rebalance windows on vim resize
|
2021-12-02 15:12:10 +00:00
|
|
|
vim.cmd("autocmd VimResized * :wincmd =")
|
2022-05-08 15:37:20 +00:00
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("EditConfigInitLua", function()
|
|
|
|
vim.cmd("edit $VIMHOME/init.lua")
|
|
|
|
end, {})
|
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("EditConfigPlugins", function()
|
|
|
|
vim.cmd("edit $VIMPLUGINS")
|
|
|
|
end, {})
|