-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
99 lines (87 loc) · 2.52 KB
/
Copy pathinit.lua
File metadata and controls
99 lines (87 loc) · 2.52 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
93
94
95
96
97
98
99
require("core.options")
require("core.keymaps")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
error("Error cloning lazy.nvim:\n" .. out)
end
end
vim.opt.rtp:prepend(lazypath)
if vim.fn.has("wsl") == 1 then
vim.g.clipboard = {
name = "win32yank",
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
cache_enabled = 0,
}
end
vim.opt.clipboard = "unnamedplus"
vim.opt.foldmethod = "manual"
vim.opt.foldenable = true
vim.opt.foldlevel = 0
vim.opt.foldminlines = 1
vim.opt.viewoptions:append("folds")
-- vim.keymap.set("n", "<leader>dd", vim.diagnostic.setloclist, { desc = "Show diagnostics" })
vim.api.nvim_create_autocmd({ "BufWinLeave" }, {
pattern = "*",
callback = function()
if vim.fn.empty(vim.fn.expand("%")) == 0 and vim.bo.buftype == "" then
pcall(function()
vim.cmd("mkview")
end)
end
end,
})
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
pattern = "*",
callback = function()
if vim.fn.empty(vim.fn.expand("%")) == 0 and vim.bo.buftype == "" then
pcall(function()
vim.cmd("silent! loadview")
end)
end
end,
})
require("lazy").setup({
require("plugins.neotree"),
require("plugins.colortheme"),
require("plugins.bufferline"),
require("plugins.lualine"),
require("plugins.treesitter"),
require("plugins.treesitter-context"),
require("plugins.telescope"),
require("plugins.lsp"),
require("plugins.autocompletion"),
require("plugins.none-ls"),
require("plugins.gitsigns"),
require("plugins.ascii"),
require("plugins.alpha"),
require("plugins.indent-blankline"),
require("plugins.misc"),
require("plugins.comment"),
require("plugins.harpoon"),
require("plugins.toggleterm"),
require("plugins.notification"),
require("plugins.trouble"),
require("plugins.screenkey"),
require("plugins.discord_presence"),
require("plugins.markdown-renderer"),
})
vim.cmd([[colorscheme tokyonight-night]])
require("core.plugin-mappings")
vim.g.tmux_navigator_no_mappings = 1
function _G.unmap_tmux_key()
vim.api.nvim_del_keymap("n", "<C-\\>")
vim.api.nvim_del_keymap("t", "<C-\\>")
vim.api.nvim_del_keymap("n", "<C-H>")
vim.api.nvim_del_keymap("t", "<C-H>")
end
vim.treesitter.language.register("tsx", "typescriptreact")