Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
96 lines (78 loc) · 2.36 KB
/
Copy pathinit.lua
File metadata and controls
96 lines (78 loc) · 2.36 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
--Load core configuration
require("core")
-- Initialize vim.opt as a Lua table
vim.opt = vim.opt or {}
vim.opt.sessionoptions:remove("folds")
vim.opt.termguicolors = true
vim.opt.signcolumn = "yes"
vim.lsp.set_log_level("ERROR") -- or "OFF"
vim.g.floaterm_width = 0.8
vim.g.floaterm_height = 0.9
vim.g.floaterm_title = "devil($1/$2)"
vim.g.floaterm_borderchars = "─│─│╭╮╯╰"
-- Define CPTemplate command
--vim.cmd([[
--command! -nargs=1 CPTemplate lua require('cp_templates').insert_template(<f-args>)
--]])
-- Fix virtualedit being silently set after session restore for cpp files
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*.cpp",
callback = function()
vim.schedule(function()
if vim.opt.virtualedit:get() ~= "" then
vim.opt.virtualedit = ""
vim.opt.startofline = true
vim.cmd("normal! 0") -- move cursor to column 0
end
end)
end,
})
-- Define lazypath
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-- Check if lazypath exists, if not, clone lazy.nvim from GitHub
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
-- Prepend lazypath
vim.opt.rtp:prepend(lazypath)
-- Load plugins configuration
require("plugins")
-- Load vim options configuration
--require("vim-options")
--Load keymaps configuration
--require("keymaps")
-- ─────────────────── Load cp_templates configuration ───────────────────
local cp_templates = require("cp_templates")
-- Setup the module (optional, if you want to change default config)
cp_templates.setup({
-- Your custom config here
})
--cp_testcases config
require("cp_testcases").setup()
-- Define commands
vim.api.nvim_create_user_command("CPTemplate", function(opts)
if opts.args ~= "" then
cp_templates.insert_template(opts.args)
else
cp_templates.select_and_insert_template()
end
end, { nargs = "?" })
--------------------------------------------------------------------------
-- Load lazy.nvim with plugins
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" } }, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})
--------------------------------------------------