feat: nvchad neovim config + more yeswiki git repo
This commit is contained in:
parent
f9ae07c2f9
commit
ce4e0d543e
25 changed files with 607 additions and 218 deletions
21
dotfiles/nvim/lua/chadrc.lua
Normal file
21
dotfiles/nvim/lua/chadrc.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
-- 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 = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "rosepine",
|
||||
}
|
||||
|
||||
M.ui = {
|
||||
tabufline = {
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
|
||||
M.nvdash = {
|
||||
load_on_startup = true,
|
||||
}
|
||||
return M
|
|
@ -1,3 +0,0 @@
|
|||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
-- Add any additional autocmds here
|
|
@ -1,46 +0,0 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
-- bootstrap lazy.nvim
|
||||
-- stylua: ignore
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||
end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
vim.env.SHELL = "/bin/sh"
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import any extras modules here
|
||||
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
||||
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = { enabled = false }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
|
@ -1,10 +0,0 @@
|
|||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
local opt = vim.opt
|
||||
opt.scrolloff = 9
|
||||
opt.wrap = true
|
||||
opt.clipboard = "unnamedplus"
|
||||
opt.list = false
|
||||
opt.relativenumber = true
|
||||
opt.cursorline = false
|
15
dotfiles/nvim/lua/configs/conform.lua
Normal file
15
dotfiles/nvim/lua/configs/conform.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
js = { "prettier" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
timeout_ms = 50,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
}
|
||||
|
||||
return options
|
47
dotfiles/nvim/lua/configs/lazy.lua
Normal file
47
dotfiles/nvim/lua/configs/lazy.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
24
dotfiles/nvim/lua/configs/lspconfig.lua
Normal file
24
dotfiles/nvim/lua/configs/lspconfig.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
-- load defaults i.e lua_lsp
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
-- EXAMPLE
|
||||
local servers = { "html", "cssls" }
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.ts_ls.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
|
@ -1,7 +1,12 @@
|
|||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
require "nvchad.mappings"
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
map({ "i", "x", "n", "s" }, "<f1>", function()
|
||||
require("harpoon"):list():select(1)
|
||||
end, { desc = "Harpoon file 1" })
|
||||
|
@ -34,6 +39,15 @@ map({ "i", "x", "n", "s" }, "<f8>", function()
|
|||
require("harpoon"):list():select(8)
|
||||
end, { desc = "Harpoon file 8" })
|
||||
|
||||
map({ "i", "x", "n", "s" }, "<leader>/", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||
map(
|
||||
{ "i", "x", "n", "s" },
|
||||
"<leader><leader>",
|
||||
"<cmd>Telescope find_files follow=true hidden=true<CR>",
|
||||
{ desc = "telescope find all files" }
|
||||
)
|
||||
map({ "i", "x", "n", "s" }, "<leader>,", "<cmd>Telescope buffers<CR>", { desc = "telescope find buffers" })
|
||||
|
||||
-- Move Lines
|
||||
map("n", "<A-down>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
||||
map("n", "<A-up>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
12
dotfiles/nvim/lua/options.lua
Normal file
12
dotfiles/nvim/lua/options.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
local o = vim.o
|
||||
o.cursorlineopt ='both' -- to enable cursorline
|
||||
o.scrolloff = 9
|
||||
o.wrap = true
|
||||
o.clipboard = "unnamedplus"
|
||||
o.list = false
|
||||
o.relativenumber = true
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
{ "akinsho/bufferline.nvim", enabled = false },
|
||||
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
|
||||
{ "echasnovski/mini.indentscope", enabled = false },
|
||||
}
|
38
dotfiles/nvim/lua/plugins/init.lua
Normal file
38
dotfiles/nvim/lua/plugins/init.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre",
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- opts = {
|
||||
-- ensure_installed = {
|
||||
-- "vim", "lua", "vimdoc",
|
||||
-- "html", "css"
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
|
@ -1,140 +0,0 @@
|
|||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
|
||||
return {
|
||||
-- theme Rosé Pine
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
require("rose-pine").setup({
|
||||
disable_background = true,
|
||||
styles = {
|
||||
italic = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
|
||||
ColorMyPencils()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Configure LazyVim to load theme
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "rose-pine",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nix",
|
||||
"php",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"rust",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"twig",
|
||||
"vim",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Neotree plugin
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
close_if_last_window = true,
|
||||
event_handlers = {
|
||||
{
|
||||
event = "file_opened",
|
||||
handler = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "current",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
intelephense = {
|
||||
environment = {
|
||||
includePaths = {
|
||||
"/home/mrflos/Developpements/yeswiki",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
cmdline = {
|
||||
view = "cmdline",
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "bottom_pane",
|
||||
layout_config = {
|
||||
prompt_position = "top",
|
||||
preview_cutoff = 5, -- Preview should always show (unless previewer = false)
|
||||
width = function(_, max_columns, _)
|
||||
return math.min(max_columns, 120)
|
||||
end,
|
||||
height = function(_, _, max_lines)
|
||||
return math.min(max_lines, 15)
|
||||
end,
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
border = true,
|
||||
borderchars = {
|
||||
prompt = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
results = { "─", "│", "─", "│", "├", "╮", "╯", "╰" },
|
||||
preview = { "─", "│", "─", "│", "╭", "┤", "╯", "╰" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue