feat: Update config
This commit is contained in:
parent
bc865e43e0
commit
a5cf46b093
51
lua/user/init.lua
Normal file
51
lua/user/init.lua
Normal 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,
|
||||||
|
}
|
@ -1,8 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
-- first key is the mode
|
-- Normal mode
|
||||||
n = {
|
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>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||||
-- ["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
|
-- ["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
|
||||||
-- ["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
|
-- ["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
|
||||||
@ -11,15 +9,29 @@ return {
|
|||||||
-- Easy buffer navigation
|
-- Easy buffer navigation
|
||||||
["<tab>"] = { "<cmd>bnext<cr>", desc = "Switch to next buffer" },
|
["<tab>"] = { "<cmd>bnext<cr>", desc = "Switch to next buffer" },
|
||||||
["<S-tab>"] = { "<cmd>bprevious<cr>", desc = "Switch to previous 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
|
-- quick save
|
||||||
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
-- ["<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 = {
|
t = {
|
||||||
-- setting a mapping to false will disable it
|
-- setting a mapping to false will disable it
|
||||||
-- ["<esc>"] = false,
|
-- ["<esc>"] = false,
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
return {
|
return {
|
||||||
{ "arcticicestudio/nord-vim" },
|
{ 'arcticicestudio/nord-vim', lazy = false },
|
||||||
{ "cocopon/iceberg.vim" },
|
{ 'shaunsingh/nord.nvim', lazy = false },
|
||||||
{ "jacoborus/tender.vim" },
|
{ 'andersevenrud/nordic.nvim', lazy = false },
|
||||||
{ "altercation/vim-colors-solarized" },
|
{ 'cocopon/iceberg.vim', lazy = false },
|
||||||
{ "bluz71/vim-moonfly-colors" },
|
|
||||||
{ "joshdick/onedark.vim" },
|
{ '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 },
|
||||||
}
|
}
|
||||||
|
@ -2,34 +2,35 @@
|
|||||||
|
|
||||||
-- Official plugin
|
-- Official plugin
|
||||||
-- https://docs.github.com/fr/copilot/getting-started-with-github-copilot?tool=neovim
|
-- https://docs.github.com/fr/copilot/getting-started-with-github-copilot?tool=neovim
|
||||||
-- return {
|
return {
|
||||||
-- {
|
{
|
||||||
-- "github/copilot.vim",
|
"github/copilot.vim",
|
||||||
-- config = function()
|
event = "InsertEnter",
|
||||||
-- require("_copilot").setup() -- NOT WORKING
|
keys = {
|
||||||
-- end,
|
{ "<F12>", "<cmd>Copilot panel<CR>", mode = { "n", "i", "v" }, desc = "Display Copilot panel" },
|
||||||
-- event = "InsertEnter",
|
-- { "<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
|
-- Alternative plugin in pure lua
|
||||||
-- https://github.com/zbirenbaum/copilot.lua
|
-- https://github.com/zbirenbaum/copilot.lua
|
||||||
return {
|
-- return {
|
||||||
{
|
-- {
|
||||||
"zbirenbaum/copilot.lua",
|
-- "zbirenbaum/copilot.lua",
|
||||||
cmd = "Copilot",
|
-- config = function()
|
||||||
event = "InsertEnter",
|
-- require("copilot").setup()
|
||||||
config = function()
|
-- end,
|
||||||
require("copilot").setup()
|
-- cmd = "Copilot",
|
||||||
end,
|
-- event = "InsertEnter",
|
||||||
}
|
-- }
|
||||||
,
|
-- ,
|
||||||
{
|
-- -- {
|
||||||
"zbirenbaum/copilot-cmp",
|
-- -- "zbirenbaum/copilot-cmp",
|
||||||
config = function()
|
-- -- config = function()
|
||||||
require("copilot_cmp").setup()
|
-- -- require("copilot_cmp").setup()
|
||||||
end
|
-- -- end
|
||||||
}
|
-- -- }
|
||||||
}
|
}
|
||||||
|
19
lua/user/plugins/null-ls.lua
Normal file
19
lua/user/plugins/null-ls.lua
Normal 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,
|
||||||
|
}
|
@ -1,10 +1,14 @@
|
|||||||
return {
|
return {
|
||||||
{ "diepm/vim-rest-console" },
|
-- direnv
|
||||||
|
{ "direnv/direnv.vim", lazy = false },
|
||||||
|
|
||||||
|
-- Search and replace
|
||||||
{
|
{
|
||||||
"nvim-pack/nvim-spectre",
|
"nvim-pack/nvim-spectre",
|
||||||
event = "BufRead",
|
cmd = { "Spectre", "SpectreReload" },
|
||||||
config = function()
|
|
||||||
require("spectre").setup()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- REST client
|
||||||
|
{ "diepm/vim-rest-console", event = "User AstroFile" },
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
{ "tpope/vim-surround" },
|
{ "tpope/vim-surround", event = "User AstroFile" },
|
||||||
{ "tpope/vim-speeddating" },
|
{ "tpope/vim-speeddating", event = "User AstroFile" },
|
||||||
{ "tpope/vim-repeat" },
|
{ "tpope/vim-repeat", event = "User AstroFile" },
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user