From 7f2c5866fe5901765017321d8dd8001e9702045d Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sat, 6 Jan 2024 16:19:26 +0100 Subject: [PATCH] nvim : nouvelle configuration avec Paq --- config/nvim/init.lua | 6 +++--- config/nvim/lua/core/keymaps.lua | 1 - config/nvim/lua/core/opts.lua | 1 - config/nvim/lua/core/style.lua | 4 ---- config/nvim/lua/lsp/init.lua | 1 - config/nvim/lua/lsp/typescript.lua | 1 - config/nvim/lua/plugins/catppuccin.lua | 2 ++ config/nvim/lua/plugins/init.lua | 18 ++++++++++++++--- config/nvim/lua/plugins/lualine.lua | 5 ++++- .../plugins/{nvim_tree.lua => nvim-tree.lua} | 1 - config/nvim/lua/plugins/nvim_web_devicons.lua | 1 - config/nvim/paqadd.sh | 13 ++++++++++++ config/updateall/scripts/80-nvim | 20 ++----------------- 13 files changed, 39 insertions(+), 35 deletions(-) delete mode 100644 config/nvim/lua/lsp/typescript.lua create mode 100644 config/nvim/lua/plugins/catppuccin.lua rename config/nvim/lua/plugins/{nvim_tree.lua => nvim-tree.lua} (99%) delete mode 100644 config/nvim/lua/plugins/nvim_web_devicons.lua create mode 100755 config/nvim/paqadd.sh diff --git a/config/nvim/init.lua b/config/nvim/init.lua index fbe71f6..e923df5 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,7 +1,7 @@ --- Inclure la configuration par défaut de Vim +-- Import my custom vim config vim.cmd [[ source ~/.vimrc ]] --- Modules +-- Import modules +require('core') --require('plugins') ---require('core') --require('lsp') diff --git a/config/nvim/lua/core/keymaps.lua b/config/nvim/lua/core/keymaps.lua index c44d09d..c8712db 100644 --- a/config/nvim/lua/core/keymaps.lua +++ b/config/nvim/lua/core/keymaps.lua @@ -4,4 +4,3 @@ vim.g.maplocalleader = ',' -- Keymaps vim.keymap.set('n', 'h', ':nohlsearch') - diff --git a/config/nvim/lua/core/opts.lua b/config/nvim/lua/core/opts.lua index 0c8cce8..c588ad3 100644 --- a/config/nvim/lua/core/opts.lua +++ b/config/nvim/lua/core/opts.lua @@ -17,4 +17,3 @@ vim.cmd([[ set signcolumn=yes autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) ]]) - diff --git a/config/nvim/lua/core/style.lua b/config/nvim/lua/core/style.lua index 65f4c4f..defe68e 100644 --- a/config/nvim/lua/core/style.lua +++ b/config/nvim/lua/core/style.lua @@ -1,6 +1,2 @@ -- Activer les couleurs du terminal vim.o.termguicolors = true - --- Changer la palette de couleurs -vim.cmd [[ colorscheme catppuccin ]] - diff --git a/config/nvim/lua/lsp/init.lua b/config/nvim/lua/lsp/init.lua index 38cf9a9..80d5415 100644 --- a/config/nvim/lua/lsp/init.lua +++ b/config/nvim/lua/lsp/init.lua @@ -2,4 +2,3 @@ nvim_lsp = require'lspconfig' require('lsp.bash') require('lsp.rust') -require('lsp.typescript') diff --git a/config/nvim/lua/lsp/typescript.lua b/config/nvim/lua/lsp/typescript.lua deleted file mode 100644 index 7188a22..0000000 --- a/config/nvim/lua/lsp/typescript.lua +++ /dev/null @@ -1 +0,0 @@ -require'lspconfig'.tsserver.setup{} diff --git a/config/nvim/lua/plugins/catppuccin.lua b/config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..a29b024 --- /dev/null +++ b/config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,2 @@ +-- Set the colorscheme +vim.cmd [[ colorscheme catppuccin ]] diff --git a/config/nvim/lua/plugins/init.lua b/config/nvim/lua/plugins/init.lua index 60310ac..3f84146 100644 --- a/config/nvim/lua/plugins/init.lua +++ b/config/nvim/lua/plugins/init.lua @@ -1,3 +1,15 @@ -require("plugins.nvim_web_devicons") -require("plugins.lualine") -require("plugins.nvim_tree") +-- Initialize plugin manager +require "paq" { + -- Let paq manage itself + 'savq/paq-nvim', + + -- User defined plugins + 'catppuccin/nvim', -- colorscheme + 'nvim-lualine/lualine.nvim', -- status line + 'nvim-tree/nvim-tree.lua', -- file tree +} + +-- Plugins configuration +require('plugins.catppuccin') +require('plugins.lualine') +require('plugins.nvim-tree') diff --git a/config/nvim/lua/plugins/lualine.lua b/config/nvim/lua/plugins/lualine.lua index 48c03ea..130833b 100644 --- a/config/nvim/lua/plugins/lualine.lua +++ b/config/nvim/lua/plugins/lualine.lua @@ -1,3 +1,4 @@ +-- lualine configuration require('lualine').setup { options = { icons_enabled = true, @@ -10,6 +11,8 @@ require('lualine').setup { path = 1, } } - } + }, } +-- Full width line +vim.opt.laststatus = 3 diff --git a/config/nvim/lua/plugins/nvim_tree.lua b/config/nvim/lua/plugins/nvim-tree.lua similarity index 99% rename from config/nvim/lua/plugins/nvim_tree.lua rename to config/nvim/lua/plugins/nvim-tree.lua index 1ad4bc8..6afb610 100644 --- a/config/nvim/lua/plugins/nvim_tree.lua +++ b/config/nvim/lua/plugins/nvim-tree.lua @@ -4,4 +4,3 @@ vim.g.loaded_netrwPlugin = 1 require("nvim-tree").setup() vim.keymap.set('n', '', ':NvimTreeFindFileToggle') - diff --git a/config/nvim/lua/plugins/nvim_web_devicons.lua b/config/nvim/lua/plugins/nvim_web_devicons.lua deleted file mode 100644 index 7c411e7..0000000 --- a/config/nvim/lua/plugins/nvim_web_devicons.lua +++ /dev/null @@ -1 +0,0 @@ -require('nvim-web-devicons') diff --git a/config/nvim/paqadd.sh b/config/nvim/paqadd.sh new file mode 100755 index 0000000..6824af3 --- /dev/null +++ b/config/nvim/paqadd.sh @@ -0,0 +1,13 @@ +#!/bin/sh -x + +is_gitrepo() {( + cd "$1" || return + git status +) > /dev/null 2> /dev/null +} + +clone_ifnalready() { + is_gitrepo "$1" || git clone --depth=1 https://github.com/savq/paq-nvim.git "$1" +} + +clone_ifnalready ~/.local/share/nvim/site/pack/paqs/start/paq-nvim diff --git a/config/updateall/scripts/80-nvim b/config/updateall/scripts/80-nvim index d5b6277..d5d9a29 100755 --- a/config/updateall/scripts/80-nvim +++ b/config/updateall/scripts/80-nvim @@ -1,18 +1,2 @@ -#!/bin/sh - -update_plugin() { - cd "$1" || return - printf 'Updating plugin \033[1m%s\033[0m...\n' "$(echo "$1" | sed 's|/start||')" - git pull -} - -cd ~/.local/share/nvim/site/pack || exit - -for i in */start/*; do - while [ "$(jobs -p | wc -l)" -ge 4 ]; do - sleep 1 - done - update_plugin "$i" & -done - -wait +#!/bin/sh -x +nvim +PaqSync