Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NvChad/NvChad
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0
Choose a base ref
...
head repository: Ziggoto/NvChad
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 5 commits
  • 15 files changed
  • 2 contributors

Commits on Apr 22, 2024

  1. Copy the full SHA
    b0da4f6 View commit details

Commits on May 18, 2024

  1. Copy the full SHA
    bffff00 View commit details

Commits on May 31, 2024

  1. Copy the full SHA
    dc6c1bc View commit details

Commits on Jun 3, 2024

  1. Copy the full SHA
    19bc1d1 View commit details

Commits on Mar 3, 2025

  1. Copy the full SHA
    505d005 View commit details
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
plugin
custom
spell
ftplugin
syntax
63 changes: 63 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -19,3 +19,66 @@ end
dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
require "plugins"

-- make my migration smoother
-- guidance: https://vonheikemen.github.io/devlog/tools/configuring-neovim-using-lua/
vim.keymap.set('n', ',z', ':bp<CR>')
vim.keymap.set('n', ',x', ':bn<CR>')
vim.keymap.set('n', ',h', ':<C-u>split<CR>')
vim.keymap.set('n', ',v', ':<C-u>vsplit<CR>')
vim.keymap.set('n', ',c', ':bd<CR>')

vim.keymap.set('n', ',ga', ':Gwrite<CR>')
vim.keymap.set('n', ',gb', ':Git blame<CR>')
vim.keymap.set('n', ',gd', ':Gvdiffsplit<CR>')

vim.keymap.set('n', ']q', ':cnext<CR>')
vim.keymap.set('n', '[q', ':cprev<CR>')
vim.keymap.set('n', ']l', ':lnext<CR>')
vim.keymap.set('n', '[l', ':lprev<CR>')

vim.opt.relativenumber = true
vim.opt.foldmethod = 'indent'
vim.opt.foldlevel = 20
vim.opt.clipboard = ""

vim.cmd('cnoreabbrev W! w!')
vim.cmd('cnoreabbrev Q! q!')
vim.cmd('cnoreabbrev Qall! qall!')
vim.cmd('cnoreabbrev Wq wq')
vim.cmd('cnoreabbrev Wa wa')
vim.cmd('cnoreabbrev wQ wq')
vim.cmd('cnoreabbrev WQ wq')
vim.cmd('cnoreabbrev W w')
vim.cmd('cnoreabbrev Q q')
vim.cmd('cnoreabbrev Qall qall')

vim.keymap.set('n', '<leader>tsa', ':TSToolsAddMissingImports<CR>', { desc = 'Add all missing TS imports' })
vim.keymap.set('n', '<leader>tso', ':TSToolsOrganizeImports<CR>', { desc = 'Sort and remove unused TS imports' })
vim.keymap.set('n', '<leader>tsf', ':TSToolsFixAll<CR>', { desc = 'Fix all TS related issues possible'})
vim.keymap.set('n', '<leader>tsr', ':TSToolsRemoveUnusedImports<CR>', { desc = 'Remove unused TS imports'})
vim.keymap.set('n', '<leader>tss', ':TSToolsSortImports<CR>', { desc = 'Sort TS imports'})
vim.keymap.set('n', '<leader>tsu', ':TSToolsRemoveUnused<CR>', { desc = 'Remove unused TS code'})

local function hide_diagnostics()
vim.diagnostic.config({ -- https://neovim.io/doc/user/diagnostic.html
virtual_text = false,
signs = false,
underline = false,
})
end

local function show_diagnostics()
vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
})
end

vim.keymap.set("n", ",dh", hide_diagnostics, { desc = 'Hide diagnostics' })
vim.keymap.set("n", ",ds", show_diagnostics, { desc = 'Show diagnostics' })

vim.keymap.set("n", "[c", function()
require("treesitter-context").go_to_context(vim.v.count1)
end, { silent = true, desc = 'Go to context' })
14 changes: 9 additions & 5 deletions lua/core/mappings.lua
Original file line number Diff line number Diff line change
@@ -288,7 +288,11 @@ M.telescope = {
-- theme switcher
["<leader>th"] = { "<cmd> Telescope themes <CR>", "Nvchad themes" },

["<leader>ma"] = { "<cmd> Telescope marks <CR>", "telescope bookmarks" },
["<leader>ma"] = { "<cmd> Telescope marks <CR>", "Telescope bookmarks" },

-- my owns
["<leader>le"] = { "<cmd> Telescope diagnostics <CR>", "Show diagnostics" },
["<leader>fr"] = { "<cmd> lua require('telescope').extensions.live_grep_args.live_grep_args() <CR>", "Live grep with args" }
},
}

