2022-10-18 10:24:17 +02:00
|
|
|
pcall(require, "impatient")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-12-22 00:13:52 +01:00
|
|
|
vim.g.mapleader = " "
|
|
|
|
-- netrw is handled by nvim-tree
|
|
|
|
vim.g.loaded_netrw = 1
|
|
|
|
vim.g.loaded_netrwPlugin = 1
|
2022-08-21 20:14:59 +02:00
|
|
|
-- true colors
|
|
|
|
vim.o.termguicolors = true
|
2022-10-21 16:55:18 +02:00
|
|
|
vim.o.cmdheight = 0
|
2022-08-21 20:14:59 +02:00
|
|
|
-- line numbers
|
2022-12-22 00:13:52 +01:00
|
|
|
vim.o.mouse = "nv"
|
2022-08-21 20:14:59 +02:00
|
|
|
vim.o.number = true
|
|
|
|
vim.o.relativenumber = true
|
|
|
|
-- scroll offsets
|
|
|
|
vim.o.scrolloff = 5
|
|
|
|
vim.o.sidescrolloff = 15
|
|
|
|
-- always show status & tab line
|
|
|
|
vim.o.laststatus = 3
|
|
|
|
vim.o.showtabline = 2
|
2022-11-07 11:57:53 +01:00
|
|
|
vim.g.termguicolors = false
|
2022-08-21 20:14:59 +02:00
|
|
|
-- completion height
|
|
|
|
vim.o.pumheight = 15
|
|
|
|
-- split directions
|
|
|
|
vim.o.splitbelow = true
|
|
|
|
vim.o.splitright = true
|
2022-11-02 16:50:16 +01:00
|
|
|
vim.o.wrap = false
|
2023-02-10 10:17:57 +01:00
|
|
|
-- redefine word boundaries - '_' is a word separator, this helps with snake_case
|
2022-08-21 20:14:59 +02:00
|
|
|
vim.opt.iskeyword:remove("_")
|
2022-07-30 07:17:12 +02:00
|
|
|
-- indentations settings
|
2022-08-21 20:14:59 +02:00
|
|
|
vim.o.shiftwidth = 2
|
|
|
|
vim.o.tabstop = 2
|
2022-10-17 17:13:31 +02:00
|
|
|
vim.o.softtabstop = 0
|
2022-08-21 20:14:59 +02:00
|
|
|
vim.o.expandtab = true
|
2023-02-11 10:15:48 +01:00
|
|
|
vim.o.signcolumn = "yes:1"
|
2023-02-12 08:05:51 +01:00
|
|
|
vim.opt.shortmess:append("sI")
|
2023-02-09 16:42:53 +01:00
|
|
|
-- double box drawing characters for splits
|
|
|
|
vim.opt.fillchars:append({
|
|
|
|
horiz = "═",
|
|
|
|
horizup = "╩",
|
|
|
|
horizdown = "╦",
|
|
|
|
vert = "║",
|
|
|
|
vertright = "╠",
|
|
|
|
vertleft = "╣",
|
|
|
|
verthoriz = "╬",
|
|
|
|
})
|
2022-12-01 18:00:39 +01:00
|
|
|
|
2022-12-22 00:13:52 +01:00
|
|
|
pcall(require, "plugins")
|
|
|
|
pcall(require, "binds")
|
2022-12-01 18:00:39 +01:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
vim.api.nvim_create_autocmd("VimResized", {
|
|
|
|
pattern = "*",
|
|
|
|
command = "wincmd =",
|
|
|
|
desc = "Automatically resize windows when the host window size changes.",
|
2022-07-30 07:17:12 +02:00
|
|
|
})
|
2022-11-16 14:46:41 +01:00
|
|
|
|
2022-10-17 17:13:31 +02:00
|
|
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
|
|
|
pattern = "*",
|
|
|
|
callback = function()
|
|
|
|
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 200 })
|
|
|
|
end,
|
|
|
|
desc = "Highlight yanked text",
|
|
|
|
})
|
2022-11-15 20:30:50 +01:00
|
|
|
|
2022-11-16 14:46:41 +01:00
|
|
|
local trnuGroup = vim.api.nvim_create_augroup("toggleRnu", {})
|
|
|
|
vim.api.nvim_create_autocmd("InsertEnter,BufLeave,WinLeave,FocusLost", {
|
|
|
|
callback = function()
|
|
|
|
vim.opt_local.relativenumber = false
|
|
|
|
end,
|
|
|
|
group = trnuGroup,
|
|
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("InsertLeave,BufEnter,WinEnter,FocusGained", {
|
|
|
|
callback = function()
|
|
|
|
vim.opt_local.relativenumber = true
|
|
|
|
end,
|
|
|
|
group = trnuGroup,
|
|
|
|
})
|
2023-02-20 20:57:05 +01:00
|
|
|
|
|
|
|
if vim.g.neovide then
|
|
|
|
vim.g.neovide_refresh_rate = 60
|
|
|
|
vim.g.neovide_refresh_rate_idle = 5
|
|
|
|
vim.g.neovide_cursor_vfx_mode = "ripple"
|
|
|
|
vim.g.neovide_scroll_animation_length = 0.3
|
2023-02-25 03:46:10 +01:00
|
|
|
vim.g.neovide_input_macos_alt_is_meta = true
|
|
|
|
vim.g.neovide_hide_mouse_when_typing = true
|
2023-02-25 16:42:13 +01:00
|
|
|
vim.keymap.set(
|
|
|
|
"n",
|
|
|
|
"<M-CR>",
|
|
|
|
":let g:neovide_fullscreen = !g:neovide_fullscreen<CR>",
|
|
|
|
{
|
|
|
|
noremap = true,
|
|
|
|
silent = true,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
vim.opt.guifont = { "BerkeleyMono Nerd Font", "h14", "#e-subpixelantialias" }
|
2023-02-20 20:57:05 +01:00
|
|
|
end
|