Updating neovim configuration
This commit is contained in:
parent
38f8944539
commit
8459e26e3f
21
nvim/init.lua
Normal file
21
nvim/init.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("vim-options")
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
23
nvim/lazy-lock.json
Normal file
23
nvim/lazy-lock.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" },
|
||||||
|
"none-ls.nvim": { "branch": "main", "commit": "7e146f3a188853843bb4ca1bff24c912bb9b7177" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "e47ccfae775f0d572ef0f3a7d245f043b259dafc" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "584038666b0d8124d452a2e8ea9e38e6d6e56490" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||||
|
"vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" },
|
||||||
|
"vimtex": { "branch": "master", "commit": "8352d7380a0ea26f9f2ad09e57ccf90b4bd1c746" }
|
||||||
|
}
|
3
nvim/lua/plugins.lua
Normal file
3
nvim/lua/plugins.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
}
|
5
nvim/lua/plugins/autoclose.lua
Normal file
5
nvim/lua/plugins/autoclose.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {} -- this is equalent to setup({}) function
|
||||||
|
}
|
47
nvim/lua/plugins/comment.lua
Normal file
47
nvim/lua/plugins/comment.lua
Normal 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,
|
||||||
|
}
|
44
nvim/lua/plugins/completion.lua
Normal file
44
nvim/lua/plugins/completion.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
10
nvim/lua/plugins/fugitive.lua
Normal file
10
nvim/lua/plugins/fugitive.lua
Normal 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,
|
||||||
|
}
|
35
nvim/lua/plugins/lsp-config.lua
Normal file
35
nvim/lua/plugins/lsp-config.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
8
nvim/lua/plugins/lualine.lua
Normal file
8
nvim/lua/plugins/lualine.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function()
|
||||||
|
require('lualine').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
14
nvim/lua/plugins/neotree.lua
Normal file
14
nvim/lua/plugins/neotree.lua
Normal 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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
14
nvim/lua/plugins/none-ls.lua
Normal file
14
nvim/lua/plugins/none-ls.lua
Normal 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,
|
||||||
|
}
|
9
nvim/lua/plugins/telescope.lua
Normal file
9
nvim/lua/plugins/telescope.lua
Normal 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
|
||||||
|
}
|
14
nvim/lua/plugins/treesitter.lua
Normal file
14
nvim/lua/plugins/treesitter.lua
Normal 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,
|
||||||
|
}
|
9
nvim/lua/plugins/vimtex.lua
Normal file
9
nvim/lua/plugins/vimtex.lua
Normal 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
|
||||||
|
}
|
7
nvim/lua/vim-options.lua
Normal file
7
nvim/lua/vim-options.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
vim.cmd("set expandtab")
|
||||||
|
vim.cmd("set tabstop=2")
|
||||||
|
vim.cmd("set softtabstop=2")
|
||||||
|
vim.cmd("set shiftwidth=2")
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user