update git and nvim configs

This commit is contained in:
Al-Hassan Abdel-Raouf 2023-07-28 23:02:18 +03:00
parent 550435b5f4
commit 271fe55b81
8 changed files with 307 additions and 57 deletions

View File

@ -1,6 +1,6 @@
[user]
name = Al-Hassan Abdel-Raouf
email = alhassanaraouf@alhassanaraouf.me
email = alhassan@raoufs.me
[filter "lfs"]
@ -8,3 +8,5 @@
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[init]
defaultBranch = master

View File

@ -1,64 +1,95 @@
local use = require('packer').use
local use = require("packer").use
-- vim.opt.spell = true
require('packer').startup(function()
use 'wbthomason/packer.nvim' -- Package manager
require("packer").startup(function()
use("wbthomason/packer.nvim") -- Package manager
-- deps
use 'nvim-lua/plenary.nvim'
-- deps
use("nvim-lua/plenary.nvim")
use("folke/neodev.nvim")
-- LSP
use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim'
use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP
use 'mfussenegger/nvim-dap'
use 'mfussenegger/nvim-lint'
use 'mhartington/formatter.nvim'
-- LSP
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig") -- Configurations for Nvim LSP
use("mfussenegger/nvim-dap")
use("rcarriga/nvim-dap-ui")
use("mfussenegger/nvim-lint")
use("mhartington/formatter.nvim")
-- Treesitter
use 'nvim-treesitter/nvim-treesitter'
use 'nvim-treesitter/playground'
-- Treesitter
use("nvim-treesitter/nvim-treesitter")
use("nvim-treesitter/playground")
-- Coq Completion
use 'ms-jpq/coq_nvim'
use 'ms-jpq/coq.artifacts'
use 'ms-jpq/coq.thirdparty'
use("hrsh7th/cmp-nvim-lsp")
use("hrsh7th/cmp-buffer")
use("hrsh7th/cmp-path")
use("hrsh7th/cmp-cmdline")
use("petertriho/cmp-git")
use("andersevenrud/cmp-tmux")
use("rcarriga/cmp-dap")
use("hrsh7th/nvim-cmp")
-- Markdown Preview
use 'ellisonleao/glow.nvim'
use("L3MON4D3/LuaSnip")
use("saadparwaiz1/cmp_luasnip")
-- use("doxnit/cmp-luasnip-choice")
-- Vifm
use 'vifm/vifm.vim'
use("rafamadriz/friendly-snippets")
-- use("molleweide/LuaSnip-snippets.nvim")
-- Git
use 'TimUntersberger/neogit'
use 'f-person/git-blame.nvim'
-- Coq Completion
-- use 'ms-jpq/coq_nvim'
-- use 'ms-jpq/coq.artifacts'
-- use 'ms-jpq/coq.thirdparty'
-- Comments
use 'numToStr/Comment.nvim'
use("antoinemadec/FixCursorHold.nvim")
use("nvim-neotest/neotest")
use("olimorris/neotest-phpunit")
use 'mickael-menu/zk-nvim'
-- Markdown Preview
use("ellisonleao/glow.nvim")
-- Vifm
use("vifm/vifm.vim")
-- Git
use("TimUntersberger/neogit")
use("f-person/git-blame.nvim")
-- Comments
use("numToStr/Comment.nvim")
use("mickael-menu/zk-nvim")
end)
require("Comment").setup()
require("neodev").setup({
-- add any options here, or leave empty to use the default settings
})
require('Comment').setup()
require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
require("zk").setup()
require("neotest").setup({
adapters = {
require("neotest-phpunit"),
},
})
require "LSP"
require "DAP"
require "treesitter"
require "formatting"
require "linting"
require("CMD")
require("treesitter")
require("DAP")
require("formatting")
require("linting")
require("snippets")
require("LSP")

77
.config/nvim/lua/CMD.lua Normal file
View File

@ -0,0 +1,77 @@
require("cmp_git").setup()
local cmp = require("cmp")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
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" },
{ name = "path" },
{ name = "cmdline" },
{ name = "buffer" },
{ name = "tmux" },
{ name = "git" },
}, {
{ name = "buffer" },
}),
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = "buffer" },
}),
})
cmp.setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = {
{ name = "dap" },
},
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})
require("cmp").setup({
enabled = function()
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt"
or require("cmp_dap").is_dap_buffer()
end
})

View File

