feat(nvim): upgrade to latest commit
Also, use `gitsigns` shortcuts delivered in kickstart repo.
This commit is contained in:
parent
fb6e491e8e
commit
2b5e1f6339
@ -180,7 +180,7 @@ COPY ./patch/kickstart.nvim/updates.patch /tmp
|
||||
COPY ./config/nvim/lua/custom/plugins/init.lua /tmp
|
||||
RUN git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME}"/nvim \
|
||||
&& cd ${XDG_CONFIG_HOME}/nvim \
|
||||
&& git reset --hard c4363e4ad8aa3269a581d89b1e11403dd89df291 \
|
||||
&& git reset --hard b9bd02d55b77293291a38fac9abe46acad9ab91d \
|
||||
&& git apply /tmp/updates.patch \
|
||||
&& cp /tmp/init.lua ${XDG_CONFIG_HOME}/nvim/lua/custom/plugins \
|
||||
&& nvim --headless "+Lazy! sync" +qa
|
||||
|
@ -3,71 +3,6 @@
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map({ 'n', 'v' }, ']c', function()
|
||||
if vim.wo.diff then
|
||||
return ']c'
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, desc = 'Jump to next hunk' })
|
||||
|
||||
map({ 'n', 'v' }, '[c', function()
|
||||
if vim.wo.diff then
|
||||
return '[c'
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, desc = 'Jump to previous hunk' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'stage git hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'reset git hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gs.stage_hunk, { desc = 'git stage hunk' })
|
||||
map('n', '<leader>hr', gs.reset_hunk, { desc = 'git reset hunk' })
|
||||
map('n', '<leader>hS', gs.stage_buffer, { desc = 'git Stage buffer' })
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' })
|
||||
map('n', '<leader>hR', gs.reset_buffer, { desc = 'git Reset buffer' })
|
||||
map('n', '<leader>hp', gs.preview_hunk, { desc = 'preview git hunk' })
|
||||
map('n', '<leader>hb', function()
|
||||
gs.blame_line { full = false }
|
||||
end, { desc = 'git blame line' })
|
||||
map('n', '<leader>hd', gs.diffthis, { desc = 'git diff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gs.diffthis '~'
|
||||
end, { desc = 'git diff against last commit' })
|
||||
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' })
|
||||
map('n', '<leader>td', gs.toggle_deleted, { desc = 'toggle git show deleted' })
|
||||
|
||||
-- Text object
|
||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
'joaodubas/gitlinker.nvim',
|
||||
config = function()
|
||||
|
@ -1,11 +1,11 @@
|
||||
diff --git a/init.lua b/init.lua
|
||||
index 496f45b..c667dc3 100644
|
||||
index 88658ef..d9e96ee 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Set to true if you have a Nerd Font installed
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
-vim.g.have_nerd_font = false
|
||||
+vim.g.have_nerd_font = true
|
||||
|
||||
@ -39,15 +39,7 @@ index 496f45b..c667dc3 100644
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- See `:help vim.keymap.set()`
|
||||
|
||||
@@ -283,6 +291,7 @@ require('lazy').setup({
|
||||
require('which-key').register {
|
||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||
+ ['<leader>h'] = { name = 'Git [h]unk', _ = 'which_key_ignore' },
|
||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||
@@ -551,6 +560,18 @@ require('lazy').setup({
|
||||
@@ -578,6 +586,18 @@ require('lazy').setup({
|
||||
-- tsserver = {},
|
||||
--
|
||||
|
||||
@ -66,7 +58,7 @@ index 496f45b..c667dc3 100644
|
||||
lua_ls = {
|
||||
-- cmd = {...},
|
||||
-- filetypes = { ...},
|
||||
@@ -565,6 +586,10 @@ require('lazy').setup({
|
||||
@@ -592,6 +612,10 @@ require('lazy').setup({
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -77,7 +69,7 @@ index 496f45b..c667dc3 100644
|
||||
}
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
@@ -591,6 +616,33 @@ require('lazy').setup({
|
||||
@@ -618,6 +642,33 @@ require('lazy').setup({
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
@ -111,15 +103,16 @@ index 496f45b..c667dc3 100644
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
@@ -802,7 +854,37 @@ require('lazy').setup({
|
||||
@@ -835,7 +886,38 @@ require('lazy').setup({
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
- ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
||||
- ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
||||
+ ensure_installed = {
|
||||
+ 'bash',
|
||||
+ 'c',
|
||||
+ 'css',
|
||||
+ 'diff',
|
||||
+ 'dockerfile',
|
||||
+ 'eex',
|
||||
+ 'elixir',
|
||||
@ -150,16 +143,20 @@ index 496f45b..c667dc3 100644
|
||||
-- Autoinstall languages that are not installed
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
@@ -839,7 +921,7 @@ require('lazy').setup({
|
||||
@@ -874,18 +956,18 @@ require('lazy').setup({
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug',
|
||||
- -- require 'kickstart.plugins.indent_line',
|
||||
+ require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
-- require 'kickstart.plugins.neo-tree',
|
||||
- -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
+ require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
@@ -847,7 +929,7 @@ require('lazy').setup({
|
||||
-- This is the easiest way to modularize your config.
|
||||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
||||
|
Loading…
x
Reference in New Issue
Block a user