feat: initial neovim config (NvChad + custom markdown journaling)
This commit is contained in:
commit
2623f954f2
19 changed files with 356 additions and 0 deletions
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Temporary / swap files
|
||||
*.swp
|
||||
*~
|
||||
# Neovim caches (these live outside anyway, but just in case)
|
||||
.cache/
|
||||
# Lazy.nvim runtime (never commit the downloaded plugins)
|
||||
.lazy/
|
||||
# OS-specific
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
6
.stylua.toml
Normal file
6
.stylua.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "None"
|
||||
24
LICENSE
Normal file
24
LICENSE
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org>
|
||||
9
README.md
Normal file
9
README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
**This repo is supposed to be used as config by NvChad users!**
|
||||
|
||||
- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo.
|
||||
- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"`
|
||||
- So you can delete the .git from this repo ( when you clone it locally ) or fork it :)
|
||||
|
||||
# Credits
|
||||
|
||||
1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier!
|
||||
74
init.lua
Normal file
74
init.lua
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- bootstrap lazy and all plugins
|
||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_config = require "configs.lazy"
|
||||
|
||||
-- Clean Markdown folding with Treesitter (headings + fenced code blocks only)
|
||||
local markdown_folds = vim.api.nvim_create_augroup("MarkdownFolds", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
group = markdown_folds,
|
||||
callback = function()
|
||||
vim.wo.foldmethod = "expr"
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- This is the magic line
|
||||
vim.wo.foldlevel = 2 -- tweak if you want deeper levels open by default
|
||||
vim.wo.foldcolumn = "1"
|
||||
vim.wo.spell = true
|
||||
vim.bo.spelllang = "en_us"
|
||||
end,
|
||||
})
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup({
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
},
|
||||
-- Beautiful in-editor Markdown rendering (bold, headings, --- lines, etc.)
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("render-markdown").setup({
|
||||
-- Nice defaults for journaling
|
||||
heading = { enabled = true },
|
||||
code = { enabled = true },
|
||||
bullet = { enabled = true },
|
||||
dash = { enabled = true }, -- renders --- as nice line
|
||||
quote = { enabled = true },
|
||||
link = { enabled = true },
|
||||
sign = { enabled = false }, -- keeps it clean
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{ import = "plugins" },
|
||||
}, lazy_config)
|
||||
|
||||
-- load stuff for LaTeX
|
||||
require("luasnip.loaders.from_lua").lazy_load({paths = "~/.config/nvim/lua/custom/snippets/"})
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
dofile(vim.g.base46_cache .. "statusline")
|
||||
|
||||
require "options"
|
||||
require "autocmds"
|
||||
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
end)
|
||||
30
lazy-lock.json
Normal file
30
lazy-lock.json
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" },
|
||||
"NvChad": { "branch": "v2.5", "commit": "f437558f23c8f50c36cd09748121ab2c822e8ec9" },
|
||||
"base46": { "branch": "v3.0", "commit": "884b990dcdbe07520a0892da6ba3e8d202b46337" },
|
||||
"cmp-async-path": { "branch": "main", "commit": "f8af3f726e07f2e9d37672eaa9102581aefce149" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "0d797daee85366bc242580e352a4f62d67557b84" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
|
||||
"menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" },
|
||||
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a776085e04f7b15d0b59fae2244df07d98360ab4" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "31503ad5d869fca61461d82a9126f62480ecb0ab" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "40e9d5a6cc3db11b309e39593fc7ac03bb844e38" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "687de727de91a63b0bff9cff4e71d73f9d40fa77" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b" },
|
||||
"ui": { "branch": "v3.0", "commit": "cb75908a86720172594b30de147272c1b3a7f452" },
|
||||
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
1
lua/autocmds.lua
Normal file
1
lua/autocmds.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require "nvchad.autocmds"
|
||||
25
lua/chadrc.lua
Normal file
25
lua/chadrc.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- 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 = "onedark",
|
||||
transparency = true, -- Enable transparent background here
|
||||
-- hl_override = {
|
||||
-- Comment = { italic = true },
|
||||
-- ["@comment"] = { italic = true },
|
||||
-- },
|
||||
}
|
||||
|
||||
M.ui = {
|
||||
-- tabufline = {
|
||||
-- lazyload = false
|
||||
-- }
|
||||
}
|
||||
|
||||
-- M.nvdash = { load_on_startup = true }
|
||||
|
||||
return M
|
||||
15
lua/configs/conform.lua
Normal file
15
lua/configs/conform.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
return options
|
||||
47
lua/configs/lazy.lua
Normal file
47
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
6
lua/configs/lspconfig.lua
Normal file
6
lua/configs/lspconfig.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local servers = { "html", "cssls" }
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
-- read :h vim.lsp.config for changing options of lsp servers
|
||||
14
lua/custom/configs/lspconfig.lua
Normal file
14
lua/custom/configs/lspconfig.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.texlab.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
texlab = {
|
||||
build = { executable = "latexmk", args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" } },
|
||||
forwardSearch = { executable = "zathura", args = { "--synctex-forward", "%l:1:%f", "%p" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
7
lua/custom/init.lua
Normal file
7
lua/custom/init.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
|
||||
end,
|
||||
})
|
||||
9
lua/custom/mappings.lua
Normal file
9
lua/custom/mappings.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local M = {}
|
||||
M.vimtex = {
|
||||
n = {
|
||||
["<leader>cc"] = { "<cmd>VimtexCompile<CR>", "Compile LaTeX" },
|
||||
["<leader>cv"] = { "<cmd>VimtexView<CR>", "View PDF" },
|
||||
["<leader>cq"] = { "<cmd>VimtexStop<CR>", "Stop Compiler" },
|
||||
},
|
||||
}
|
||||
return M
|
||||
24
lua/custom/plugins.lua
Normal file
24
lua/custom/plugins.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
{
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- Disable lazy loading to enable inverse search
|
||||
ft = "tex", -- Load on .tex files
|
||||
init = function()
|
||||
vim.g.vimtex_view_method = "zathura" -- Or "okular", "sioyek", etc.
|
||||
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix for cleaner output
|
||||
vim.g.vimtex_compiler_method = "latexmk" -- Default; alternatives: "latexrun", "tectonic"
|
||||
vim.g.tex_flavor = "latex" -- Ensure LaTeX mode
|
||||
vim.g.vimtex_mappings_enabled = 1 -- Enable default mappings (e.g., \ll for compile)
|
||||
vim.g.vimtex_indent_enabled = 0 -- Optional: Disable auto-indent if conflicting
|
||||
vim.g.vimtex_context_pdf_viewer = "zathura"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- Extend default ensure_installed list
|
||||
vim.list_extend(opts.ensure_installed, { "latex" })
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
11
lua/custom/snippets/tex.lua
Normal file
11
lua/custom/snippets/tex.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
local ls = require "luasnip"
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local in_math = function() return vim.fn['vimtex#syntax#in_mathzone']() == 1 end
|
||||
|
||||
return {
|
||||
s({trig = "{{", snippetType="autosnippet"}, fmta("\\left\\{ <>\\right\\} ", { i(1) }), {condition = in_math}),
|
||||
s({trig = "((", snippetType="autosnippet"}, fmta("\\left( <>\\right) ", { i(1) }), {condition = in_math}),
|
||||
-- Add more for environments, etc.
|
||||
}
|
||||
10
lua/mappings.lua
Normal file
10
lua/mappings.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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>")
|
||||
6
lua/options.lua
Normal file
6
lua/options.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
28
lua/plugins/init.lua
Normal file
28
lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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,
|
||||
},
|
||||
|
||||
-- test new blink
|
||||
-- { import = "nvchad.blink.lazyspec" },
|
||||
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- opts = {
|
||||
-- ensure_installed = {
|
||||
-- "vim", "lua", "vimdoc",
|
||||
-- "html", "css"
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue