diff options
author | Yigit Sever | 2021-11-07 23:37:50 +0300 |
---|---|---|
committer | Yigit Sever | 2021-11-07 23:37:50 +0300 |
commit | 87e1645ff32b91f28bee66dfd34ea3eb43575382 (patch) | |
tree | 6360be853e3274d4ffc03f8f0e5d5272e06831da /.config/nvim/lua | |
parent | a2581b076712bb1997c3856019742df27d15cfac (diff) | |
download | dotfiles-87e1645ff32b91f28bee66dfd34ea3eb43575382.tar.gz dotfiles-87e1645ff32b91f28bee66dfd34ea3eb43575382.tar.bz2 dotfiles-87e1645ff32b91f28bee66dfd34ea3eb43575382.zip |
nvim: migrate to gitsigns from gitgutter
Diffstat (limited to '.config/nvim/lua')
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 70 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 12 |
2 files changed, 79 insertions, 3 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index bff9bcb..ddc7371 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -462,3 +462,73 @@ require'nvim-tree'.setup { | |||
462 | -- nvim-colorizer {{{ -- | 462 | -- nvim-colorizer {{{ -- |
463 | require 'colorizer'.setup() | 463 | require 'colorizer'.setup() |
464 | -- }}} nvim-colorizer -- | 464 | -- }}} nvim-colorizer -- |
465 | |||
466 | -- gitsigns.nvim {{{ -- | ||
467 | |||
468 | require('gitsigns').setup { | ||
469 | signs = { | ||
470 | add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, | ||
471 | change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, | ||
472 | delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, | ||
473 | topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, | ||
474 | changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, | ||
475 | |||
476 | }, | ||
477 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` | ||
478 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` | ||
479 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` | ||
480 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` | ||
481 | keymaps = { | ||
482 | -- Default keymap options | ||
483 | noremap = true, | ||
484 | |||
485 | ['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns.actions\".next_hunk()<CR>'"}, | ||
486 | ['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns.actions\".prev_hunk()<CR>'"}, | ||
487 | |||
488 | ['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>', | ||
489 | ['v <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>', | ||
490 | ['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>', | ||
491 | ['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>', | ||
492 | ['v <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>', | ||
493 | ['n <leader>hR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>', | ||
494 | ['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>', | ||
495 | ['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line(true)<CR>', | ||
496 | ['n <leader>hS'] = '<cmd>lua require"gitsigns".stage_buffer()<CR>', | ||
497 | ['n <leader>hU'] = '<cmd>lua require"gitsigns".reset_buffer_index()<CR>', | ||
498 | |||
499 | -- Text objects | ||
500 | ['o ih'] = ':<C-U>lua require"gitsigns.actions".select_hunk()<CR>', | ||
501 | ['x ih'] = ':<C-U>lua require"gitsigns.actions".select_hunk()<CR>' | ||
502 | }, | ||
503 | watch_gitdir = { | ||
504 | interval = 1000, | ||
505 | follow_files = true | ||
506 | }, | ||
507 | attach_to_untracked = true, | ||
508 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` | ||
509 | current_line_blame_opts = { | ||
510 | virt_text = true, | ||
511 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' | ||
512 | delay = 1000, | ||
513 | }, | ||
514 | current_line_blame_formatter_opts = { | ||
515 | relative_time = false | ||
516 | }, | ||
517 | sign_priority = 6, | ||
518 | update_debounce = 100, | ||
519 | status_formatter = nil, -- Use default | ||
520 | max_file_length = 40000, | ||
521 | preview_config = { | ||
522 | -- Options passed to nvim_open_win | ||
523 | border = 'single', | ||
524 | style = 'minimal', | ||
525 | relative = 'cursor', | ||
526 | row = 0, | ||
527 | col = 1 | ||
528 | }, | ||
529 | yadm = { | ||
530 | enable = true | ||
531 | }, | ||
532 | } | ||
533 | |||
534 | -- }}} gitsigns.nvim -- | ||
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 6d982de..b3a87b2 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua | |||
@@ -31,10 +31,18 @@ return require('packer').startup(function() | |||
31 | -- find, filter, preview, pick | 31 | -- find, filter, preview, pick |
32 | use { | 32 | use { |
33 | 'nvim-telescope/telescope.nvim', | 33 | 'nvim-telescope/telescope.nvim', |
34 | requires = { {'nvim-lua/plenary.nvim'} } | 34 | requires = { 'nvim-lua/plenary.nvim' } |
35 | } | 35 | } |
36 | use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } | 36 | use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } |
37 | 37 | ||
38 | -- git integration for buffers | ||
39 | use { | ||
40 | 'lewis6991/gitsigns.nvim', | ||
41 | requires = { | ||
42 | 'nvim-lua/plenary.nvim' | ||
43 | }, | ||
44 | } | ||
45 | |||
38 | -- manages tag files | 46 | -- manages tag files |
39 | use 'ludovicchabant/vim-gutentags' | 47 | use 'ludovicchabant/vim-gutentags' |
40 | -- run tests (todo: write tests) | 48 | -- run tests (todo: write tests) |
@@ -45,8 +53,6 @@ return require('packer').startup(function() | |||
45 | use {'SirVer/ultisnips', 'honza/vim-snippets'} | 53 | use {'SirVer/ultisnips', 'honza/vim-snippets'} |
46 | -- autopairs for neovim | 54 | -- autopairs for neovim |
47 | use 'windwp/nvim-autopairs' | 55 | use 'windwp/nvim-autopairs' |
48 | -- git diff in the sign column | ||
49 | use 'airblade/vim-gitgutter' | ||
50 | -- completion preview of floating window | 56 | -- completion preview of floating window |
51 | use 'ncm2/float-preview.nvim' | 57 | use 'ncm2/float-preview.nvim' |
52 | -- indent guides | 58 | -- indent guides |