feat: Update config

This commit is contained in:
Xavier Logerais 2023-05-23 19:35:54 +02:00
parent bc865e43e0
commit a5cf46b093
7 changed files with 147 additions and 48 deletions

51
lua/user/init.lua Normal file
View File

@ -0,0 +1,51 @@
return {
colorscheme = "vscode",
-- This function is run last and is a good place to configuring
-- augroups/autocommands and custom filetypes also this just pure lua so
-- anything that doesn't fit in the normal config locations above can go here
polish = function()
-- Set key binding
-- Set autocommands
-- vim.api.nvim_create_augroup("packer_conf", { clear = true })
-- vim.api.nvim_create_autocmd("BufWritePost", {
-- desc = "Sync packer after modifying plugins.lua",
-- group = "packer_conf",
-- pattern = "plugins.lua",
-- command = "source <afile> | PackerSync",
-- })
-- Set up custom autocmds
vim.api.nvim_create_augroup("myterm", { clear = true })
vim.api.nvim_create_autocmd("TermOpen", {
desc = "Auto switch to insert mode for terminal",
group = "myterm",
pattern = "term://*",
command = "startinsert",
})
-- Set up custom filetypes
-- vim.filetype.add {
-- extension = {
-- foo = "fooscript",
-- },
-- filename = {
-- ["Foofile"] = "fooscript",
-- },
-- pattern = {
-- ["~/%.config/foo/.*"] = "fooscript",
-- },
-- }
vim.filetype.add {
filename = {
["Jenkinsfile"] = "groovy",
},
extension = {
Jenkinsfile = "groovy",
},
}
-- Copilot
-- TODO: find a better way
vim.g.copilot_no_tab_map = true
vim.cmd("imap <silent><script><expr> <C-a> copilot#Accept(\"\\<CR>\")")
end,
}

View File

@ -1,8 +1,6 @@
return {
-- first key is the mode
-- Normal mode
n = {
-- second key is the lefthand side of the map
-- mappings seen under group name "Buffer"
-- ["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
-- ["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
-- ["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
@ -11,15 +9,29 @@ return {
-- Easy buffer navigation
["<tab>"] = { "<cmd>bnext<cr>", desc = "Switch to next buffer" },
["<S-tab>"] = { "<cmd>bprevious<cr>", desc = "Switch to previous buffer" },
["<leader>b>"] = { "<cmd>bprevious<cr>", desc = "Switch to previous buffer" },
-- My personal keybindings
["<leader>xb"] = { "<cmd>Neotree toggle buffers left<cr>", desc = "Open neotree buffers" },
["<leader>xt"] = { "<cmd>terminal tig<cr>", desc = "Open tig in a new tab" },
["<leader>tt"] = { "<cmd>terminal tig<cr>", desc = "Open tig in a new tab" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
-- My personal keybindings
["<leader>x"] = { name = "Personal" },
["<leader>xn"] = { name = "Neotree" },
["<leader>xnb"] = { "<cmd>Neotree toggle buffers left<cr>", desc = "Open Neotree Buffers" },
["<leader>xng"] = { "<cmd>Neotree toggle git_status left<cr>", desc = "Open Neotree Git status" },
["<leader>xt"] = { "<cmd>terminal tig<cr>", desc = "Open tig in a new tab" },
["<leader>xs"] = { "<cmd>Spectre<cr>", desc = "Spectre (search and replace)" },
-- My telescope keybindings
["<leader>fo"] = { "<cmd>Telescope spell_suggest<cr>", desc = "Spell suggegestion with telescope" },
},
-- Insert mode
i = {},
-- Terminal mode
t = {
-- setting a mapping to false will disable it
-- ["<esc>"] = false,

View File

@ -1,8 +1,20 @@
return {
{ "arcticicestudio/nord-vim" },
{ "cocopon/iceberg.vim" },
{ "jacoborus/tender.vim" },
{ "altercation/vim-colors-solarized" },
{ "bluz71/vim-moonfly-colors" },
{ "joshdick/onedark.vim" },
{ 'arcticicestudio/nord-vim', lazy = false },
{ 'shaunsingh/nord.nvim', lazy = false },
{ 'andersevenrud/nordic.nvim', lazy = false },
{ 'cocopon/iceberg.vim', lazy = false },
{ 'jacoborus/tender.vim', lazy = false },
{ 'altercation/vim-colors-solarized', lazy = false },
{ 'bluz71/vim-moonfly-colors', lazy = false },
{ 'joshdick/onedark.vim', lazy = false },
{ 'ray-x/aurora', lazy = false },
{
'projekt0n/github-nvim-theme',
version = 'v0.0.7',
lazy = false
},
-- Default theme
{ 'Mofiqul/vscode.nvim', lazy = false },
}

View File

@ -2,34 +2,35 @@
-- 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",
"github/copilot.vim",
event = "InsertEnter",
config = function()
require("copilot").setup()
end,
}
,
{
"zbirenbaum/copilot-cmp",
config = function()
require("copilot_cmp").setup()
end
keys = {
{ "<F12>", "<cmd>Copilot panel<CR>", mode = { "n", "i", "v" }, desc = "Display Copilot panel" },
-- { "<C-a>", "<cmd>copilot#Accept()<CR>", mode = "i", desc = "Accept Copilot solution", { silent = true, expr = true } },
},
}
-- imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
-- let g:copilot_no_tab_map = v:true
-- Alternative plugin in pure lua
-- https://github.com/zbirenbaum/copilot.lua
-- return {
-- {
-- "zbirenbaum/copilot.lua",
-- config = function()
-- require("copilot").setup()
-- end,
-- cmd = "Copilot",
-- event = "InsertEnter",
-- }
-- ,
-- -- {
-- -- "zbirenbaum/copilot-cmp",
-- -- config = function()
-- -- require("copilot_cmp").setup()
-- -- end
-- -- }
}

View File

@ -0,0 +1,19 @@
return {
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, config)
-- config variable is the default configuration table for the setup function call
local null_ls = require "null-ls"
-- Check supported formatters and linters
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
config.sources = {
-- Set a formatter
-- null_ls.builtins.formatting.stylua,
-- null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.npm_groovy_lint,
null_ls.builtins.diagnostics.npm_groovy_lint,
}
return config -- return final config table
end,
}

View File

@ -1,10 +1,14 @@
return {
{ "diepm/vim-rest-console" },
-- direnv
{ "direnv/direnv.vim", lazy = false },
-- Search and replace
{
"nvim-pack/nvim-spectre",
event = "BufRead",
config = function()
require("spectre").setup()
end,
cmd = { "Spectre", "SpectreReload" },
},
-- REST client
{ "diepm/vim-rest-console", event = "User AstroFile" },
}

View File

@ -1,5 +1,5 @@
return {
{ "tpope/vim-surround" },
{ "tpope/vim-speeddating" },
{ "tpope/vim-repeat" },
{ "tpope/vim-surround", event = "User AstroFile" },
{ "tpope/vim-speeddating", event = "User AstroFile" },
{ "tpope/vim-repeat", event = "User AstroFile" },
}