Merge branch 'master' into patch-1
This commit is contained in:
commit
08e50e5440
24
init.lua
24
init.lua
|
@ -8,7 +8,7 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
|||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
require('packer').startup(function(use)
|
||||
require('packer').startup(function(use
|
||||
use 'wbthomason/packer.nvim' -- Package manager
|
||||
use 'tpope/vim-fugitive' -- Git commands in nvim
|
||||
use 'tpope/vim-rhubarb' -- Fugitive-companion to interact with github
|
||||
|
@ -17,14 +17,17 @@ require('packer').startup(function(use)
|
|||
use 'nvim-treesitter/nvim-treesitter' -- Highlight, edit, and navigate code
|
||||
use 'nvim-treesitter/nvim-treesitter-textobjects' -- Additional textobjects for treesitter
|
||||
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 'williamboman/mason-lspconfig.nvim' -- Automatically install language servers to stdpath
|
||||
use { 'hrsh7th/nvim-cmp', requires = { 'hrsh7th/cmp-nvim-lsp' } } -- Autocompletion
|
||||
use { 'L3MON4D3/LuaSnip', requires = { 'saadparwaiz1/cmp_luasnip' } } -- Snippet Engine and Snippet Expansion
|
||||
use 'mjlbach/onedark.nvim' -- Theme inspired by Atom
|
||||
use 'nvim-lualine/lualine.nvim' -- Fancier statusline
|
||||
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
|
||||
use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically
|
||||
use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/plenary.nvim' } } -- Fuzzy Finder (files, lsp, etc)
|
||||
|
||||
-- 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
|
||||
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`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- 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 },
|
||||
indent = { enable = true },
|
||||
|
@ -289,17 +292,26 @@ local on_attach = function(_, bufnr)
|
|||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- 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
|
||||
|
||||
-- nvim-cmp supports additional completion 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
|
||||
local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua' }
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
require('nvim-lsp-installer').setup {
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = servers,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue