Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
92 lines (72 loc) · 2.3 KB
/
Copy pathinit.lua
File metadata and controls
92 lines (72 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.smartindent = true
-- Treat underscores as word boundaries.
vim.opt.iskeyword:remove '_'
vim.opt.breakindent = true
-- Defer clipboard integration so its provider does not delay startup.
vim.schedule(function()
vim.opt.clipboard = 'unnamedplus'
end)
vim.opt.winborder = 'rounded'
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.list = true
vim.opt.listchars = {
trail = '·',
extends = '»',
precedes = '«',
nbsp = '␣',
tab = ' ',
}
vim.opt.shortmess:append 'I'
-- Noice provides transient command and message UI without reserving a row.
vim.opt.cmdheight = 0
vim.opt.ruler = false
-- Keep the default view quiet; <leader>ul enables both number styles.
vim.opt.number = false
vim.opt.relativenumber = false
vim.opt.undofile = true
-- Uppercase characters in the query make searches case-sensitive.
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.scrolloff = 10
-- Reserve sign space to prevent layout shifts from diagnostics and diffs.
vim.opt.signcolumn = 'yes'
vim.opt.smoothscroll = true
-- Navigate jumps as a stack, like browser history.
vim.opt.jumpoptions = 'stack'
vim.opt.updatetime = 250
vim.opt.timeoutlen = 300
vim.opt.inccommand = 'nosplit'
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking text',
group = vim.api.nvim_create_augroup('petar-highlight-yank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
vim.api.nvim_create_autocmd('BufReadPost', {
desc = 'Restore cursor position',
group = vim.api.nvim_create_augroup('petar-restore-cursor', { clear = true }),
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local line_count = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= line_count then
vim.api.nvim_win_set_cursor(0, mark)
end
end,
})
-- Pick up edits made by tools outside Neovim.
vim.opt.autoread = true
vim.api.nvim_create_autocmd({ 'FocusGained', 'BufEnter', 'CursorHold' }, {
desc = 'Reload files changed outside Neovim',
group = vim.api.nvim_create_augroup('petar-file-watcher', { clear = true }),
command = 'silent! checktime',
})
require 'config.keybindings'
require 'config.lazy'