tree-wide: Format files | Reformat chadrc | Misc (#268)

chadrc: looks cleaner this way

move close buffer to misc as it is not dependent on buffer plugin
This commit is contained in:
Aki 2021-08-17 23:21:10 +05:30 committed by GitHub
parent 29f3259c42
commit 98086892a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 148 additions and 135 deletions

View File

@ -1,15 +1,21 @@
local M = { local M = {}
ui = {
M.ui = {
theme = "onedark", theme = "onedark",
fav_themes = { "onedark", "gruvchad" }, -- for theme toggle -- for theme toggle
fav_themes = {
"onedark",
"gruvchad",
},
theme_toggler = false, theme_toggler = false,
hidden_statusline = { hidden_statusline = {
-- these are filetypes, not pattern matched -- these are filetypes, not pattern matched
"NvimTree", "NvimTree",
"toggleterm", "toggleterm",
}, },
}, }
options = {
M.options = {
permanent_undo = true, permanent_undo = true,
ruler = false, ruler = false,
hidden = true, hidden = true,
@ -27,9 +33,10 @@ local M = {
mapleader = " ", mapleader = " ",
autosave = false, autosave = false,
enable_insertNav = true, -- navigation in insertmode enable_insertNav = true, -- navigation in insertmode
}, }
-- enable and disable plugins (true for disable)
plugin_status = { -- enable and disable plugins (false for disable)
M.plugin_status = {
-- UI -- UI
nvim_bufferline = true, nvim_bufferline = true,
galaxyline = true, galaxyline = true,
@ -52,9 +59,11 @@ local M = {
neoscroll_nvim = true, neoscroll_nvim = true,
telescope_media = true, telescope_media = true,
cheatsheet = false, cheatsheet = false,
}, }
-- make sure you dont use same keys twice -- make sure you dont use same keys twice
mappings = { M.mappings = {
-- plugin specific
truezen = { truezen = {
ataraxisMode = "<leader>zz", ataraxisMode = "<leader>zz",
minimalisticmode = "<leader>zm", minimalisticmode = "<leader>zm",
@ -64,7 +73,7 @@ local M = {
comment_toggle = "<leader>/", comment_toggle = "<leader>/",
}, },
nvimtree = { nvimtree = {
treetoggle = "<C-n>", treetoggle = "<C-n>", -- file manager
}, },
neoformat = { neoformat = {
format = "<leader>fm", format = "<leader>fm",
@ -96,9 +105,8 @@ local M = {
bufferline = { bufferline = {
new_buffer = "<S-t>", new_buffer = "<S-t>",
newtab = "<C-t>b", newtab = "<C-t>b",
close = "<S-x>", cycleNext = "<TAB>", -- next buffer
cycleNext = "<TAB>", cyclePrev = "<S-Tab>", -- previous buffer
cyclePrev = "<S-Tab>",
}, },
fugitive = { fugitive = {
Git = "<leader>gs", Git = "<leader>gs",
@ -112,6 +120,7 @@ local M = {
toggle_hori = "<leader>h", toggle_hori = "<leader>h",
hide_term = "JK", hide_term = "JK",
}, },
-- navigation in insert mode
insert_nav = { insert_nav = {
forward = "<C-l>", forward = "<C-l>",
backward = "<C-h>", backward = "<C-h>",
@ -120,13 +129,14 @@ local M = {
prev_line = "<C-j>", prev_line = "<C-j>",
next_line = "<C-k>", next_line = "<C-k>",
}, },
-- non plugin
misc = { misc = {
esc_Termmode = "jk", esc_Termmode = "jk", -- get out of terminal mode
close_buffer = "<S-x>", -- close current focused buffer
copywhole_file = "<C-a>", copywhole_file = "<C-a>",
toggle_linenr = "<leader>n", toggle_linenr = "<leader>n", -- show or hide line number
theme_toggle = "<leader>x", theme_toggle = "<leader>x",
}, },
},
} }
return M return M

View File

@ -45,6 +45,10 @@ map("n", miscMap.toggle_linenr, ":set nu!<CR>", opt)
-- get out of terminal with jk -- get out of terminal with jk
map("t", miscMap.esc_Termmode, "<C-\\><C-n>", opt) map("t", miscMap.esc_Termmode, "<C-\\><C-n>", opt)
-- close current focused buffer, terminal or normal
-- todo: don't close if non-terminal buffer is saved
map("n", miscMap.close_buffer, ":bd!<CR>", opt)
M.toggleterm = function() M.toggleterm = function()
local m = user_map.toggleterm local m = user_map.toggleterm
@ -131,7 +135,6 @@ M.bufferline = function()
map("n", m.new_buffer, ":enew<CR>", opt) -- new buffer map("n", m.new_buffer, ":enew<CR>", opt) -- new buffer
map("n", m.newtab, ":tabnew<CR>", opt) -- new tab map("n", m.newtab, ":tabnew<CR>", opt) -- new tab
map("n", m.close, ":bd!<CR>", opt) -- close buffer
-- move between tabs -- move between tabs

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#343642", lightbg = "#343642",
lightbg2 = "#2f313d", lightbg2 = "#2f313d",
pmenu_bg = "#b389ef", pmenu_bg = "#b389ef",
folder_bg = "#BD93F9" folder_bg = "#BD93F9",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#3d454b", lightbg = "#3d454b",
lightbg2 = "#333b41", lightbg2 = "#333b41",
pmenu_bg = "#83c092", pmenu_bg = "#83c092",
folder_bg = "#7fbbb3" folder_bg = "#7fbbb3",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#2d3139", lightbg = "#2d3139",
lightbg2 = "#262a32", lightbg2 = "#262a32",
pmenu_bg = "#89b482", pmenu_bg = "#89b482",
folder_bg = "#6d8dad" folder_bg = "#6d8dad",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#2d3339", lightbg = "#2d3339",
lightbg2 = "#252b31", lightbg2 = "#252b31",
pmenu_bg = "#8aac8b", pmenu_bg = "#8aac8b",
folder_bg = "#6b8bab" folder_bg = "#6b8bab",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#3f4551", lightbg = "#3f4551",
lightbg2 = "#393f4b", lightbg2 = "#393f4b",
pmenu_bg = "#A3BE8C", pmenu_bg = "#A3BE8C",
folder_bg = "#7797b7" folder_bg = "#7797b7",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#d6d6d6", lightbg = "#d6d6d6",
lightbg2 = "#5e5f65", lightbg2 = "#5e5f65",
pmenu_bg = "#5e5f65", pmenu_bg = "#5e5f65",
folder_bg = "#6C6C6C" folder_bg = "#6C6C6C",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#2d3139", lightbg = "#2d3139",
lightbg2 = "#262a32", lightbg2 = "#262a32",
pmenu_bg = "#A3BE8C", pmenu_bg = "#A3BE8C",
folder_bg = "#61afef" folder_bg = "#61afef",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#252631", lightbg = "#252631",
lightbg2 = "#22232e", lightbg2 = "#22232e",
pmenu_bg = "#7aa2f7", pmenu_bg = "#7aa2f7",
folder_bg = "#7aa2f7" folder_bg = "#7aa2f7",
} }
return colors return colors

View File

@ -29,7 +29,7 @@ local colors = {
lightbg = "#373B41", lightbg = "#373B41",
lightbg2 = "#2D3035", lightbg2 = "#2D3035",
pmenu_bg = "#a4b595", pmenu_bg = "#a4b595",
folder_bg = "#6f8dab" folder_bg = "#6f8dab",
} }
return colors return colors