Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lua/custom/chadrc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local M = {}

local override = require "custom.override"

M.plugins = {

override = {
["kyazdani42/nvim-tree.lua"] = override.nvimtree,
["nvim-treesitter/nvim-treesitter"] = override.treesitter,
["lukas-reineke/indent-blankline.nvim"] = override.blankline,
},

user = require "custom.plugins",
}

M.ui = {
theme = "tokyodark",
hl_add = require "custom.highlights",
theme_toggle = { "gruvchad", "gruvbox_light" },
}

M.mappings = require "custom.mappings"

return M
34 changes: 34 additions & 0 deletions lua/custom/highlights.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
local M = {

-- Neorg

NeorgCodeBlock = { bg = "black2" },

-- unordered lists
NeorgUnorderedList1 = { fg = "grey" },
NeorgUnorderedList2 = { fg = "grey" },
NeorgUnorderedList3 = { fg = "grey" },
NeorgUnorderedList4 = { fg = "grey" },
NeorgUnorderedList5 = { fg = "grey" },
NeorgUnorderedList6 = { fg = "grey" },

-- headings
NeorgHeading1Title = { fg = "white", bold = true },
NeorgHeading1Prefix = { fg = "white", bold = true },

NeorgHeading4Title = { fg = "blue", bold = true },
NeorgHeading4Prefix = { fg = "blue", bold = true },

NeorgHeading5Title = { fg = "red", bold = true },
NeorgHeading5Prefix = { fg = "red", bold = true },

NeorgHeading6Title = { fg = "purple", bold = true },
NeorgHeading6Prefix = { fg = "purple", bold = true },

NeorgMarkUpBold = {
fg = "red",
bold = true,
},
}

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

-- autocmds
autocmd("FileType", {
pattern = "norg",
callback = function()
-- vim.opt.laststatus = 0
opt.number = false
opt.showtabline = 0
opt.cole = 1
opt.foldlevel = 10
end,
})

-- commands

-- I dont use shade.nvim/autosave.nvim all the time so made commands for them
-- So this makes easy to lazy load them at cmds

new_cmd("EnableShade", function()
require("shade").setup()
end, {})

new_cmd("EnableAutosave", function()
require("autosave").setup()
end, {})

-- load global vim setting
require "custom.settings"
48 changes: 48 additions & 0 deletions lua/custom/mappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
local M = {}

M.truzen = {
n = {
["<leader>ta"] = { "<cmd> TZAtaraxis <CR>", " truzen ataraxis" },
["<leader>tm"] = { "<cmd> TZMinimalist <CR>", " truzen minimal" },
["<leader>tf"] = { "<cmd> TZFocus <CR>", " truzen focus" },
},
}

M.treesitter = {
n = {
["<leader>cu"] = { "<cmd> TSCaptureUnderCursor <CR>", " find media" },
},
}

M.shade = {
n = {
["<leader>s"] = {
function()
require("shade").toggle()
end,

" toggle shade.nvim",
},
},
}

M.general = {
i = {
-- go to beginning and end
["<C-a>"] = { "<ESC>^i", "論 beginning of line" },
["<C-e>"] = { "<End>", "壟 end of line" },
},

n = {
["<C-u>"] = { "9k", " page up"},
["<C-d>"] = { "9j", " page down"},
},
}

M.disabled = {
i = {
["<C-b>"] = ""
},
}

return M
52 changes: 52 additions & 0 deletions lua/custom/override.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-- overriding default plugin configs!

local M = {}

M.treesitter = {
ensure_installed = {
"vim",
"html",
"css",
"javascript",
"json",
"toml",
"markdown",
"c",
"bash",
"lua",
"norg",
},
}

M.nvimtree = {
git = {
enable = true,
},

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

M.blankline = {
filetype_exclude = {
"help",
"terminal",
"alpha",
"packer",
"lspinfo",
"TelescopePrompt",
"TelescopeResults",
"nvchad_cheatsheet",
"lsp-installer",
"norg",
"",
},
}

return M
95 changes: 95 additions & 0 deletions lua/custom/plugins/alpha.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
local present, alpha = pcall(require, "alpha")

if not present then
return
end

require("base46").load_highlight "alpha"

local function button(sc, txt, keybind)
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")

local opts = {
position = "center",
text = txt,
shortcut = sc,
cursor = 5,
width = 36,
align_shortcut = "right",
hl = "AlphaButtons",
}

if keybind then
opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } }
end

return {
type = "button",
val = txt,
on_press = function()
local key = vim.api.nvim_replace_termcodes(sc_, true, false, true)
vim.api.nvim_feedkeys(key, "normal", false)
end,
opts = opts,
}
end

local options = {}

local ascii = {
[[]],
[[ __ __ ____ _ ]],
[[ \ \ / / / __ \ (_) ]],
[[ \ \ /\ / / __ _ _ __ __ _ | | | | _ __ __ ___ _ __ ]],
[[ \ \/ \/ / / _` | | '_ \ / _` | | | | | | | \ \ /\ / / / _ \ | '_ \ ]],
[[ \ /\ / | (_| | | | | | | (_| | | |__| | | | \ V V / | __/ | | | |]],
[[ \/ \/ \__,_| |_| |_| \__, | \___\_\ |_| \_/\_/ \___| |_| |_|]],
[[ __/ | ]],
[[ |___/ ]],
[[ ]],
[[ [ version : 1.0.0 ] ]],
[[]],
[[]],
}

options.header = {
type = "text",
val = ascii,
opts = {
position = "center",
hl = "AlphaHeader",
},
}

options.buttons = {
type = "group",
val = {
button("SPC o p", " Open Project", ":Telescope projects<CR>"),
button("SPC f f", " Find File ", ":Telescope find_files<CR>"),
button("SPC f o", " Recent File ", ":Telescope oldfiles<CR>"),
button("SPC f w", " Find Word ", ":Telescope live_grep<CR>"),
button("SPC b m", " Bookmarks ", ":Telescope marks<CR>"),
button("SPC t h", " Themes ", ":Telescope themes<CR>"),
button("SPC e s", " Settings", ":e $MYVIMRC | :cd %:p:h <CR>"),
},
opts = {
spacing = 1,
},
}

options = require("core.utils").load_override(options, "goolord/alpha-nvim")

-- dynamic header padding
local fn = vim.fn
local marginTopPercent = 0.3
local headerPadding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) }

alpha.setup {
layout = {
{ type = "padding", val = headerPadding },
options.header,
{ type = "padding", val = 2 },
options.buttons,
},
opts = {},
}
75 changes: 75 additions & 0 deletions lua/custom/plugins/icons.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
-- neorg icons
local M = {}

M.todo = {
pending = {
icon = "",
},
uncertain = {
icon = "?",
},
urgent = {
icon = "",
},
on_hold = {
icon = "",
},
cancelled = {
icon = "",
},
}

M.list = {
level_1 = {
icon = "",
},

level_2 = {
icon = " ",
},

level_3 = {
icon = " ",
},

level_4 = {
icon = " ",
},

level_5 = {
icon = " ",
},

level_6 = {
icon = " ",
},
}

M.heading = {
level_1 = {
icon = "",
},

level_2 = {
icon = " ",
},

level_3 = {
icon = " ",
},

level_4 = {
enabled = true,
icon = " ﰟ",
},

level_5 = {
icon = " ▶",
},

level_6 = {
icon = " ⤷",
},
}

return M
Loading