2022-07-30 07:17:12 +02:00
|
|
|
-- vim:fdm=marker
|
|
|
|
pcall(require, "impatient")
|
2022-08-21 20:14:59 +02:00
|
|
|
pcall(require, "plugins")
|
2022-07-31 04:49:11 +02:00
|
|
|
pcall(require, "lsp")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-08-21 20:14:59 +02:00
|
|
|
-- true colors
|
|
|
|
vim.o.termguicolors = true
|
|
|
|
-- map leader to space
|
2022-07-30 07:17:12 +02:00
|
|
|
vim.g.mapleader = " "
|
2022-08-21 20:14:59 +02:00
|
|
|
-- allow mouse in normal/visual mode
|
|
|
|
vim.o.mouse = "nv"
|
|
|
|
-- line numbers
|
|
|
|
vim.o.number = true
|
|
|
|
vim.o.relativenumber = true
|
|
|
|
vim.o.numberwidth = 5
|
|
|
|
-- scroll offsets
|
|
|
|
vim.o.scrolloff = 5
|
|
|
|
vim.o.sidescrolloff = 15
|
|
|
|
-- show leading/trailing whitespace
|
|
|
|
vim.o.list = true
|
|
|
|
-- always show status & tab line
|
|
|
|
vim.o.laststatus = 3
|
|
|
|
vim.o.showtabline = 2
|
|
|
|
-- completion height
|
|
|
|
vim.o.pumheight = 15
|
|
|
|
-- split directions
|
|
|
|
vim.o.splitbelow = true
|
|
|
|
vim.o.splitright = true
|
2022-07-30 07:17:12 +02:00
|
|
|
-- redefine word boundaries - '_' is a word seperator, 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
|
|
|
|
|
|
|
-- easier split navigation
|
2022-08-21 20:14:59 +02:00
|
|
|
Nmap("<C-J>", "<C-W>j")
|
|
|
|
Nmap("<C-K>", "<C-W>k")
|
|
|
|
Nmap("<C-L>", "<C-W>l")
|
|
|
|
Nmap("<C-H>", "<C-W>h")
|
2022-07-30 07:17:12 +02:00
|
|
|
-- escape :terminal easier
|
|
|
|
vim.cmd([[tnoremap <Esc> <C-\><C-n>]])
|
|
|
|
|
|
|
|
-- indentations settings
|
2022-08-21 20:14:59 +02:00
|
|
|
vim.o.shiftwidth = 2
|
|
|
|
vim.o.tabstop = 2
|
|
|
|
vim.o.softtabstop = 2
|
|
|
|
vim.o.expandtab = true
|
2022-07-30 07:17:12 +02:00
|
|
|
-- indentation autocmds for some filetypes
|
|
|
|
vim.cmd([[
|
|
|
|
" smol spaces for soydev
|
|
|
|
autocmd FileType html,css,js,jsreact,ts,tsreact,json,yaml setlocal ts=2 sw=2 sts=0 et
|
|
|
|
" Tabs, yikes
|
|
|
|
autocmd FileType go,lua setlocal ts=4 sw=4 sts=4 noet
|
|
|
|
" Spaces, based languages
|
|
|
|
autocmd FileType python,rust setlocal ts=4 sw=4 sts=4 et
|
2022-08-21 20:14:59 +02:00
|
|
|
autocmd FileType markdown let g:table_mode_corner='|'
|
2022-07-30 07:17:12 +02:00
|
|
|
]])
|
|
|
|
|
2022-08-21 20:14:59 +02:00
|
|
|
-- auto-compile when lua files in `~/.config/nvim/*` change
|
2022-07-30 07:17:12 +02:00
|
|
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
|
|
pattern = "*.lua",
|
|
|
|
callback = function()
|
2022-08-21 20:14:59 +02:00
|
|
|
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
2022-07-30 07:17:12 +02:00
|
|
|
vim.defer_fn(function()
|
2022-08-21 20:14:59 +02:00
|
|
|
if vim.fn.expand("%:p"):match(cfg_path) then
|
|
|
|
vim.cmd("silent! PackerCompile")
|
2022-07-30 07:17:12 +02:00
|
|
|
end
|
|
|
|
end, 0)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2022-08-21 20:14:59 +02:00
|
|
|
-- neovide settings {{{
|
2022-07-30 07:17:12 +02:00
|
|
|
if vim.g.neovide then
|
|
|
|
vim.cmd("cd $HOME")
|
|
|
|
vim.g.neovide_cursor_vfx_mode = "ripple"
|
|
|
|
vim.g.neovide_input_macos_alt_is_meta = true
|
|
|
|
vim.o.guifont = "VictorMono Nerd Font:h18"
|
|
|
|
end
|
2022-08-21 20:14:59 +02:00
|
|
|
-- }}}
|