Merge branch 'master' into patch-1

This commit is contained in:
Andrew Ferrier 2022-09-23 18:42:56 +01:00 committed by GitHub
commit 08e50e5440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 20 deletions

View File

@ -8,23 +8,26 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
end end
-- stylua: ignore start -- stylua: ignore start
require('packer').startup(function(use) require('packer').startup(function(use
use 'wbthomason/packer.nvim' -- Package manager use 'wbthomason/packer.nvim' -- Package manager
use 'tpope/vim-fugitive' -- Git commands in nvim use 'tpope/vim-fugitive' -- Git commands in nvim
use 'tpope/vim-rhubarb' -- Fugitive-companion to interact with github use 'tpope/vim-rhubarb' -- Fugitive-companion to interact with github
use 'lewis6991/gitsigns.nvim' -- Add git related info in the signs columns and popups use 'lewis6991/gitsigns.nvim' -- Add git related info in the signs columns and popups
use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines
use 'nvim-treesitter/nvim-treesitter' -- Highlight, edit, and navigate code use 'nvim-treesitter/nvim-treesitter' -- Highlight, edit, and navigate code
use 'nvim-treesitter/nvim-treesitter-textobjects' -- Additional textobjects for treesitter use 'nvim-treesitter/nvim-treesitter-textobjects' -- Additional textobjects for treesitter
use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client
use 'williamboman/nvim-lsp-installer' -- Automatically install language servers to stdpath use 'williamboman/mason.nvim' -- Manage external editor tooling i.e LSP servers
use { 'hrsh7th/nvim-cmp', requires = { 'hrsh7th/cmp-nvim-lsp' } } -- Autocompletion use 'williamboman/mason-lspconfig.nvim' -- Automatically install language servers to stdpath
use { 'L3MON4D3/LuaSnip', requires = { 'saadparwaiz1/cmp_luasnip' } } -- Snippet Engine and Snippet Expansion use { 'hrsh7th/nvim-cmp', requires = { 'hrsh7th/cmp-nvim-lsp' } } -- Autocompletion
use 'mjlbach/onedark.nvim' -- Theme inspired by Atom use { 'L3MON4D3/LuaSnip', requires = { 'saadparwaiz1/cmp_luasnip' } } -- Snippet Engine and Snippet Expansion
use 'nvim-lualine/lualine.nvim' -- Fancier statusline use 'mjlbach/onedark.nvim' -- Theme inspired by Atom
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines use 'nvim-lualine/lualine.nvim' -- Fancier statusline
use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/plenary.nvim' } } -- Fuzzy Finder (files, lsp, etc) use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically
-- Fuzzy Finder (files, lsp, etc)
use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/plenary.nvim' } }
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available -- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable "make" == 1 } use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable "make" == 1 }
@ -185,7 +188,7 @@ vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { de
-- See `:help nvim-treesitter` -- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'lua', 'typescript', 'rust', 'go', 'python' }, ensure_installed = {'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript'},
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
@ -289,17 +292,26 @@ local on_attach = function(_, bufnr)
end, '[W]orkspace [L]ist Folders') end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer -- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', vim.lsp.buf.format or vim.lsp.buf.formatting, { desc = 'Format current buffer with LSP' }) vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
if vim.lsp.buf.format then
vim.lsp.buf.format()
elseif vim.lsp.buf.formatting then
vim.lsp.buf.formatting()
end
end, { desc = 'Format current buffer with LSP' })
end end
-- nvim-cmp supports additional completion capabilities -- nvim-cmp supports additional completion capabilities
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-- Setup mason so it can manage external tooling
require('mason').setup()
-- Enable the following language servers -- Enable the following language servers
local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua' } local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua' }
-- Ensure the servers above are installed -- Ensure the servers above are installed
require('nvim-lsp-installer').setup { require('mason-lspconfig').setup {
ensure_installed = servers, ensure_installed = servers,
} }