From bb10f99a16bfaf472349a9f0ece626ca3a95d3af Mon Sep 17 00:00:00 2001 From: linarphy Date: Sun, 14 Apr 2024 00:48:20 +0200 Subject: [PATCH] Re-add new neovim config (without documentation for now) --- private_dot_config/nvim/init.lua | 7 ++ private_dot_config/nvim/lazy-lock.json | 22 +++++ .../nvim/lua/display/editor.lua | 9 ++ private_dot_config/nvim/lua/display/gui.lua | 2 + private_dot_config/nvim/lua/display/init.lua | 3 + .../nvim/lua/mapping/fzf-lua.lua | 24 +++++ private_dot_config/nvim/lua/mapping/init.lua | 11 +++ private_dot_config/nvim/lua/mapping/lsp.lua | 32 +++++++ .../nvim/lua/mapping/maintenance.lua | 17 ++++ .../nvim/lua/mapping/movement.lua | 49 +++++++++++ .../nvim/lua/mapping/neo-tree.lua | 8 ++ .../nvim/lua/mapping/persistence.lua | 24 +++++ .../nvim/lua/plugins/dashboard-nvim.lua | 84 ++++++++++++++++++ .../nvim/lua/plugins/fzf-lua.lua | 9 ++ private_dot_config/nvim/lua/plugins/init.lua | 20 +++++ private_dot_config/nvim/lua/plugins/mini.lua | 4 + .../nvim/lua/plugins/monokai_nvim.lua | 3 + .../nvim/lua/plugins/neo-tree.lua | 9 ++ private_dot_config/nvim/lua/plugins/noice.lua | 15 ++++ .../nvim/lua/plugins/nvim-lspconfig.lua | 18 ++++ .../nvim/lua/plugins/nvim-lspconfig/.keep | 0 .../lua/plugins/nvim-treesitter-context.lua | 3 + .../nvim/lua/plugins/nvim-treesitter.lua | 88 +++++++++++++++++++ .../lua/plugins/nvim-treesitter/folding.lua | 2 + .../nvim/lua/plugins/nvim-ts-autotag.lua | 3 + .../nvim/lua/plugins/persistence.lua | 6 ++ .../nvim/lua/plugins/trouble.lua | 37 ++++++++ .../nvim/lua/plugins/vim-fugitive.lua | 4 + .../nvim/lua/plugins/which-key.lua | 10 +++ .../nvim/lua/variables/core.lua | 5 ++ .../nvim/lua/variables/init.lua | 3 + .../nvim/lua/variables/mapping.lua | 10 +++ 32 files changed, 541 insertions(+) create mode 100644 private_dot_config/nvim/init.lua create mode 100644 private_dot_config/nvim/lazy-lock.json create mode 100644 private_dot_config/nvim/lua/display/editor.lua create mode 100644 private_dot_config/nvim/lua/display/gui.lua create mode 100644 private_dot_config/nvim/lua/display/init.lua create mode 100644 private_dot_config/nvim/lua/mapping/fzf-lua.lua create mode 100644 private_dot_config/nvim/lua/mapping/init.lua create mode 100644 private_dot_config/nvim/lua/mapping/lsp.lua create mode 100644 private_dot_config/nvim/lua/mapping/maintenance.lua create mode 100644 private_dot_config/nvim/lua/mapping/movement.lua create mode 100644 private_dot_config/nvim/lua/mapping/neo-tree.lua create mode 100644 private_dot_config/nvim/lua/mapping/persistence.lua create mode 100644 private_dot_config/nvim/lua/plugins/dashboard-nvim.lua create mode 100644 private_dot_config/nvim/lua/plugins/fzf-lua.lua create mode 100644 private_dot_config/nvim/lua/plugins/init.lua create mode 100644 private_dot_config/nvim/lua/plugins/mini.lua create mode 100644 private_dot_config/nvim/lua/plugins/monokai_nvim.lua create mode 100644 private_dot_config/nvim/lua/plugins/neo-tree.lua create mode 100644 private_dot_config/nvim/lua/plugins/noice.lua create mode 100644 private_dot_config/nvim/lua/plugins/nvim-lspconfig.lua create mode 100644 private_dot_config/nvim/lua/plugins/nvim-lspconfig/.keep create mode 100644 private_dot_config/nvim/lua/plugins/nvim-treesitter-context.lua create mode 100644 private_dot_config/nvim/lua/plugins/nvim-treesitter.lua create mode 100644 private_dot_config/nvim/lua/plugins/nvim-treesitter/folding.lua create mode 100644 private_dot_config/nvim/lua/plugins/nvim-ts-autotag.lua create mode 100644 private_dot_config/nvim/lua/plugins/persistence.lua create mode 100644 private_dot_config/nvim/lua/plugins/trouble.lua create mode 100644 private_dot_config/nvim/lua/plugins/vim-fugitive.lua create mode 100644 private_dot_config/nvim/lua/plugins/which-key.lua create mode 100644 private_dot_config/nvim/lua/variables/core.lua create mode 100644 private_dot_config/nvim/lua/variables/init.lua create mode 100644 private_dot_config/nvim/lua/variables/mapping.lua diff --git a/private_dot_config/nvim/init.lua b/private_dot_config/nvim/init.lua new file mode 100644 index 0000000..8fba515 --- /dev/null +++ b/private_dot_config/nvim/init.lua @@ -0,0 +1,7 @@ +require('variables') + +require('plugins') + +require('mapping') + +require('display') diff --git a/private_dot_config/nvim/lazy-lock.json b/private_dot_config/nvim/lazy-lock.json new file mode 100644 index 0000000..ed9e21c --- /dev/null +++ b/private_dot_config/nvim/lazy-lock.json @@ -0,0 +1,22 @@ +{ + "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, + "fzf-lua": { "branch": "main", "commit": "344b309421e5222a6199e4b46d01041089b6a2ae" }, + "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "mini.nvim": { "branch": "main", "commit": "c4598eaaa7bc29c1d17dd1238c3436c1fb4233aa" }, + "monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "c61074acb19102dfc6f21738dcae4d9a494a8959" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-treesitter": { "branch": "master", "commit": "f08a9d97f7a2ac02115a5c1c8e3973b2634d996b" }, + "nvim-treesitter-context": { "branch": "master", "commit": "ba05c6b753130d96b284d3e8ba8f54c28c0fb6d1" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "6e9bb569a510bdfab6095c217a2f714af7a3d116" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, + "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "trouble.nvim": { "branch": "dev", "commit": "10eff94809ecd6ee6cc59f42e9521b9b8a14e9ce" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/private_dot_config/nvim/lua/display/editor.lua b/private_dot_config/nvim/lua/display/editor.lua new file mode 100644 index 0000000..9ba3d5d --- /dev/null +++ b/private_dot_config/nvim/lua/display/editor.lua @@ -0,0 +1,9 @@ +vim.opt.relativenumber = true +vim.opt.number = true +vim.opt.wrap = false +vim.opt.emoji = false + +vim.opt.cursorline = true +vim.opt.cursorcolumn = true + +require('monokai').setup {} diff --git a/private_dot_config/nvim/lua/display/gui.lua b/private_dot_config/nvim/lua/display/gui.lua new file mode 100644 index 0000000..e627f40 --- /dev/null +++ b/private_dot_config/nvim/lua/display/gui.lua @@ -0,0 +1,2 @@ +vim.opt.guifont = 'mononoki NFM:h11' +vim.opt.background = dark diff --git a/private_dot_config/nvim/lua/display/init.lua b/private_dot_config/nvim/lua/display/init.lua new file mode 100644 index 0000000..930ecb1 --- /dev/null +++ b/private_dot_config/nvim/lua/display/init.lua @@ -0,0 +1,3 @@ +require('display.editor') + +require('display.gui') diff --git a/private_dot_config/nvim/lua/mapping/fzf-lua.lua b/private_dot_config/nvim/lua/mapping/fzf-lua.lua new file mode 100644 index 0000000..f742b85 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/fzf-lua.lua @@ -0,0 +1,24 @@ +vim.keymap.set( + 'n' , + 'pfr' , + 'lua require(\'fzf-lua\').oldfiles()', + { + desc = 'List recent files' + } +) +vim.keymap.set( + 'n' , + 'pff' , + 'lua require(\'fzf-lua\').files()', + { + desc = 'Search files in current folder' + } +) +vim.keymap.set( + 'n' , + 'pfw' , + 'lua require(\'fzf-lua\').grep()', + { + desc = 'Search word in files' + } +) diff --git a/private_dot_config/nvim/lua/mapping/init.lua b/private_dot_config/nvim/lua/mapping/init.lua new file mode 100644 index 0000000..7e6d864 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/init.lua @@ -0,0 +1,11 @@ +require('mapping.maintenance') + +require('mapping.movement') + +require('mapping.lsp') + +require('mapping.persistence') + +require('mapping.fzf-lua') + +require('mapping.neo-tree') diff --git a/private_dot_config/nvim/lua/mapping/lsp.lua b/private_dot_config/nvim/lua/mapping/lsp.lua new file mode 100644 index 0000000..86eff95 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/lsp.lua @@ -0,0 +1,32 @@ +vim.keymap.set( + 'n' , + 'ple' , + vim.diagnostic.open_float, + { + desc = 'Open float window for diagnostic' + } +) +vim.keymap.set( + 'n' , + 'pln' , + vim.diagnostic.goto_prev, + { + desc = 'Go to previous issue' + } +) +vim.keymap.set( + 'n' , + 'pl?' , + vim.diagnostic.goto_next, + { + desc = 'Go to next issue' + } +) +vim.keymap.set( + 'n' , + 'plq' , + vim.diagnostic.setloclist, + { + desc = 'Open list of issues for diagnostic' + } +) diff --git a/private_dot_config/nvim/lua/mapping/maintenance.lua b/private_dot_config/nvim/lua/mapping/maintenance.lua new file mode 100644 index 0000000..f8dfa45 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/maintenance.lua @@ -0,0 +1,17 @@ +vim.keymap.set( + 'n' , + 'ie' , + ':tabedit ' .. require('variables.core').config .. '', + { + desc = 'edit current configuration in a new tab' + } +) + +vim.keymap.set( + 'n' , + 'is' , + ':source ' .. require('variables.core').config .. '', + { + desc = 'try to reload current configuration' + } +) diff --git a/private_dot_config/nvim/lua/mapping/movement.lua b/private_dot_config/nvim/lua/mapping/movement.lua new file mode 100644 index 0000000..885cfa9 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/movement.lua @@ -0,0 +1,49 @@ +vim.keymap.set( + 'n' , + '', + '' .. require('variables.mapping').up , + { + desc = 'Move to the up window' + } +) +vim.keymap.set( + 'n' , + '', + '' .. require('variables.mapping').down , + { + desc = 'Move to the down window' + } +) +vim.keymap.set( + 'n' , + '', + '' .. require('variables.mapping').left , + { + desc = 'Move to the left window' + } +) +vim.keymap.set( + 'n' , + '', + '' .. require('variables.mapping').right , + { + desc = 'Move to the right window' + } +) + +vim.keymap.set( + 'n' , + 'jt', + '' , + { + desc = 'Jump to tag under the cursor' + } +) +vim.keymap.set( + 'n' , + 'jt', + '' , + { + desc = 'Jump to tag under the cursor' + } +) diff --git a/private_dot_config/nvim/lua/mapping/neo-tree.lua b/private_dot_config/nvim/lua/mapping/neo-tree.lua new file mode 100644 index 0000000..deed83a --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/neo-tree.lua @@ -0,0 +1,8 @@ +vim.keymap.set( + 'n', + 'pe', + ':Neotree', + { + desc = 'Open file explorer in a side buffer' + } +) diff --git a/private_dot_config/nvim/lua/mapping/persistence.lua b/private_dot_config/nvim/lua/mapping/persistence.lua new file mode 100644 index 0000000..9f90342 --- /dev/null +++ b/private_dot_config/nvim/lua/mapping/persistence.lua @@ -0,0 +1,24 @@ +vim.keymap.set( + 'n' , + 'psl' , + 'lua require(\'persistence\').load({ last = true })', + { + desc = 'Restore last session' + } +) +vim.keymap.set( + 'n' , + 'psd' , + 'lua require(\'persistence\').load()', + { + desc = 'Restore last session for the current directory' + } +) +vim.keymap.set( + 'n' , + 'pss' , + 'lua require(\'persistence\').stop()', + { + desc = 'Do not save this session on neovim shutdown' + } +) diff --git a/private_dot_config/nvim/lua/plugins/dashboard-nvim.lua b/private_dot_config/nvim/lua/plugins/dashboard-nvim.lua new file mode 100644 index 0000000..e5c7771 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/dashboard-nvim.lua @@ -0,0 +1,84 @@ +return { + 'glepnir/dashboard-nvim', + event = 'VimEnter' , + dependencies = { + 'nvim-tree/nvim-web-devicons' + } , + config = function() + require('dashboard').setup({ + theme = 'doom', + config = { + header = { + '', + 'MMMMMMMMMWkdXMMMMMMMMMMMMMWXOd:\'.. ..\':oOXWMMMMMMMMMMMMMNxkWMMMMMMMMM', + 'MMMMMMMMMWo.;kNMMMMMMMMNOd:\'. .\':oONMMMMMMMMWO:.lWMMMMMMMMM', + 'MMMMMMMMMWo ;kNMMMNkc\' \'ckXMMMWO:. lWMMMMMMMMM', + 'MMMMMMMMMWo .;kKd\' \'oKO:. lWMMMMMMMMM', + 'MMMMMMMMMWo .xO:. :Ox\' lWMMMMMMMMM', + 'MMMMMMMMMWo .oKWMNk;. ;kNMMXd\' lWMMMMMMMMM', + 'MMMMMMMMMWo..oKWMMMMMNk;. ;kNMMMMMMXd\'.lWMMMMMMMMM', + 'MMMMMMMMMWOdKWMMMMMMMMMNk;. ;kNMMMMMMMMMWXxOWMMMMMMMMM', + 'MMMMMMMMMMMMMMMMMMMMMMMMMNk;. ;kNMMMMMMMMMMMMMMMMMMMMMMMMM', + 'MMMMMMMMMMMMMMMMMMMMMMMMMMMNk;. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMM', + 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk;. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMM', + 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk;. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM', + 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk;. .;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM', + 'XWMMMMMMMW0doooooooooooooooooooooooddddooooooooooooooooooooooooo0WMMMMMMMMX', + ',oKWMMMMMWd. ;kNMNk; oWMMMMMMXo\'', + '. .oKWMMMMk. ;kNMMMMMNk; .kMMMMMXd\' ', + '\' .oXWMMX; ;kNMMMMMMMMMNk; ;KMMWXd\' .', + 'c .oXWWx. ;kNMMMMMMMMMMMMMNk; .xWWXd\' :', + 'O. .oXNo ;kNMMMMMMMMMMMMMMMMMNk; lXXd\' .k', + 'No .oOc ;kNMMMMMMMMMMMMMMMMMMMMMNk; cOd\' lN', + 'MX: \'c;. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMNk; .;c\' ;KM', + 'MM0; ... ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk; ... ,0MM', + 'MMM0; .:kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk:. ,0MMM', + 'MMMMKc ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk; :KMMMM', + 'MMMMMNd. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk; .oXMMMMM', + 'MMMMMMW0:. ;kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNk; ;OWMMMMMM', + 'MMMMMMMMNl\'lXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMXl\'lXMMMMMMMM', + '', + }, + center = { + { + icon = ' ' , + desc = 'Fichiers récents', + key = 'o', + keymap = ', p f r', + action = 'lua require(\'fzf-lua\').oldfiles()', + }, + { + icon = ' ', + desc = 'Rechercher un fichier', + key = 'r', + keymap = ', p f f', + action = 'lua require(\'fzf-lua\').files()', + }, + { + icon = ' ', + desc = 'Rechercher un mot', + key = 'm', + keymap = ', p f w', + action = 'lua require(\'fzf-lua\').grep()', + }, + { + icon = ' ', + desc = 'Ouvrir des fichiers de configuration', + key = 'c', + keymap = ', i e', + action = 'lua vim.cmd( \'e ~/.config/nvim/init.lua\')', + }, + { + icon = ' ', + desc = 'Restaurer la dernière session', + key = 's', + keymap = ', p s l', + action = 'lua require(\'persistence\').load({ last = true })', + }, + }, + footer = { + }, + } , + }) + end +} diff --git a/private_dot_config/nvim/lua/plugins/fzf-lua.lua b/private_dot_config/nvim/lua/plugins/fzf-lua.lua new file mode 100644 index 0000000..032ee4f --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/fzf-lua.lua @@ -0,0 +1,9 @@ +return { + 'ibhagwan/fzf-lua', + dependencies = { + 'nvim-tree/nvim-web-devicons' + } , + config = function() + require('fzf-lua').setup({}) + end +} diff --git a/private_dot_config/nvim/lua/plugins/init.lua b/private_dot_config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..70c1545 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/init.lua @@ -0,0 +1,20 @@ +local ok, lazy = pcall(require, 'lazy') + +if not ok then -- avoid lazy trying to load it's own script in loop + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not 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 + vim.opt.rtp:prepend(lazypath) + + require('lazy').setup('plugins') +else + return {} +end diff --git a/private_dot_config/nvim/lua/plugins/mini.lua b/private_dot_config/nvim/lua/plugins/mini.lua new file mode 100644 index 0000000..f70adb6 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/mini.lua @@ -0,0 +1,4 @@ +return { + 'echasnovski/mini.nvim', + version = false +} diff --git a/private_dot_config/nvim/lua/plugins/monokai_nvim.lua b/private_dot_config/nvim/lua/plugins/monokai_nvim.lua new file mode 100644 index 0000000..e0645d9 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/monokai_nvim.lua @@ -0,0 +1,3 @@ +return { + 'tanvirtin/monokai.nvim' +} diff --git a/private_dot_config/nvim/lua/plugins/neo-tree.lua b/private_dot_config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..97be2e9 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,9 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim' , + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim' , + } +} diff --git a/private_dot_config/nvim/lua/plugins/noice.lua b/private_dot_config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..b5aa352 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/noice.lua @@ -0,0 +1,15 @@ +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", + } +} diff --git a/private_dot_config/nvim/lua/plugins/nvim-lspconfig.lua b/private_dot_config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..9ec47d2 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,18 @@ +return { + 'neovim/nvim-lspconfig', + event = { + 'BufReadPre', + 'BufNewFile', + }, + config = function() + local lspconfig = require('lspconfig') + + lspconfig.pyright.setup {} + lspconfig.tsserver.setup {} + lspconfig.rust_analyzer.setup { + settings = { + ['rust-analyzer'] = {}, + }, + } + end +} diff --git a/private_dot_config/nvim/lua/plugins/nvim-lspconfig/.keep b/private_dot_config/nvim/lua/plugins/nvim-lspconfig/.keep new file mode 100644 index 0000000..e69de29 diff --git a/private_dot_config/nvim/lua/plugins/nvim-treesitter-context.lua b/private_dot_config/nvim/lua/plugins/nvim-treesitter-context.lua new file mode 100644 index 0000000..d567203 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/nvim-treesitter-context.lua @@ -0,0 +1,3 @@ +return { + 'nvim-treesitter/nvim-treesitter-context', +} diff --git a/private_dot_config/nvim/lua/plugins/nvim-treesitter.lua b/private_dot_config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..714019b --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,88 @@ +require('plugins.nvim-treesitter.folding') + +return { + 'nvim-treesitter/nvim-treesitter', + version = false , + build = ':TSUpdate' , + dependencies = { + { + 'nvim-treesitter/nvim-treesitter-textobjects', + } + }, + config = function() + local configs = require('nvim-treesitter.configs') + + configs.setup({ + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + ensure_installed = { + 'bash' , + 'c' , + 'cpp' , + 'css' , + 'diff' , + 'html' , + 'javascript' , + 'json' , + 'markdown' , + 'markdown_inline', + 'php' , + 'python' , + 'regex' , + 'rust' , + 'xml' , + 'vim' , + }, + autotag = { + enable = true, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = 'pts', + node_incremental = 'ptn', + scope_incremental = 'pts', + node_decremental = 'ptd', + } + }, + text_objects = { + move = { + enable = true, + set_jumps = true, + goto_next_start = { + ['mnf'] = '@function.outer', + ['mnc'] = '@class.outer' , + ['mns'] = { + query = '@scope' , + query_group = 'locals' , + desc = 'Scope suivant', + } , + } , + goto_next_end = { + ['mnF'] = '@function.outer', + ['mnC'] = '@class.outer' , + } , + goto_previous_start = { + ['mpf'] = '@function.outer', + ['mpc'] = '@class.outer' , + ['mns'] = { + query = '@scope' , + query_group = 'locals' , + desc = 'Scope précédent', + } , + } , + goto_previous_end = { + ['mpF'] = '@function.outer', + ['mpC'] = '@function.class', + } , + }, + }, + sync_install = false, + auto_install = true , + }) + end +} diff --git a/private_dot_config/nvim/lua/plugins/nvim-treesitter/folding.lua b/private_dot_config/nvim/lua/plugins/nvim-treesitter/folding.lua new file mode 100644 index 0000000..aa55d00 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/nvim-treesitter/folding.lua @@ -0,0 +1,2 @@ +vim.opt.foldmethod = 'expr' +vim.opt.foldexpr = 'nvim_treesitter#foldexp()' diff --git a/private_dot_config/nvim/lua/plugins/nvim-ts-autotag.lua b/private_dot_config/nvim/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..ab2d8d5 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1,3 @@ +return { + 'windwp/nvim-ts-autotag', +} diff --git a/private_dot_config/nvim/lua/plugins/persistence.lua b/private_dot_config/nvim/lua/plugins/persistence.lua new file mode 100644 index 0000000..d01b1e6 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/persistence.lua @@ -0,0 +1,6 @@ +return { + 'folke/persistence.nvim', + event = 'BufReadPre' , + opts = { + }, +} diff --git a/private_dot_config/nvim/lua/plugins/trouble.lua b/private_dot_config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..1047ffd --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + 'folke/trouble.nvim', + branch = 'dev', -- IMPORTANT! + keys = { + { + 'plt', + 'Trouble diagnostics toggle', + desc = 'Diagnostics (Trouble)', + }, + { + 'plb', + 'Trouble diagnostics toggle filter.buf=0', + desc = 'Buffer Diagnostics (Trouble)', + }, + { + 'plc', + 'Trouble symbols toggle focus=false', + desc = 'Symbols (Trouble)', + }, + { + 'pll', + 'Trouble lsp toggle focus=false win.position=right', + desc = 'LSP Definitions / references / ... (Trouble)', + }, + { + 'plL', + 'Trouble loclist toggle', + desc = 'Location List (Trouble)', + }, + { + 'plq', + 'Trouble qflist toggle', + desc = 'Quickfix List (Trouble)', + }, + }, + opts = {}, -- for default options, refer to the configuration section for custom setup. +} diff --git a/private_dot_config/nvim/lua/plugins/vim-fugitive.lua b/private_dot_config/nvim/lua/plugins/vim-fugitive.lua new file mode 100644 index 0000000..670ec04 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/vim-fugitive.lua @@ -0,0 +1,4 @@ +return { + 'tpope/vim-fugitive', + cmd = 'Git' +} diff --git a/private_dot_config/nvim/lua/plugins/which-key.lua b/private_dot_config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..cc6c024 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,10 @@ +return { + 'folke/which-key.nvim', + event = 'VeryLazy' , + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 1500 + end , + opts = { + } +} diff --git a/private_dot_config/nvim/lua/variables/core.lua b/private_dot_config/nvim/lua/variables/core.lua new file mode 100644 index 0000000..ba41b5d --- /dev/null +++ b/private_dot_config/nvim/lua/variables/core.lua @@ -0,0 +1,5 @@ +local Core = {} + +Core.config = vim.fn.stdpath('config') + +return Core diff --git a/private_dot_config/nvim/lua/variables/init.lua b/private_dot_config/nvim/lua/variables/init.lua new file mode 100644 index 0000000..3e41657 --- /dev/null +++ b/private_dot_config/nvim/lua/variables/init.lua @@ -0,0 +1,3 @@ +require('variables.core') + +require('variables.mapping') diff --git a/private_dot_config/nvim/lua/variables/mapping.lua b/private_dot_config/nvim/lua/variables/mapping.lua new file mode 100644 index 0000000..141a549 --- /dev/null +++ b/private_dot_config/nvim/lua/variables/mapping.lua @@ -0,0 +1,10 @@ +local Mapping = {} + +Mapping.up = 'k' +Mapping.down = 'j' +Mapping.left = 'h' +Mapping.right = 'l' + +vim.g.mapleader = ',' + +return Mapping