-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
124 lines (111 loc) · 3.58 KB
/
Copy pathinit.lua
File metadata and controls
124 lines (111 loc) · 3.58 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
}, lazy_config)
-- nvim-tree setup
require("nvim-tree").setup {
renderer = {
-- highlight_git = true,
-- Autres options de rendu...
},
view = {
side = "left",
signcolumn = "no",
},
actions = {
open_file = {
quit_on_open = true,
},
},
update_focused_file = {
enable = true,
update_cwd = false,
ignore_list = {},
},
}
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds"
require "options"
require "mappings"
require "autocmds"
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
-- Permet de surligner les balises personnalisées Angular
additional_vim_regex_highlighting = true,
},
}
-- cmp
local cmp = require "cmp"
cmp.setup {
completion = {
autocomplete = { require("cmp.types").cmp.TriggerEvent.TextChanged },
},
mapping = cmp.mapping.preset.insert {
-- ["<leader>p"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm { select = true },
["<Tab>"] = cmp.mapping(function(fallback)
local copilot_suggestion = require "copilot.suggestion"
-- Vérifier d'abord si Copilot a une suggestion
if copilot_suggestion.is_visible() then
print "Suggestion acceptée : Copilot"
copilot_suggestion.accept()
-- Sinon, comportement par défaut
else
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Tab>", true, true, true), "n", true)
end
end, { "i", "s" }),
},
sources = cmp.config.sources {
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "path" },
},
}
-- Toggleterm
require("toggleterm").setup()
-- surround
require("mini.surround").setup()
-- Ajout de couleurs a diffview
vim.opt.fillchars:append { diff = "/" }
vim.api.nvim_set_hl(0, "DiffviewDiffAdd", { bg = "#003025" })
vim.api.nvim_set_hl(0, "DiffAdd", { bg = "#003025" })
vim.api.nvim_set_hl(0, "DiffviewDiffAddAsDelete", { bg = "#400000" })
vim.api.nvim_set_hl(0, "DiffAddAsDelete", { bg = "#400000" })
vim.api.nvim_set_hl(0, "DiffviewDiffDelete", { bg = "#400000" }) --, fg = "#200000" })
vim.api.nvim_set_hl(0, "DiffDelete", { bg = "#400000" }) --, fg = "#200000" })
vim.api.nvim_set_hl(0, "DiffviewDiffChange", { bg = "#002030" })
vim.api.nvim_set_hl(0, "DiffChange", { bg = "#002030" })
vim.api.nvim_set_hl(0, "DiffviewDiffText", { bg = "#203959" })
vim.api.nvim_set_hl(0, "DiffText", { bg = "#203959" })
if vim.g.neovide then
-- vim.g.neovide_cursor_vfx_mode = "sonicboom"
vim.g.neovide_cursor_vfx_mode = "ripple"
vim.g.neovide_cursor_vfx_opacity = 30.0
vim.g.neovide_text_gamma = 0.4
vim.g.neovide_text_contrast = 0.4
vim.g.neovide_input_use_logo = 1
vim.keymap.set("n", "<D-v>", '"+p<CR>', { noremap = true, silent = true })
vim.keymap.set({ "i", "c" }, "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.keymap.set("t", "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.keymap.set("v", "<D-c>", '"+y<CR>', { noremap = true, silent = true })
vim.opt.linespace = 5
end