From bc865e43e0f97dca6ac6a4d748e3d93a94eba57d Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Thu, 11 May 2023 18:41:27 +0200 Subject: [PATCH] feat: Initial commit --- lua/user/mappings.lua | 32 ++++++++++++++++++++++++++++ lua/user/options.lua | 30 ++++++++++++++++++++++++++ lua/user/plugins/colorschemes.lua | 8 +++++++ lua/user/plugins/copilot.lua | 35 +++++++++++++++++++++++++++++++ lua/user/plugins/neotree.lua | 9 ++++++++ lua/user/plugins/others.lua | 10 +++++++++ lua/user/plugins/telescope.lua | 11 ++++++++++ lua/user/plugins/tpope.lua | 5 +++++ 8 files changed, 140 insertions(+) create mode 100644 lua/user/mappings.lua create mode 100644 lua/user/options.lua create mode 100644 lua/user/plugins/colorschemes.lua create mode 100644 lua/user/plugins/copilot.lua create mode 100644 lua/user/plugins/neotree.lua create mode 100644 lua/user/plugins/others.lua create mode 100644 lua/user/plugins/telescope.lua create mode 100644 lua/user/plugins/tpope.lua diff --git a/lua/user/mappings.lua b/lua/user/mappings.lua new file mode 100644 index 0000000..7a5ca19 --- /dev/null +++ b/lua/user/mappings.lua @@ -0,0 +1,32 @@ +return { + -- first key is the mode + n = { + -- second key is the lefthand side of the map + -- mappings seen under group name "Buffer" + -- ["bb"] = { "tabnew", desc = "New tab" }, + -- ["bc"] = { "BufferLinePickClose", desc = "Pick to close" }, + -- ["bj"] = { "BufferLinePick", desc = "Pick to jump" }, + -- ["bt"] = { "BufferLineSortByTabs", desc = "Sort by tabs" }, + + -- Easy buffer navigation + [""] = { "bnext", desc = "Switch to next buffer" }, + [""] = { "bprevious", desc = "Switch to previous buffer" }, + ["b>"] = { "bprevious", desc = "Switch to previous buffer" }, + + -- My personal keybindings + ["xb"] = { "Neotree toggle buffers left", desc = "Open neotree buffers" }, + ["xt"] = { "terminal tig", desc = "Open tig in a new tab" }, + ["tt"] = { "terminal tig", desc = "Open tig in a new tab" }, + -- quick save + -- [""] = { ":w!", desc = "Save File" }, -- change description but the same command + }, + t = { + -- setting a mapping to false will disable it + -- [""] = false, + -- Clear Ctrl+l so that we can use it to clear the terminal + [""] = false, + [""] = false, + -- Switch to normal mode in terminal mode + [""] = { "" } + }, +} diff --git a/lua/user/options.lua b/lua/user/options.lua new file mode 100644 index 0000000..5fd5213 --- /dev/null +++ b/lua/user/options.lua @@ -0,0 +1,30 @@ +-- set vim options here (vim.. = value) +return { + opt = { + relativenumber = false, -- sets vim.opt.relativenumber + cmdheight = 1, + -- number = true, -- sets vim.opt.number + -- spell = false, -- sets vim.opt.spell + -- signcolumn = "auto", -- sets vim.opt.signcolumn to auto + -- wrap = false, -- sets vim.opt.wrap + scrolloff = 0 + }, + g = { + -- mapleader = " ", -- sets vim.g.mapleader + -- autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) + -- cmp_enabled = true, -- enable completion at start + -- autopairs_enabled = true, -- enable autopairs at start + -- diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on) + -- icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) + -- ui_notifications_enabled = true, -- disable notifications when toggling UI elements + }, +} +-- If you need more control, you can use the function()...end notation +-- return function(local_vim) +-- local_vim.opt.relativenumber = true +-- local_vim.g.mapleader = " " +-- local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list +-- local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list +-- +-- return local_vim +-- end diff --git a/lua/user/plugins/colorschemes.lua b/lua/user/plugins/colorschemes.lua new file mode 100644 index 0000000..63b43dc --- /dev/null +++ b/lua/user/plugins/colorschemes.lua @@ -0,0 +1,8 @@ +return { + { "arcticicestudio/nord-vim" }, + { "cocopon/iceberg.vim" }, + { "jacoborus/tender.vim" }, + { "altercation/vim-colors-solarized" }, + { "bluz71/vim-moonfly-colors" }, + { "joshdick/onedark.vim" }, +} diff --git a/lua/user/plugins/copilot.lua b/lua/user/plugins/copilot.lua new file mode 100644 index 0000000..7fbfef8 --- /dev/null +++ b/lua/user/plugins/copilot.lua @@ -0,0 +1,35 @@ +-- Github Copilot + +-- Official plugin +-- https://docs.github.com/fr/copilot/getting-started-with-github-copilot?tool=neovim +-- return { +-- { +-- "github/copilot.vim", +-- config = function() +-- require("_copilot").setup() -- NOT WORKING +-- end, +-- event = "InsertEnter", +-- }, +-- } +-- + + +-- Alternative plugin in pure lua +-- https://github.com/zbirenbaum/copilot.lua +return { + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup() + end, + } + , + { + "zbirenbaum/copilot-cmp", + config = function() + require("copilot_cmp").setup() + end + } +} diff --git a/lua/user/plugins/neotree.lua b/lua/user/plugins/neotree.lua new file mode 100644 index 0000000..d5e6a76 --- /dev/null +++ b/lua/user/plugins/neotree.lua @@ -0,0 +1,9 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + close_if_last_window = true, + window = { width = 50 }, + } + } +} diff --git a/lua/user/plugins/others.lua b/lua/user/plugins/others.lua new file mode 100644 index 0000000..71e32c5 --- /dev/null +++ b/lua/user/plugins/others.lua @@ -0,0 +1,10 @@ +return { + { "diepm/vim-rest-console" }, + { + "nvim-pack/nvim-spectre", + event = "BufRead", + config = function() + require("spectre").setup() + end, + }, +} diff --git a/lua/user/plugins/telescope.lua b/lua/user/plugins/telescope.lua new file mode 100644 index 0000000..bbcde2c --- /dev/null +++ b/lua/user/plugins/telescope.lua @@ -0,0 +1,11 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-telescope/telescope-file-browser.nvim", + }, + config = function(...) + require "plugins.configs.telescope" (...) + local telescope = require "telescope" + telescope.load_extension "file_browser" + end, +} diff --git a/lua/user/plugins/tpope.lua b/lua/user/plugins/tpope.lua new file mode 100644 index 0000000..d782cd3 --- /dev/null +++ b/lua/user/plugins/tpope.lua @@ -0,0 +1,5 @@ +return { + { "tpope/vim-surround" }, + { "tpope/vim-speeddating" }, + { "tpope/vim-repeat" }, +}