[feature] nvim and .zshrc update

This commit is contained in:
Abdellah El Morabit 2025-11-12 14:15:31 +01:00
parent f76c0febde
commit 6bf8fcbe9b
3 changed files with 88 additions and 82 deletions

View File

@ -13,14 +13,7 @@ require("lazy").setup({
{ "nvim-telescope/telescope.nvim",lazy = false, dependencies = "nvim-lua/plenary.nvim" }, { "nvim-telescope/telescope.nvim",lazy = false, dependencies = "nvim-lua/plenary.nvim" },
{ "neovim/nvim-lspconfig" }, { "neovim/nvim-lspconfig" },
{ "williamboman/mason.nvim", config = true }, { "williamboman/mason.nvim", config = true },
{ { "mason-org/mason-lspconfig.nvim", opts = {}, dependencies = {"mason-org/mason.nvim"}},
"mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"neovim/nvim-lspconfig",
},
},
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
{ "hrsh7th/nvim-cmp", dependencies = { { "hrsh7th/nvim-cmp", dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
@ -30,7 +23,6 @@ require("lazy").setup({
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
} }
}, },
{ "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" }, config = true },
{ "akinsho/toggleterm.nvim", version = "*", config = true }, { "akinsho/toggleterm.nvim", version = "*", config = true },
{ "sindrets/diffview.nvim", dependencies = "nvim-lua/plenary.nvim" }, { "sindrets/diffview.nvim", dependencies = "nvim-lua/plenary.nvim" },
{ "airblade/vim-gitgutter" }, { "airblade/vim-gitgutter" },
@ -39,29 +31,31 @@ require("lazy").setup({
-- neovim configuration -- neovim configuration
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.o.encoding = 'utf-8' vim.o.encoding = 'utf-8'
vim.o.fileencoding = 'utf-8' vim.o.fileencoding = 'utf-8'
vim.o.tabstop = 2 vim.o.tabstop = 2
vim.o.shiftwidth = 2 vim.o.shiftwidth = 2
vim.o.expandtab = true vim.o.expandtab = true
vim.o.smartindent = true vim.o.smartindent = true
vim.o.hidden = true vim.o.hidden = false
vim.o.number = true vim.o.number = true
vim.o.relativenumber = true vim.o.relativenumber = true
vim.o.cursorline = true vim.o.cursorline = true
vim.o.clipboard = 'unnamedplus' vim.o.clipboard = 'unnamedplus'
vim.o.wildmenu = true vim.o.wildmenu = true
vim.o.laststatus = 2 vim.o.laststatus = 0
vim.o.undofile = true vim.o.cmdheight = 0
vim.o.hlsearch = true vim.o.undofile = true
vim.o.incsearch = true vim.o.hlsearch = true
vim.o.ignorecase = true vim.o.incsearch = true
vim.o.smartcase = true vim.o.ignorecase = true
vim.o.errorbells = false vim.o.smartcase = true
vim.o.visualbell = false vim.o.errorbells = false
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.opt.guicursor = "n-v-c:ver20,a:ver20" vim.opt.mouse = nil
vim.opt.mouse = nil vim.o.autoread = true
vim.o.swapfile = off
vim.o.wildmode = longest
-- Telescope Keybinds -- Telescope Keybinds
vim.keymap.set('n', '<leader><leader>', require('telescope.builtin').find_files) vim.keymap.set('n', '<leader><leader>', require('telescope.builtin').find_files)
@ -93,8 +87,6 @@ vim.api.nvim_set_keymap('n', '<leader>do', ':DiffviewOpen<CR>', { noremap = true
vim.api.nvim_set_keymap('n', '<leader>dc', ':DiffviewClose<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<leader>dc', ':DiffviewClose<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>dh', ':DiffviewFileHistory<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<leader>dh', ':DiffviewFileHistory<CR>', { noremap = true, silent = true })
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
@ -116,52 +108,17 @@ cmp.setup({
}) })
}) })
-- define server configurations
vim.lsp.config["gopls"] = {
cmd = { "gopls" },
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
gofumpt = true,
},
},
capabilities = require("cmp_nvim_lsp").default_capabilities(),
}
vim.lsp.config["clangd"] = {
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--log=verbose",
},
capabilities = require("cmp_nvim_lsp").default_capabilities(),
}
-- start servers automatically for matching filetypes
vim.api.nvim_create_autocmd("FileType", {
pattern = "go",
callback = function()
vim.lsp.start(vim.lsp.config["gopls"])
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "c", "cpp", "objc", "objcpp" },
callback = function()
vim.lsp.start(vim.lsp.config["clangd"])
end,
})
require("nvim-treesitter.configs").setup { require("nvim-treesitter.configs").setup {
ensure_installed = { "go", "gomod", "c", "lua" },
highlight = { enable = true, additional_vim_regex_highlighting = false }, highlight = { enable = true, additional_vim_regex_highlighting = false },
} }
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup({
automatic_installation = true,
})
require('lualine').setup { require('lualine').setup {
options = { options = {
@ -189,11 +146,10 @@ require('lualine').setup {
lualine_x = {''}, lualine_x = {''},
lualine_y = { lualine_y = {
{ {
'filetype', colored = false, icon_only = false 'filetype', colored = false, icon_only = true
} }
}, },
lualine_z = {'location'} lualine_z = {'location'}
}, },
} }

View File

@ -5,18 +5,16 @@
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"go.nvim": { "branch": "master", "commit": "eb92453bc049c156290ed402f90f74090aa86363" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"guihua.lua": { "branch": "master", "commit": "6f0b6393bf94dac4c26196e10c234a3d63657741" },
"lazy.nvim": { "branch": "main", "commit": "e6a8824858757ca9cd4f5ae1a72d845fa5c46a39" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
"nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" },
"nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" }, "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "47a8530e79a484d55ba5efa3768fc0b0c023d497" }, "telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"vim-gitgutter": { "branch": "main", "commit": "488c0555e47e2aabe273c635f7dd233e985311a6" } "vim-gitgutter": { "branch": "main", "commit": "488c0555e47e2aabe273c635f7dd233e985311a6" }
} }