@ -1,4 +1,5 @@
local dap = require("dap")
local dapui = require("dapui")
dap.adapters.php = {
type = "executable",
@ -42,3 +43,74 @@ dap.configurations.sh = {
terminalKind = "integrated",
},
}
dap.adapters.python = {
type = "executable",
-- command = "path/to/virtualenvs/debugpy/bin/python",
command = "python",
args = { "-m", "debugpy.adapter" },
}
dap.configurations.python = {
{
-- The first three options are required by nvim-dap
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
request = "launch",
name = "Launch file",
},
}
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
vim.keymap.set("n", "<F5>", function()
require("dap").continue()
end)
vim.keymap.set("n", "<F10>", function()
require("dap").step_over()
end)
vim.keymap.set("n", "<F11>", function()
require("dap").step_into()
end)
vim.keymap.set("n", "<F12>", function()
require("dap").step_out()
end)
vim.keymap.set("n", "<Leader>b", function()
require("dap").toggle_breakpoint()
end)
vim.keymap.set("n", "<Leader>B", function()
require("dap").set_breakpoint()
end)
vim.keymap.set("n", "<Leader>lp", function()
require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
end)
vim.keymap.set("n", "<Leader>dr", function()
require("dap").repl.open()
end)
vim.keymap.set("n", "<Leader>dl", function()
require("dap").run_last()
end)
vim.keymap.set({ "n", "v" }, "<Leader>dh", function()
require("dap.ui.widgets").hover()
end)
vim.keymap.set({ "n", "v" }, "<Leader>dp", function()
require("dap.ui.widgets").preview()
end)
vim.keymap.set("n", "<Leader>df", function()
local widgets = require("dap.ui.widgets")
widgets.centered_float(widgets.frames)
end)
vim.keymap.set("n", "<Leader>ds", function()
local widgets = require("dap.ui.widgets")
widgets.centered_float(widgets.scopes)
end)

View File

@ -1,16 +1,28 @@
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("mason-lspconfig").setup({
ensure_installed = { "psalm", "terraformls", "lua_ls" },
automatic_installation = true,
capabilities = capabilities,
})
require("lspconfig")["lua_ls"].setup({
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
})
require("lspconfig")["psalm"].setup({
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
})
require("lspconfig")["terraformls"].setup({
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
})
require("lspconfig")["pyright"].setup({
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
})

View File

@ -0,0 +1 @@
require("luasnip.loaders.from_vscode").lazy_load()

View File

@ -79,26 +79,61 @@ _G.packer_plugins = {
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/Comment.nvim",
url = "https://github.com/numToStr/Comment.nvim"
},
["coq.artifacts"] = {
["FixCursorHold.nvim"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/coq.artifacts",
url = "https://github.com/ms-jpq/coq.artifacts"
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim",
url = "https://github.com/antoinemadec/FixCursorHold.nvim"
},
["coq.thirdparty"] = {
LuaSnip = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/coq.thirdparty",
url = "https://github.com/ms-jpq/coq.thirdparty"
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/LuaSnip",
url = "https://github.com/L3MON4D3/LuaSnip"
},
coq_nvim = {
["cmp-buffer"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/coq_nvim",
url = "https://github.com/ms-jpq/coq_nvim"
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-cmdline"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-git"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-git",
url = "https://github.com/petertriho/cmp-git"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-path"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["cmp-tmux"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp-tmux",
url = "https://github.com/andersevenrud/cmp-tmux"
},
cmp_luasnip = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
url = "https://github.com/saadparwaiz1/cmp_luasnip"
},
["formatter.nvim"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/formatter.nvim",
url = "https://github.com/mhartington/formatter.nvim"
},
["friendly-snippets"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/friendly-snippets",
url = "https://github.com/rafamadriz/friendly-snippets"
},
["git-blame.nvim"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/git-blame.nvim",
@ -119,11 +154,31 @@ _G.packer_plugins = {
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/mason.nvim",
url = "https://github.com/williamboman/mason.nvim"
},
["neodev.nvim"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/neodev.nvim",
url = "https://github.com/folke/neodev.nvim"
},
neogit = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/neogit",
url = "https://github.com/TimUntersberger/neogit"
},
neotest = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/neotest",
url = "https://github.com/nvim-neotest/neotest"
},
["neotest-phpunit"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/neotest-phpunit",
url = "https://github.com/olimorris/neotest-phpunit"
},
["nvim-cmp"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-dap"] = {
loaded = true,
path = "/home/alhassan/.local/share/nvim/site/pack/packer/start/nvim-dap",

View File

@ -1,7 +1,3 @@
if ! (( $+functions[zsh-defer] )); then
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer )
source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh
fi
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/git )
source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/git/git.plugin.zsh
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/tmux )
@ -38,6 +34,10 @@ fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLA
source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions )
source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions/zsh-completions.plugin.zsh
if ! (( $+functions[zsh-defer] )); then
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer )
source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh
fi
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting )
zsh-defer source /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
fpath+=( /home/alhassan/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search )