add copilot

This commit is contained in:
marekmichalski 2024-03-06 10:57:06 +01:00
parent 6fbca010b2
commit df7c677b01
2 changed files with 102 additions and 63 deletions

View file

@ -9,7 +9,7 @@ vim.opt.termguicolors = true
vim.opt.spelllang = 'en_us'
vim.opt.spell = true
require("custom.init")
require 'custom.init'
-- [[ Install `lazy.nvim` plugin manager ]]
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
@ -54,7 +54,7 @@ require('lazy').setup({
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
{ 'j-hui/fidget.nvim', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
@ -90,7 +90,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -301,6 +301,8 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.opt.wrap = true
vim.opt.linebreak = true
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
@ -398,8 +400,8 @@ vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc
vim.keymap.set('n', '<leader>sG', ':LiveGrepGitRoot<cr>', { desc = '[S]earch by [G]rep on Git Root' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
vim.keymap.set("n", "<leader>ps", function()
require('telescope.builtin').grep_string({ search = vim.fn.input("Grep > ") })
vim.keymap.set('n', '<leader>ps', function()
require('telescope.builtin').grep_string { search = vim.fn.input 'Grep > ' }
end)
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
@ -650,5 +652,6 @@ cmp.setup {
},
}
vim.g.copilot_assume_mapped = true
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et