52
zsh/.zshrc Normal file
View File

@ -0,0 +1,52 @@
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="sorin"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export EDITOR=nvim
alias vim="nvim"
alias vi="nvim"
alias ls="lsd"
# Zoxide
eval "$(zoxide init zsh)"
alias cd='z'
alias zi='zoxide query -i'
alias zq='zoxide query'
alias attach='tmux attach-session -t'
alias list='tmux list-sessions'
fzfedit() {
local file
file=$(find . -type f ! -path '*/.*' | fzf --preview 'bat --style=full --color=always {} 2>/dev/null') || return
[[ -n "$file" ]] && nvim "$file"
}
cfg() {
local file
file=$(find ~/.config -type f | fzf --preview 'bat --style=full --color=always {} 2>/dev/null') || return
[[ -n "$file" ]] && nvim "$file"
}
# Herd configurations
export HERD_PHP_83_INI_SCAN_DIR="/Users/nasr/Library/Application Support/Herd/config/php/83/"
export HERD_PHP_82_INI_SCAN_DIR="/Users/nasr/Library/Application Support/Herd/config/php/82/"
export PATH="/Users/nasr/Library/Application Support/Herd/bin/":$PATH
export HERD_PHP_85_INI_SCAN_DIR="/Users/nasr/Library/Application Support/Herd/config/php/85/"
export HERD_PHP_84_INI_SCAN_DIR="/Users/nasr/Library/Application Support/Herd/config/php/84/"
export NVM_DIR="/Users/nasr/Library/Application Support/Herd/config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -f "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh" ]] && builtin source "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh"
# Angular autocompletion
source <(ng completion script)
# Homebrew configuration
export PATH="$HOME/.local/bin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH" # Add Homebrew pkg-config path
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/raylib/5.5/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax highlighting
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh