From 3ee3b0368a19859bfc480685481aadc894aa2018 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Sun, 22 Aug 2021 11:58:15 +0530 Subject: [PATCH] config: Seperate plugin and non-plugin configs --- lua/chadrc.lua | 151 +++++++++++++++++++-------------------- lua/default_config.lua | 155 +++++++++++++++++++++-------------------- 2 files changed, 155 insertions(+), 151 deletions(-) diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 0f7ad7e..2cec148 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -2,6 +2,7 @@ local M = {} +-- non plugin ui configs, available without any plugins M.ui = { italic_comments = false, @@ -20,23 +21,22 @@ M.ui = { -- Enable this only if your terminal has the colorscheme set which nvchad uses -- For Ex : if you have onedark set in nvchad , set onedark's bg color on your terminal transparency = false, +} - -- plugin related ui options - plugin = { - -- statusline related options - statusline = { - -- these are filetypes, not pattern matched - -- if a filetype is present in shown, it will always show the statusline, irrespective of filetypes in hidden - hidden = {}, - shown = { - -- "terminal" - }, - -- default, round , slant , block , arrow - style = "default", - }, +-- plugin related ui options +M.ui.plugin = { + -- statusline related options + statusline = { + -- these are filetypes, not pattern matched + -- if a filetype is present in shown, it will always show the statusline, irrespective of filetypes in hidden + hidden = {}, + shown = {}, + -- default, round , slant , block , arrow + style = "default", }, } +-- non plugin normal, available without any plugins M.options = { clipboard = "unnamedplus", cmdheight = 1, @@ -60,13 +60,13 @@ M.options = { -- used for updater update_url = "https://github.com/NvChad/NvChad", update_branch = "main", +} - -- these are plugin related options - plugin = { - autosave = false, -- autosave on changed text or insert mode leave - -- timeout to be used for using escape with a key combination, see mappings.plugin.better_escape - esc_insertmode_timeout = 300, - }, +-- these are plugin related options +M.options.plugin = { + autosave = false, -- autosave on changed text or insert mode leave + -- timeout to be used for using escape with a key combination, see mappings.plugin.better_escape + esc_insertmode_timeout = 300, } -- enable and disable plugins (false for disable) @@ -91,7 +91,8 @@ M.plugin_status = { vim_matchup = true, -- % magic, match it but improved } --- make sure you dont use same keys twice +-- mappings -- don't use a single keymap twice -- +-- non plugin mappings M.mappings = { -- close current focused buffer close_buffer = "x", @@ -131,62 +132,62 @@ M.mappings = { -- update nvchad from nvchad, chadness 101 update_nvchad = "uu", +} - -- all plugins related mappings - -- to get short info about a plugin, see the respective string in plugin_status, if not present, then info here - plugin = { - bufferline = { - next_buffer = "", -- next buffer - prev_buffer = "", -- previous buffer - }, - chadsheet = { - default_keys = "dk", - user_keys = "uk", - }, - comment = { - toggle = "/", -- trigger comment on a single/selected lines/number prefix - }, - dashboard = { - bookmarks = "bm", - new_file = "fn", -- basically create a new buffer - open = "db", -- open dashboard - session_load = "l", -- load a saved session - session_save = "s", -- save a session - }, - -- note: this is an edditional mapping to escape, escape key will still work - better_escape = { - esc_insertmode = { "jk" }, -- multiple mappings allowed - }, - nvimtree = { - toggle = "", -- file manager - }, - neoformat = { - format = "fm", - }, - telescope = { - buffers = "fb", - find_files = "ff", - git_commits = "cm", - git_status = "gt", - help_tags = "fh", - live_grep = "fw", - oldfiles = "fo", - themes = "th", - }, - telescope_media = { - media_files = "fp", - }, - truezen = { -- distraction free modes mapping, hide statusline, tabline, line numbers - ataraxis_mode = "zz", -- center - focus_mode = "zf", - minimalistic_mode = "zm", -- as it is - }, - vim_fugitive = { - diff_get_2 = "gh", - diff_get_3 = "gl", - git = "gs", - git_blame = "gb", - }, +-- all plugins related mappings +-- to get short info about a plugin, see the respective string in plugin_status, if not present, then info here +M.mappings.plugin = { + bufferline = { + next_buffer = "", -- next buffer + prev_buffer = "", -- previous buffer + }, + chadsheet = { + default_keys = "dk", + user_keys = "uk", + }, + comment = { + toggle = "/", -- trigger comment on a single/selected lines/number prefix + }, + dashboard = { + bookmarks = "bm", + new_file = "fn", -- basically create a new buffer + open = "db", -- open dashboard + session_load = "l", -- load a saved session + session_save = "s", -- save a session + }, + -- note: this is an edditional mapping to escape, escape key will still work + better_escape = { + esc_insertmode = { "jk" }, -- multiple mappings allowed + }, + nvimtree = { + toggle = "", -- file manager + }, + neoformat = { + format = "fm", + }, + telescope = { + buffers = "fb", + find_files = "ff", + git_commits = "cm", + git_status = "gt", + help_tags = "fh", + live_grep = "fw", + oldfiles = "fo", + themes = "th", + }, + telescope_media = { + media_files = "fp", + }, + truezen = { -- distraction free modes mapping, hide statusline, tabline, line numbers + ataraxis_mode = "zz", -- center + focus_mode = "zf", + minimalistic_mode = "zm", -- as it is + }, + vim_fugitive = { + diff_get_2 = "gh", + diff_get_3 = "gl", + git = "gs", + git_blame = "gb", }, } diff --git a/lua/default_config.lua b/lua/default_config.lua index 08df822..1f5df32 100644 --- a/lua/default_config.lua +++ b/lua/default_config.lua @@ -2,6 +2,7 @@ local M = {} +-- non plugin ui configs, available without any plugins M.ui = { italic_comments = false, @@ -20,25 +21,26 @@ M.ui = { -- Enable this only if your terminal has the colorscheme set which nvchad uses -- For Ex : if you have onedark set in nvchad , set onedark's bg color on your terminal transparency = false, +} - -- plugin related ui options - plugin = { - -- statusline related options - statusline = { - -- these are filetypes, not pattern matched - -- if a filetype is present in shown, it will always show the statusline, irrespective of filetypes in hidden - hidden = { - "NvimTree", - "terminal", - "dashboard", - }, - shown = {}, - -- default, round , slant , block , arrow - style = "default", +-- plugin related ui options +M.ui.plugin = { + -- statusline related options + statusline = { + -- these are filetypes, not pattern matched + -- if a filetype is present in shown, it will always show the statusline, irrespective of filetypes in hidden + hidden = { + "NvimTree", + "terminal", + "dashboard", }, + shown = {}, + -- default, round , slant , block , arrow + style = "default", }, } +-- non plugin normal, available without any plugins M.options = { clipboard = "unnamedplus", cmdheight = 1, @@ -62,13 +64,13 @@ M.options = { -- used for updater update_url = "https://github.com/NvChad/NvChad", update_branch = "main", +} - -- these are plugin related options - plugin = { - autosave = false, -- autosave on changed text or insert mode leave - -- timeout to be used for using escape with a key combination, see mappings.plugin.better_escape - esc_insertmode_timeout = 300, - }, +-- these are plugin related options +M.options.plugin = { + autosave = false, -- autosave on changed text or insert mode leave + -- timeout to be used for using escape with a key combination, see mappings.plugin.better_escape + esc_insertmode_timeout = 300, } -- enable and disable plugins (false for disable) @@ -93,7 +95,8 @@ M.plugin_status = { vim_matchup = true, -- % magic, match it but improved } --- make sure you dont use same keys twice +-- mappings -- don't use a single keymap twice -- +-- non plugin mappings M.mappings = { -- close current focused buffer close_buffer = "x", @@ -133,62 +136,62 @@ M.mappings = { -- update nvchad from nvchad, chadness 101 update_nvchad = "uu", +} - -- all plugins related mappings - -- to get short info about a plugin, see the respective string in plugin_status, if not present, then info here - plugin = { - bufferline = { - next_buffer = "", -- next buffer - prev_buffer = "", -- previous buffer - }, - chadsheet = { - default_keys = "dk", - user_keys = "uk", - }, - comment = { - toggle = "/", -- trigger comment on a single/selected lines/number prefix - }, - dashboard = { - bookmarks = "bm", - new_file = "fn", -- basically create a new buffer - open = "db", -- open dashboard - session_load = "l", -- load a saved session - session_save = "s", -- save a session - }, - -- note: this is an edditional mapping to escape, escape key will still work - better_escape = { - esc_insertmode = { "jk" }, -- multiple mappings allowed - }, - nvimtree = { - toggle = "", -- file manager - }, - neoformat = { - format = "fm", - }, - telescope = { - buffers = "fb", - find_files = "ff", - git_commits = "cm", - git_status = "gt", - help_tags = "fh", - live_grep = "fw", - oldfiles = "fo", - themes = "th", - }, - telescope_media = { - media_files = "fp", - }, - truezen = { -- distraction free modes mapping, hide statusline, tabline, line numbers - ataraxis_mode = "zz", -- center - focus_mode = "zf", - minimalistic_mode = "zm", -- as it is - }, - vim_fugitive = { - diff_get_2 = "gh", - diff_get_3 = "gl", - git = "gs", - git_blame = "gb", - }, +-- all plugins related mappings +-- to get short info about a plugin, see the respective string in plugin_status, if not present, then info here +M.mappings.plugin = { + bufferline = { + next_buffer = "", -- next buffer + prev_buffer = "", -- previous buffer + }, + chadsheet = { + default_keys = "dk", + user_keys = "uk", + }, + comment = { + toggle = "/", -- trigger comment on a single/selected lines/number prefix + }, + dashboard = { + bookmarks = "bm", + new_file = "fn", -- basically create a new buffer + open = "db", -- open dashboard + session_load = "l", -- load a saved session + session_save = "s", -- save a session + }, + -- note: this is an edditional mapping to escape, escape key will still work + better_escape = { + esc_insertmode = { "jk" }, -- multiple mappings allowed + }, + nvimtree = { + toggle = "", -- file manager + }, + neoformat = { + format = "fm", + }, + telescope = { + buffers = "fb", + find_files = "ff", + git_commits = "cm", + git_status = "gt", + help_tags = "fh", + live_grep = "fw", + oldfiles = "fo", + themes = "th", + }, + telescope_media = { + media_files = "fp", + }, + truezen = { -- distraction free modes mapping, hide statusline, tabline, line numbers + ataraxis_mode = "zz", -- center + focus_mode = "zf", + minimalistic_mode = "zm", -- as it is + }, + vim_fugitive = { + diff_get_2 = "gh", + diff_get_3 = "gl", + git = "gs", + git_blame = "gb", }, }