How to get the Vim you deserve
VIM
sudo pacman -S vim
Neovim
add an alias in .zshrc : alias vim=nvim
sudo pacman -S neovim
NVChad
In order for NVchad to install all the necessary plugins we first need to install NPM and GCC
sudo pacman -S npm gcc base-devel
https://nvchad.com/docs/quickstart/install/
git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
For uninstall remove those folders
# Linux / MacOS (unix)
rm -rf ~/.config/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim
Then install the required plugins
:mason
lua-language-server # confirm with i
# quit with q
Set relative line numbers
Deactivate completion for markdown files
Last line position
in ~/.config/nvim/lua/chadrc.lua
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig
local M = {}
-- Set relative line numbers
vim.wo.relativenumber = true
-- Deactivate autocomplete for Markdown files
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
-- Si nvim-cmp est configuré, désactivez-le en définissant une condition
local cmp = require('cmp')
cmp.setup.buffer({ enabled = false })
end,
})
-- Autocommande pour revenir à la dernière position dans le fichier
vim.api.nvim_create_autocmd("BufReadPost", {
callback = function()
local last_pos = vim.fn.line("'\"")
if last_pos > 0 and last_pos <= vim.fn.line("$") then
vim.api.nvim_win_set_cursor(0, {last_pos, 0})
end
end,
})
M.base46 = {
theme = "onedark",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
return M
TMUX integration
https://github.com/christoomey/vim-tmux-navigator
Add the plugin to the plugin list in ~/.config/nvim/lua/plugins/init.lua
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
{
"christoomey/vim-tmux-navigator",
lazy=false,
},
{
"ThePrimeagen/vim-be-good",
lazy=false,
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}
And map the keys in ~/.config/nvim/lua/mappings.lua
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
-- mapping for vim-tmux-navigator
map("n", "<C-h>", "<cmd>TmuxNavigateLeft<CR>")
map("n", "<C-l>", "<cmd>TmuxNavigateRight<CR>")
map("n", "<C-j>", "<cmd>TmuxNavigateDown<CR>")
map("n", "<C-k>", "<cmd>TmuxNavigateUp<CR>")
Custom NEOVIM
Switch between configs
https://michaeluloth.com/neovim-switch-configs/
Custom config
https://vincent.jousse.org/blog/fr/tech/configurer-neovim-comme-ide-a-partir-de-zero-tutoriel-guide/