aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2023-03-02 13:53:35 -0700
committerCody Hiar <cody@hiar.ca>2023-03-02 13:53:35 -0700
commitec2fd73bc9a72040daf471c4e51ba16a99de73aa (patch)
treed74261d813436e1cb884bb023767e6c953262b12
parentfe0e6818d1ac1d89465c94457a961b5d54436d67 (diff)
Revert "testing copilot"
This reverts commit fe0e6818d1ac1d89465c94457a961b5d54436d67.
-rw-r--r--flake.nix3
-rw-r--r--init.lua92
2 files changed, 47 insertions, 48 deletions
diff --git a/flake.nix b/flake.nix
index 3c7161c..cab6a93 100644
--- a/flake.nix
+++ b/flake.nix
@@ -68,7 +68,7 @@
# Autocompletes
nvim-lspconfig
nvim-cmp
- /* cmp-nvim-lsp */
+ cmp-nvim-lsp
# File navigation
lf-vim
@@ -92,7 +92,6 @@
LanguageTool-nvim
camelcasemotion
vim-table-mode
- copilot-vim
];
};
};
diff --git a/init.lua b/init.lua
index 6b436e9..b17b046 100644
--- a/init.lua
+++ b/init.lua
@@ -222,53 +222,53 @@ end
-- local servers = { 'pyls', 'rust_analyzer', 'tsserver' }
local servers = { 'jedi_language_server', 'bashls', 'terraformls' }
-- Add additional capabilities supported by nvim-cmp
--- local capabilities = vim.lsp.protocol.make_client_capabilities()
--- capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
--- -- Setup language servers
--- for _, lsp in ipairs(servers) do
--- nvim_lsp[lsp].setup {
--- on_attach = on_attach,
--- flags = {
--- debounce_text_changes = 150,
--- },
--- capabilities = capabilities,
--- }
--- end
--- -- Set completeopt to have a better completion experience
--- vim.o.completeopt = 'menuone,noselect'
+local capabilities = vim.lsp.protocol.make_client_capabilities()
+capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
+-- Setup language servers
+for _, lsp in ipairs(servers) do
+ nvim_lsp[lsp].setup {
+ on_attach = on_attach,
+ flags = {
+ debounce_text_changes = 150,
+ },
+ capabilities = capabilities,
+ }
+end
+-- Set completeopt to have a better completion experience
+vim.o.completeopt = 'menuone,noselect'
-- nvim-cmp setup
--- local cmp = require 'cmp'
--- cmp.setup {
--- mapping = {
--- ['<C-p>'] = cmp.mapping.select_prev_item(),
--- ['<C-n>'] = cmp.mapping.select_next_item(),
--- ['<C-d>'] = cmp.mapping.scroll_docs(-4),
--- ['<C-f>'] = cmp.mapping.scroll_docs(4),
--- ['<C-k>'] = cmp.mapping.complete(),
--- ['<C-e>'] = cmp.mapping.close(),
--- ['<CR>'] = cmp.mapping.confirm {
--- behavior = cmp.ConfirmBehavior.Replace,
--- select = true,
--- },
--- ['<Tab>'] = function(fallback)
--- if cmp.visible() then
--- cmp.select_next_item()
--- else
--- fallback()
--- end
--- end,
--- ['<S-Tab>'] = function(fallback)
--- if cmp.visible() then
--- cmp.select_prev_item()
--- else
--- fallback()
--- end
--- end,
--- },
--- sources = {
--- { name = 'nvim_lsp' },
--- },
--- }
+local cmp = require 'cmp'
+cmp.setup {
+ mapping = {
+ ['<C-p>'] = cmp.mapping.select_prev_item(),
+ ['<C-n>'] = cmp.mapping.select_next_item(),
+ ['<C-d>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-k>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.close(),
+ ['<CR>'] = cmp.mapping.confirm {
+ behavior = cmp.ConfirmBehavior.Replace,
+ select = true,
+ },
+ ['<Tab>'] = function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ else
+ fallback()
+ end
+ end,
+ ['<S-Tab>'] = function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ else
+ fallback()
+ end
+ end,
+ },
+ sources = {
+ { name = 'nvim_lsp' },
+ },
+}
-- nvim-fzf
vim.api.nvim_set_keymap('n', '<leader>ff', "<cmd>Files<cr>", { noremap = true })