first commit
This commit is contained in:
31
lua/plugins/autopairs.lua
Normal file
31
lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = { "InsertEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-autopairs
|
||||
local autopairs = require("nvim-autopairs")
|
||||
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
check_ts = true, -- enable treesitter
|
||||
disable_filetype = { "TelescopePrompt" },
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require("cmp")
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
12
lua/plugins/bufferline.lua
Normal file
12
lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
version = "*",
|
||||
opts = {
|
||||
options = {
|
||||
separator_style = "slant",
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
43
lua/plugins/conform.lua
Normal file
43
lua/plugins/conform.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {},
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
css = { "prettier" },
|
||||
elm = { "elm_format" },
|
||||
graphql = { "prettier" },
|
||||
json = { "prettier" },
|
||||
html = { "prettier" },
|
||||
liquid = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
markdown = { "prettier" },
|
||||
python = { "ruff_fix", "ruff_format" },
|
||||
rust = { "rustfmt" },
|
||||
svelte = { "prettier" },
|
||||
javascript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_format = "fallback",
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
}
|
||||
|
||||
53
lua/plugins/gitsigns.lua
Normal file
53
lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
|
||||
-- Actions
|
||||
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||
map("v", "<leader>hs", function()
|
||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Stage hunk")
|
||||
map("v", "<leader>hr", function()
|
||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Reset hunk")
|
||||
|
||||
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
|
||||
map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
|
||||
|
||||
map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
|
||||
|
||||
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||
|
||||
map("n", "<leader>hb", function()
|
||||
gs.blame_line({ full = true })
|
||||
end, "Blame line")
|
||||
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
|
||||
|
||||
map("n", "<leader>hd", gs.diffthis, "Diff this")
|
||||
map("n", "<leader>hD", function()
|
||||
gs.diffthis("~")
|
||||
end, "Diff this ~")
|
||||
|
||||
-- Text object
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
lua/plugins/indent-blankline.lua
Normal file
8
lua/plugins/indent-blankline.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
indent = { char = "┊" },
|
||||
},
|
||||
}
|
||||
4
lua/plugins/init.lua
Normal file
4
lua/plugins/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nvim-lua/plenary.nvim", -- ensemble de fonctions lua utilisées par de nombreux plugins
|
||||
}
|
||||
|
||||
125
lua/plugins/lsp/lspconfig.lua
Normal file
125
lua/plugins/lsp/lspconfig.lua
Normal file
@@ -0,0 +1,125 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
-- Va permettre de remplir le plugin de complétion automatique nvim-cmp
|
||||
-- avec les résultats des LSP
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
-- Ajoute les « code actions » de type renommage de fichiers intelligent, etc
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
-- Utile pour éditer les fichiers lua spécifiques à la config neovim
|
||||
-- Notamment pour éviter le "Undefined global `vim`"
|
||||
{ "folke/lazydev.nvim", opts = {} },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" } },
|
||||
{ "gR", "<cmd>Telescope lsp_references<CR>", desc = "Show LSP references", mode = "n" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Go to declaration", mode = "n" },
|
||||
{ "gd", "<cmd>Telescope lsp_definitions<CR>", desc = "Show LSP definitions", mode = "n" },
|
||||
{ "gi", "<cmd>Telescope lsp_implementations<CR>", desc = "Show LSP implementations", mode = "n" },
|
||||
{ "gt", "<cmd>Telescope lsp_type_definitions<CR>", desc = "Show LSP type definitions", mode = "n" },
|
||||
{ "gs", vim.lsp.buf.signature_help, desc = "Show LSP signature help", mode = "n" },
|
||||
{ "<leader>rn", vim.lsp.buf.rename, desc = "Smart rename", mode = "n" },
|
||||
{ "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", desc = "Show buffer diagnostics", mode = "n" },
|
||||
{ "<leader>d", vim.diagnostic.open_float, desc = "Show line diagnostics", mode = "n" },
|
||||
{
|
||||
"[d",
|
||||
function()
|
||||
vim.diagnostic.jump({ count = -1, float = true })
|
||||
end,
|
||||
desc = "Go to previous diagnostic",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"]d",
|
||||
function()
|
||||
vim.diagnostic.jump({ count = 1, float = true })
|
||||
end,
|
||||
desc = "Go to next diagnostic",
|
||||
mode = "n",
|
||||
},
|
||||
{ "K", vim.lsp.buf.hover, desc = "Show documentation for what is under cursor", mode = "n" },
|
||||
{ "<leader>F", "<cmd>lua vim.lsp.buf.format({async = true})<cr>", desc = "Format buffer", mode = { "n", "x" } },
|
||||
{ "<leader>rs", ":LspRestart<CR>", desc = "Restart LSP", mode = "n" },
|
||||
},
|
||||
config = function()
|
||||
-- Customize error signs
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = "",
|
||||
[vim.diagnostic.severity.WARN] = "",
|
||||
[vim.diagnostic.severity.INFO] = "",
|
||||
[vim.diagnostic.severity.HINT] = "",
|
||||
},
|
||||
},
|
||||
})
|
||||
-- Python
|
||||
vim.lsp.config("pylsp", {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = {
|
||||
enabled = true,
|
||||
ignore = { "E501" },
|
||||
},
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pylsp_isort = { enabled = true },
|
||||
rope_completion = { enabled = true },
|
||||
rope_autoimport = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("ruff", {
|
||||
settings = {
|
||||
init_options = {
|
||||
settings = {
|
||||
-- Arguments par défaut de la ligne de commande ruff
|
||||
-- (on ajoute les warnings pour le tri des imports)
|
||||
args = { "--extend-select", "I" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Rust
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
inlayHints = {
|
||||
renderColons = true,
|
||||
typeHints = {
|
||||
enable = true,
|
||||
hideClosureInitialization = false,
|
||||
hideNamedConstructor = false,
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
styleLints = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
49
lua/plugins/lsp/mason.lua
Normal file
49
lua/plugins/lsp/mason.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
dependencies = {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
-- import de mason
|
||||
local mason = require("mason")
|
||||
|
||||
-- import de mason-lspconfig
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
-- Active mason et personnalise les icônes
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
automatic_enable = true,
|
||||
-- Liste des serveurs à installer par défaut
|
||||
-- List des serveurs possibles : https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
-- Vous pouvez ne pas en mettre ici et tout installer en utilisant :Mason
|
||||
-- Mais au lieu de passer par :Mason pour installer, je vous recommande d'ajouter une entrée à cette liste
|
||||
-- Ça permettra à votre configuration d'être plus portable
|
||||
ensure_installed = {
|
||||
"cssls",
|
||||
"elmls",
|
||||
"graphql",
|
||||
"html",
|
||||
"lua_ls",
|
||||
"pylsp",
|
||||
"ruff",
|
||||
"rust_analyzer",
|
||||
"sqlls",
|
||||
"svelte",
|
||||
"ts_ls",
|
||||
"yamlls",
|
||||
"clangd",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
60
lua/plugins/lualine.lua
Normal file
60
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
local lazy_status = require("lazy.status") -- affiche le nombre de mise à jour plugins lazy dans la barre
|
||||
|
||||
-- configuration de lualine
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { { "filename", path = 1 } },
|
||||
lualine_x = {
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
{ "filetype" },
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
38
lua/plugins/noice.lua
Normal file
38
lua/plugins/noice.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local noice = require("noice")
|
||||
|
||||
noice.setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
104
lua/plugins/nvim-cmp.lua
Normal file
104
lua/plugins/nvim-cmp.lua
Normal file
@@ -0,0 +1,104 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer", -- source pour compléter le texte déjà présent dans le buffer
|
||||
"hrsh7th/cmp-path", -- source pour compléter les chemins des fichiers
|
||||
"hrsh7th/cmp-cmdline", -- source pour les completions de la cmdline de vim
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip", -- ajoute LuaSnip à l'autocompletion
|
||||
"rafamadriz/friendly-snippets", -- collection de snippets pratiques
|
||||
"hrsh7th/cmp-emoji", -- complétion d'émojis à la saisie de :
|
||||
"onsails/lspkind.nvim", -- vs-code pictogrammes
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- chargement des snippets (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,noselect",
|
||||
},
|
||||
snippet = { -- on utilise luasnip comme moteur de snippets
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-1),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(1),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accepte la sélection courante. Mettre à `false` pour ne confirmer que les items explicitement sélectionnés
|
||||
},
|
||||
|
||||
-- sources pour l'autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" }, -- lsp
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- texte du buffer courant
|
||||
{ name = "path" }, -- chemins du système de fichier
|
||||
{ name = "emoji" }, -- emojis
|
||||
}),
|
||||
|
||||
formatting = {
|
||||
-- Comportement par défaut
|
||||
expandable_indicator = true,
|
||||
-- Champs affichés par défaut
|
||||
fields = { "abbr", "kind", "menu" },
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
-- On suffixe chaque entrée par son type
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]",
|
||||
buffer = "[Buffer]",
|
||||
luasnip = "[LuaSnip]",
|
||||
nvim_lua = "[Lua]",
|
||||
path = "[Path]",
|
||||
emoji = "[Emoji]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
-- `/` complétion
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- `:` complétion
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{
|
||||
name = "cmdline",
|
||||
option = {
|
||||
ignore_cmds = { "Man", "!" },
|
||||
},
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
20
lua/plugins/nvim-tree.lua
Normal file
20
lua/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup({})
|
||||
|
||||
-- On utilise <leader>e pour ouvrir/fermer l'explorateur
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>e",
|
||||
"<cmd>NvimTreeFindFileToggle<CR>",
|
||||
{ desc = "Ouverture/fermeture de l'explorateur de fichiers" }
|
||||
)
|
||||
end,
|
||||
}
|
||||
|
||||
3
lua/plugins/rainbow-delimiters.lua
Normal file
3
lua/plugins/rainbow-delimiters.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"hiphish/rainbow-delimiters.nvim",
|
||||
}
|
||||
63
lua/plugins/telescope.lua
Normal file
63
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
-- fzf implémentation en C pour plus de rapidité
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
|
||||
-- Parce que c'est joli
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
file_ignore_patterns = { ".git/", "node_modules" },
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>ff",
|
||||
"<cmd>Telescope find_files<cr>",
|
||||
{ desc = "Recherche de chaînes de caractères dans les noms de fichiers" }
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>fg",
|
||||
"<cmd>Telescope live_grep<cr>",
|
||||
{ desc = "Recherche de chaînes de caractères dans le contenu des fichiers" }
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>fb",
|
||||
"<cmd>Telescope buffers<cr>",
|
||||
{ desc = "Recherche de chaînes de caractères dans les noms de buffers" }
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>fx",
|
||||
"<cmd>Telescope grep_string<cr>",
|
||||
{ desc = "Recherche de la chaîne de caractères sous le curseur" }
|
||||
)
|
||||
end,
|
||||
}
|
||||
|
||||
21
lua/plugins/todo-comments.lua
Normal file
21
lua/plugins/todo-comments.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "]t", function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
keymap.set("n", "[t", function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
||||
10
lua/plugins/tokyonight.lua
Normal file
10
lua/plugins/tokyonight.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
-- chargement du thème
|
||||
vim.cmd([[colorscheme tokyonight]])
|
||||
end,
|
||||
}
|
||||
49
lua/plugins/treesitter.lua
Normal file
49
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configuration de treesitter
|
||||
treesitter.setup({
|
||||
-- activation de la coloration syntaxique
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- activation de l'indentation améliorée
|
||||
indent = { enable = true },
|
||||
|
||||
-- langages installés et configurés
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"bash",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"rst",
|
||||
"rust",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
-- lorse de l'appui sur <Ctrl-space> sélectionne le bloc
|
||||
-- courant spécifique au langage de programmation
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
38
lua/plugins/trouble.lua
Normal file
38
lua/plugins/trouble.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xX",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||
desc = "Buffer Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cs",
|
||||
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP Definitions / references / ... (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xL",
|
||||
"<cmd>Trouble loclist toggle<cr>",
|
||||
desc = "Location List (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xQ",
|
||||
"<cmd>Trouble qflist toggle<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
14
lua/plugins/whichkey.lua
Normal file
14
lua/plugins/whichkey.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = true })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user