Move keymaps to on_attach function, disable current line highlight
This commit is contained in:
parent
672b50786b
commit
27c72a484d
18
init.lua
18
init.lua
|
@ -1,10 +1,26 @@
|
|||
vim.o.showtabline = 2
|
||||
require('gitsigns').setup()
|
||||
require('tabby.tabline').use_preset('active_wins_at_tail', { nerdfont = false })
|
||||
require('trouble').setup()
|
||||
require('fidget').setup()
|
||||
require('hop').setup()
|
||||
|
||||
-- gitsigns config
|
||||
require('gitsigns').setup{
|
||||
signcolumn = true,
|
||||
numhl = true,
|
||||
linehl = true,
|
||||
current_line_blame = true,
|
||||
on_attach = function(bufnr)
|
||||
-- Setup keymaps
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[g', '<cmd>Gitsigns prev_hunk<CR>', {})
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']g', '<cmd>Gitsigns next_hunk<CR>', {})
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hp', '<cmd>Gitsigns preview_hunk<CR>', {})
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hs', '<cmd>Gitsigns select_hunk<CR>', {})
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bl', '<cmd>Gitsigns blame_line<CR>', {})
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bt', '<cmd>Gitsigns toggle_current_line_blame<CR>', {})
|
||||
end,
|
||||
}
|
||||
|
||||
-- lualine config
|
||||
require('lualine').setup{
|
||||
options = {
|
||||
|
|
4
init.vim
4
init.vim
|
@ -71,8 +71,6 @@ if executable('ag')
|
|||
let g:ackprg = 'ag --vimgrep'
|
||||
endif
|
||||
|
||||
set cursorline
|
||||
|
||||
set number
|
||||
set relativenumber
|
||||
set listchars=trail:.,tab:>_
|
||||
|
@ -125,8 +123,6 @@ nnoremap <leader>nt <cmd>NvimTreeToggle<cr>
|
|||
nnoremap <leader>nf <cmd>NvimTreeFindFile<cr>
|
||||
nnoremap [g <cmd>Gitsigns prev_hunk<cr>
|
||||
nnoremap ]g <cmd>Gitsigns next_hunk<cr>
|
||||
nnoremap <leader>hp <cmd>Gitsigns preview_hunk<cr>
|
||||
nnoremap <leader>hs <cmd>Gitsigns select_hunk<cr>
|
||||
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
|
Loading…
Reference in a new issue