Keep plugin declaration and setup close
This commit is contained in:
parent
99845f6c4f
commit
8c42072f08
@ -18,7 +18,12 @@ require('packer').startup(function(use)
|
||||
-- Snippets
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
{ 'rafamadriz/friendly-snippets' },
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
local lsp = require('lsp-zero')
|
||||
lsp.preset('recommended')
|
||||
lsp.setup()
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
@ -30,44 +35,10 @@ require('packer').startup(function(use)
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
{ 'mfussenegger/nvim-dap' },
|
||||
},
|
||||
}
|
||||
config = function()
|
||||
local rt = require("rust-tools")
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
||||
}
|
||||
|
||||
use { 'kien/ctrlp.vim' }
|
||||
|
||||
use { 'tpope/vim-commentary' }
|
||||
use { 'tpope/vim-surround' }
|
||||
-- repeat plugin commands using `.`
|
||||
use { 'tpope/vim-repeat' }
|
||||
-- autodetect indentation
|
||||
use { 'tpope/vim-sleuth' }
|
||||
|
||||
-- git
|
||||
use { 'tpope/vim-fugitive' }
|
||||
use { 'airblade/vim-gitgutter' }
|
||||
|
||||
use { 'farmergreg/vim-lastplace' }
|
||||
|
||||
use { 'bronson/vim-trailing-whitespace' }
|
||||
end)
|
||||
|
||||
local lsp = require('lsp-zero')
|
||||
|
||||
lsp.preset('recommended')
|
||||
lsp.setup()
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = { "rust", "nix" },
|
||||
highlight={enable=true},
|
||||
}
|
||||
|
||||
local rt = require("rust-tools")
|
||||
|
||||
rt.setup({
|
||||
rt.setup({
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
-- Hover actions
|
||||
@ -76,4 +47,99 @@ rt.setup({
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = { "rust", "nix" },
|
||||
highlight={enable=true},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
-- use { 'kien/ctrlp.vim' }
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
||||
requires = {
|
||||
{ 'nvim-lua/plenary.nvim' }
|
||||
},
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<c-p>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
end,
|
||||
}
|
||||
|
||||
use { 'tpope/vim-commentary' }
|
||||
use { 'tpope/vim-surround' }
|
||||
-- repeat plugin commands using `.`
|
||||
use { 'tpope/vim-repeat' }
|
||||
-- autodetect indentation
|
||||
use { 'tpope/vim-sleuth' }
|
||||
-- autoclose quotes, brackets, ...
|
||||
use { 'Raimondi/delimitMate' }
|
||||
-- TODO: evaluate if usefull
|
||||
-- use {
|
||||
-- "windwp/nvim-autopairs",
|
||||
-- config = function()
|
||||
-- require("nvim-autopairs").setup({
|
||||
-- -- check_ts = true,
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
-- git
|
||||
use { 'tpope/vim-fugitive' }
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
require('gitsigns').setup({
|
||||
current_line_blame = true,
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use { 'farmergreg/vim-lastplace' }
|
||||
|
||||
use { 'bronson/vim-trailing-whitespace' }
|
||||
|
||||
-- ui stuff
|
||||
use {
|
||||
'akinsho/bufferline.nvim',
|
||||
tag = "v3.*",
|
||||
requires = 'nvim-tree/nvim-web-devicons',
|
||||
config = function()
|
||||
require("bufferline").setup {}
|
||||
end,
|
||||
}
|
||||
end)
|
||||
|
||||
-- local lsp = require('lsp-zero')
|
||||
-- lsp.preset('recommended')
|
||||
-- lsp.setup()
|
||||
|
||||
-- require('nvim-treesitter.configs').setup {
|
||||
-- ensure_installed = { "rust", "nix" },
|
||||
-- highlight={enable=true},
|
||||
-- }
|
||||
|
||||
-- local rt = require("rust-tools")
|
||||
|
||||
-- rt.setup({
|
||||
-- server = {
|
||||
-- on_attach = function(_, bufnr)
|
||||
-- -- Hover actions
|
||||
-- vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- -- Code action groups
|
||||
-- vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
-- end,
|
||||
-- },
|
||||
-- })
|
||||
|
Loading…
Reference in New Issue
Block a user