@@ -406,10 +410,10 @@ M.gitsigns = {

n = {
-- Navigation through hunks
["]c"] = {
["]h"] = {
function()
if vim.wo.diff then
return "]c"
return "]h"
end
vim.schedule(function()
require("gitsigns").next_hunk()
@@ -420,10 +424,10 @@ M.gitsigns = {
opts = { expr = true },
},

["[c"] = {
["[h"] = {
function()
if vim.wo.diff then
return "[c"
return "[h"
end
vim.schedule(function()
require("gitsigns").prev_hunk()
3 changes: 3 additions & 0 deletions lua/custom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example_config

This can be used as an example custom config for NvChad. Do check the https://github.com/NvChad/nvcommunity
20 changes: 20 additions & 0 deletions lua/custom/chadrc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---@type ChadrcConfig
local M = {}

-- Path to overriding theme and highlights files
local highlights = require "custom.highlights"

M.ui = {
theme = "onedark",
theme_toggle = { "onedark", "one_light" },

hl_override = highlights.override,
hl_add = highlights.add,
}

M.plugins = "custom.plugins"

-- check core.mappings for table structure
M.mappings = require "custom.mappings"

return M
25 changes: 25 additions & 0 deletions lua/custom/configs/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--type conform.options
local options = {
lsp_fallback = true,

formatters_by_ft = {
lua = { "stylua" },

javascript = { "prettier" },
css = { "prettier" },
html = { "prettier" },

sh = { "shfmt" },
},

-- adding same formatter for multiple filetypes can look too much work for some
-- instead of the above code you could just use a loop! the config is just a table after all!

-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}

require("conform").setup(options)
84 changes: 84 additions & 0 deletions lua/custom/configs/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities

local lspconfig = require "lspconfig"

-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "clangd", "bashls" }

for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end

--
-- lspconfig.pyright.setup { blabla}

-- lspconfig.kotlin_language_server.setup{
-- on_attach = on_attach,
-- capabilities = capabilities,
-- settings = {
-- storagePath = "/tmp"
-- }
-- }

require("typescript-tools").setup {
on_attach = on_attach,
settings = {
-- spawn additional tsserver instance to calculate diagnostics on it
separate_diagnostic_server = true,
-- "change"|"insert_leave" determine when the client asks the server about diagnostic
publish_diagnostic_on = "insert_leave",
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
-- "remove_unused_imports"|"organize_imports") -- or string "all"
-- to include all supported code actions
-- specify commands exposed as code_actions
expose_as_code_action = {},
-- string|nil - specify a custom path to `tsserver.js` file, if this is nil or file under path
-- not exists then standard path resolution strategy is applied
tsserver_path = nil,
-- specify a list of plugins to load by tsserver, e.g., for support `styled-components`
-- (see 💅 `styled-components` support section)
tsserver_plugins = {},
-- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
-- memory limit in megabytes or "auto"(basically no limit)
tsserver_max_memory = "auto",
-- described below
tsserver_format_options = {},
tsserver_file_preferences = {},
-- locale of all tsserver messages, supported locales you can find here:
-- https://github.com/microsoft/TypeScript/blob/3c221fc086be52b19801f6e8d82596d04607ede6/src/compiler/utilitiesPublic.ts#L620
tsserver_locale = "en",
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
complete_function_calls = false,
include_completions_with_insert_text = true,
-- CodeLens
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
code_lens = "off",
-- by default code lenses are displayed on all referencable values and for some of you it can
-- be too much this option reduce count of them by removing member references from lenses
disable_member_code_lens = true,
-- JSXCloseTag
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
-- that maybe have a conflict if enable this feature. )
jsx_close_tag = {
enable = false,
filetypes = { "javascriptreact", "typescriptreact" },
}
},
}


lspconfig.eslint.setup {
-- on_attach = function(client, bufnr)
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- buffer = bufnr,
-- command = "EslintFixAll",
-- })
-- end,
on_attach = on_attach,
capabilities = capabilities,
}
63 changes: 63 additions & 0 deletions lua/custom/configs/overrides.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
local M = {}

M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
}

M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",

-- web dev stuff
"css-lsp",
"html-lsp",
"deno",
"prettier",
"eslint-lsp",

-- c/cpp stuff
"clangd",
"clang-format",

-- kotlin
"kotlin-language-server",
"ktlint",
},
}

-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},

renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}

return M
19 changes: 19 additions & 0 deletions lua/custom/highlights.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors

local M = {}

---@type Base46HLGroupsList
M.override = {
Comment = {
italic = true,
},
}

---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}

return M
7 changes: 7 additions & 0 deletions lua/custom/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- local autocmd = vim.api.nvim_create_autocmd

-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })
22 changes: 22 additions & 0 deletions lua/custom/mappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---@type MappingsTable
local M = {}

M.general = {
n = {
-- format with conform
["<leader>fm"] = {
function()
require("conform").format()
end,
"formatting",
}

},
v = {
[">"] = { ">gv", "indent"},
},
}

-- more keybinds!

return M
Loading