ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.22k stars 107 forks source link

errors with neovim this repo config #34

Closed rajcspsg closed 2 years ago

rajcspsg commented 2 years ago

Hi @ecosse3

I'm getting below errors after updating config to latest commit

https://imgur.com/a/9jeKAwO

Any idea hw to fix these errors?

ecosse3 commented 2 years ago

Could you check if it works correctly with dev branch for you now? I updated dressing.nvim config.

rajcspsg commented 2 years ago

dressing issue is not there in the dev branch. but the other issue with gitsigns still there.

"attempt to index field keymap (a nil value)"

olivierflowerror commented 2 years ago

As per the gitsigns README, the configuration currently used requires neovim v0.7 since it uses vim.keymap.set.

Changing ~/.config/nvim/lua/plugins/gitsigns.lua to

require('gitsigns').setup {
  ---omitted the rest of the config
  on_attach = function(bufnr)
    local function map(mode, lhs, rhs, opts)
        opts = vim.tbl_extend('force', {noremap = true, silent = true}, opts or {})
        vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
    end

    -- Navigation
    map('n', ']c', "&diff ? ']c' : '<cmd>Gitsigns next_hunk<CR>'", {expr=true})
    map('n', '[c', "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<CR>'", {expr=true})

    -- Actions
    map('n', '<leader>hs', ':Gitsigns stage_hunk<CR>')
    map('v', '<leader>hs', ':Gitsigns stage_hunk<CR>')
    map('n', '<leader>hr', ':Gitsigns reset_hunk<CR>')
    map('v', '<leader>hr', ':Gitsigns reset_hunk<CR>')
    map('n', '<leader>hS', '<cmd>Gitsigns stage_buffer<CR>')
    map('n', '<leader>hu', '<cmd>Gitsigns undo_stage_hunk<CR>')
    map('n', '<leader>hR', '<cmd>Gitsigns reset_buffer<CR>')
    map('n', '<leader>hp', '<cmd>Gitsigns preview_hunk<CR>')
    map('n', '<leader>hb', '<cmd>lua require"gitsigns".blame_line{full=true}<CR>')
    map('n', '<leader>tb', '<cmd>Gitsigns toggle_current_line_blame<CR>')
    map('n', '<leader>hd', '<cmd>Gitsigns diffthis<CR>')
    map('n', '<leader>hD', '<cmd>lua require"gitsigns".diffthis("~")<CR>')
    map('n', '<leader>td', '<cmd>Gitsigns toggle_deleted<CR>')

    -- Text object
    map('o', 'ih', ':<C-U>Gitsigns select_hunk<CR>')
    map('x', 'ih', ':<C-U>Gitsigns select_hunk<CR>')
  end
  }

should get rid of the error. Or you can update to a newer version of neovim.

ecosse3 commented 2 years ago

@rajcspsg Were you able to fix your issues?

rajcspsg commented 2 years ago

@ecosse3 yeap It fixes my issue