-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
74 lines (61 loc) · 2.07 KB
/
init.lua
File metadata and controls
74 lines (61 loc) · 2.07 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
-- Indentation
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.o.signcolumn = "yes"
vim.o.winborder = "rounded"
-- Disable swapfile
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undofile = true
-- UI
vim.opt.termguicolors = true
vim.opt.showmode = false
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.clipboard = "unnamed"
-- Misc
vim.opt.updatetime = 250
vim.opt.timeoutlen = 300
vim.opt.autoread = false
-- Better search
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.incsearch = true
-- Better splitting
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.keymap.set("n", "<leader>f", ":lua vim.diagnostic.open_float()<CR>")
vim.keymap.set("n", "tt", ":TailwindFoldToggle<CR>")
-- Prompt to reload buffers changed outside Neovim.
-- Running :checktime on focus/enter keeps detection automatic without requiring :e.
local external_change_group = vim.api.nvim_create_augroup("ExternalFileChanges", { clear = true })
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
group = external_change_group,
callback = function()
if vim.fn.mode() ~= "c" then
vim.cmd("checktime")
end
end,
})
-- Plugin management
require("config.lazy")
require("config.buffer-queue")
-- Colorscheme
vim.cmd([[colorscheme vscode]])
-- Diagnostic keymaps
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, { desc = "Open diagnostic" })
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
-- Folding
vim.o.foldmethod = "indent"
vim.o.foldlevel = 99
vim.opt.foldenable = true
-- Better navigation
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y', { desc = "Yank to system clipboard" })
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p', { desc = "Paste from system clipboard" })
-- vim.keymap.set('n','<c-k>',':wincmd k<CR>')
-- vim.keymap.set('n','<c-j>',':wincmd j<CR>')
-- vim.keymap.set('n','<c-h>',':wincmd h<CR>')
-- vim.keymap.set('n','<c-l>',':wincmd l<CR>')