-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
72 lines (66 loc) · 1.81 KB
/
init.lua
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
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local out = vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--branch=stable",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
change_detection = {
enabled = true,
notify = false,
}
})
require("diagnostics")
require('title')
-- look and feel
vim.opt.cursorline = true
vim.opt.number = true
vim.opt.wildmenu = true
vim.opt.wildmode = "longest,list,list,full"
vim.opt.mouse = "a"
vim.opt.mousemodel = "extend"
vim.opt.timeoutlen = 500
vim.opt.updatetime = 500
vim.opt.inccommand = "split"
vim.opt.scrolloff = 8
vim.opt.relativenumber = true
vim.opt.showmode = false
vim.opt.fillchars = {
foldopen = "",
foldsep = "│",
foldclose = "",
fold = ' ',
diff = "╱",
}
vim.keymap.set('n', '<F2>', function() vim.o.cursorcolumn = not vim.o.cursorcolumn end, { expr = true })
-- Remove both the character under the cursor and its match
vim.keymap.set('n', '<leader>x', function()
local col = vim.api.nvim_win_get_cursor(0)[2]
local char = string.sub(vim.api.nvim_get_current_line(), col + 1, col + 1)
if string.find([[ ([< ]], char, 1, true) then
vim.api.nvim_feedkeys("mm%x`mx", 'n', true)
elseif string.find([[ )]> ]], char, 1, true) then
vim.api.nvim_feedkeys("%mm%x`mx", 'n', true)
end
end)
require('folds')
require('readline').set()
require('filetypes')
require('commands')
require('playgrounds')
vim.cmd [[ source ~/.config/nvim/legacy.vim ]]