Updating neovim configuration

This commit is contained in:
araison 2024-01-14 00:13:31 +01:00
parent 38f8944539
commit 8459e26e3f
15 changed files with 263 additions and 0 deletions

View file

@ -0,0 +1,5 @@
return {
'windwp/nvim-autopairs',
event = "InsertEnter",
opts = {} -- this is equalent to setup({}) function
}

View file

@ -0,0 +1,47 @@
return {
"numToStr/Comment.nvim",
opts = {
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gcc",
},
---LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = "gc",
---Block-comment keymap
block = "gb",
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},
---Enable keybindings
---NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
},
---Function to call before (un)comment
pre_hook = nil,
---Function to call after (un)comment
post_hook = nil,
},
lazy = false,
}

View file

@ -0,0 +1,44 @@
return {
{
"hrsh7th/cmp-nvim-lsp",
},
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
},
},
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- For luasnip users.
}, {
{ name = "buffer" },
}),
})
end,
},
}

View file

@ -0,0 +1,10 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", "<cmd>Git<cr>", { desc = "Git status" })
vim.keymap.set("n", "<leader>ga", "<cmd>Gwrite<cr>", { desc = "Git add" })
vim.keymap.set("n", "<leader>gc", "<cmd>Git commit<cr>", { desc = "Git commit" })
vim.keymap.set("n", "<leader>gpl", "<cmd>Git pull<cr>", { desc = "Git pull" })
vim.keymap.set("n", "<leader>gp", "<cmd>15 split|term git push<cr>", { desc = "Git push" })
end,
}

View file

@ -0,0 +1,35 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "texlab", "clangd", "pylsp" },
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.texlab.setup({
capabilities = capabilities,
})
lspconfig.clangd.setup({
capabilities = capabilities,
})
lspconfig.pylsp.setup({
capabilities = capabilities,
})
end,
},
}

View file

@ -0,0 +1,8 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup()
end
}

View file

@ -0,0 +1,14 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", '<leader>n',":Neotree toggle<CR>",{})
end
}

View file

@ -0,0 +1,14 @@
return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
},
})
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}

View file

@ -0,0 +1,9 @@
return {
'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' },
config= function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", '<C-p>',builtin.find_files,{})
vim.keymap.set("n", '<leader>fg',builtin.live_grep,{})
end
}

View file

@ -0,0 +1,14 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "python", "html", "css", "javascript", "latex" },
sync_install = false,
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View file

@ -0,0 +1,9 @@
return {
"lervag/vimtex",
config = function()
vim.g.vimtex_view_general_viewer = 'zathura'
vim.g.vimtex_view_automatic = 1
vim.keymap.set('n','<leader>ll',':VimtexCompile<CR>')
vim.keymap.set('n','<leader>lv',':VimtexView<CR>')
end
}