2021-09-03 10:03:25 -04:00
|
|
|
-- IMPORTANT NOTE : This is default config, so dont change anything here.
|
|
|
|
-- use custom/chadrc.lua instead
|
2021-08-18 01:40:13 -04:00
|
|
|
|
2021-08-17 14:32:48 -04:00
|
|
|
local M = {}
|
2021-09-19 04:11:28 -04:00
|
|
|
M.options, M.ui, M.mappings, M.plugin = {}, {}, {}, {}
|
2021-08-17 14:32:48 -04:00
|
|
|
|
2021-08-22 02:28:15 -04:00
|
|
|
-- non plugin normal, available without any plugins
|
2021-08-17 14:32:48 -04:00
|
|
|
M.options = {
|
2021-09-19 04:11:28 -04:00
|
|
|
-- NeoVim/Vim options
|
2021-08-22 03:49:15 -04:00
|
|
|
clipboard = "unnamedplus",
|
|
|
|
cmdheight = 1,
|
2021-09-19 04:11:28 -04:00
|
|
|
ruler = false,
|
2021-08-17 14:32:48 -04:00
|
|
|
hidden = true,
|
|
|
|
ignorecase = true,
|
2021-08-22 03:49:15 -04:00
|
|
|
mapleader = " ",
|
2021-08-17 14:32:48 -04:00
|
|
|
mouse = "a",
|
|
|
|
number = true,
|
2021-08-19 22:08:40 -04:00
|
|
|
-- relative numbers in normal mode tool at the bottom of options.lua
|
2021-08-17 14:32:48 -04:00
|
|
|
numberwidth = 2,
|
2021-09-19 04:11:28 -04:00
|
|
|
relativenumber = false,
|
|
|
|
expandtab = true,
|
2021-08-17 14:32:48 -04:00
|
|
|
shiftwidth = 2,
|
|
|
|
smartindent = true,
|
2021-08-21 23:21:52 -04:00
|
|
|
tabstop = 8, -- Number of spaces that a <Tab> in the file counts for
|
2021-08-22 03:49:15 -04:00
|
|
|
timeoutlen = 400,
|
2021-09-19 04:11:28 -04:00
|
|
|
-- interval for writing swap file to disk, also used by gitsigns
|
2021-08-22 03:49:15 -04:00
|
|
|
updatetime = 250,
|
2021-09-19 04:11:28 -04:00
|
|
|
undofile = true, -- keep a permanent undo (across restarts)
|
|
|
|
-- NvChad options
|
|
|
|
nvChad = {
|
|
|
|
copy_cut = true, -- copy cut text ( x key ), visual and normal mode
|
|
|
|
copy_del = true, -- copy deleted text ( dd key ), visual and normal mode
|
|
|
|
insert_nav = true, -- navigation in insertmode
|
|
|
|
window_nav = true,
|
|
|
|
theme_toggler = false,
|
|
|
|
-- used for updater
|
|
|
|
update_url = "https://github.com/NvChad/NvChad",
|
|
|
|
update_branch = "main",
|
|
|
|
},
|
2021-08-22 02:28:15 -04:00
|
|
|
}
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2021-09-19 04:11:28 -04:00
|
|
|
-- ui configs
|
|
|
|
M.ui = {
|
|
|
|
italic_comments = false,
|
|
|
|
-- theme to be used, check available themes with `<leader> + t + h`
|
|
|
|
theme = "onedark",
|
|
|
|
-- toggle between two themes, see theme_toggler mappings
|
|
|
|
theme_toggler = {
|
|
|
|
"onedark",
|
|
|
|
"gruvchad",
|
|
|
|
},
|
|
|
|
-- 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,
|
2021-08-17 14:32:48 -04:00
|
|
|
}
|
2021-09-19 04:11:28 -04:00
|
|
|
|
|
|
|
-- these are plugin related options
|
|
|
|
M.plugins = {
|
|
|
|
-- enable and disable plugins (false for disable)
|
|
|
|
plugin_status = {
|
|
|
|
autosave = false, -- to autosave files
|
|
|
|
blankline = true, -- show code scope with symbols
|
|
|
|
bufferline = true, -- list open buffers up the top, easy switching too
|
|
|
|
colorizer = true, -- color RGB, HEX, CSS, NAME color codes
|
|
|
|
comment = true, -- easily (un)comment code, language aware
|
|
|
|
dashboard = false, -- NeoVim 'home screen' on open
|
|
|
|
esc_insertmode = true, -- map to <ESC> with no lag
|
|
|
|
feline = true, -- statusline
|
|
|
|
gitsigns = true, -- gitsigns in statusline
|
|
|
|
lspsignature = true, -- lsp enhancements
|
|
|
|
neoformat = true, -- universal code formatter
|
|
|
|
neoscroll = true, -- smooth scroll
|
|
|
|
telescope_media = false, -- media previews within telescope finders
|
|
|
|
truezen = false, -- distraction free & minimalist UI mode
|
|
|
|
vim_fugitive = false, -- git integration & tooling
|
|
|
|
vim_matchup = true, -- % operator enhancements
|
|
|
|
},
|
|
|
|
options = {
|
|
|
|
lspconfig = {
|
|
|
|
servers = {} -- eg: "HTML"
|
|
|
|
},
|
|
|
|
statusline = { -- statusline related options
|
|
|
|
-- these are filetypes, not pattern matched
|
|
|
|
-- shown filetypes will overrule hidden filetypes
|
|
|
|
hidden = {
|
|
|
|
"help",
|
|
|
|
"dashboard",
|
|
|
|
"NvimTree",
|
|
|
|
"terminal",
|
|
|
|
},
|
|
|
|
shown = {},
|
|
|
|
-- default, round , slant , block , arrow
|
|
|
|
style = "default",
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
default_plugin_config_replace = {},
|
2021-08-17 14:32:48 -04:00
|
|
|
}
|
|
|
|
|
2021-08-22 02:28:15 -04:00
|
|
|
-- mappings -- don't use a single keymap twice --
|
|
|
|
-- non plugin mappings
|
2021-08-17 14:32:48 -04:00
|
|
|
M.mappings = {
|
2021-09-19 04:11:28 -04:00
|
|
|
-- custom = {}, -- all custom user mappings
|
2021-08-22 03:49:15 -04:00
|
|
|
-- close current focused buffer
|
|
|
|
close_buffer = "<leader>x",
|
|
|
|
copy_whole_file = "<C-a>", -- copy all contents of the current buffer
|
2021-09-19 04:11:28 -04:00
|
|
|
line_number_toggle = "<leader>n", -- show or hide line number
|
|
|
|
new_buffer = "<S-t>", -- open a new buffer
|
|
|
|
new_tab = "<C-t>b", -- open a new vim tab
|
|
|
|
save_file = "<C-s>", -- save file using :w
|
|
|
|
theme_toggler = "<leader>tt", -- for theme toggler, see in ui.theme_toggler
|
2021-08-22 03:49:15 -04:00
|
|
|
-- navigation in insert mode, only if enabled in options
|
2021-08-17 14:32:48 -04:00
|
|
|
insert_nav = {
|
|
|
|
backward = "<C-h>",
|
|
|
|
end_of_line = "<C-e>",
|
2021-08-22 03:49:15 -04:00
|
|
|
forward = "<C-l>",
|
2021-08-17 14:32:48 -04:00
|
|
|
next_line = "<C-k>",
|
2021-08-22 03:49:15 -04:00
|
|
|
prev_line = "<C-j>",
|
|
|
|
top_of_line = "<C-a>",
|
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
--better window movement
|
2021-09-04 00:34:16 -04:00
|
|
|
window_nav = {
|
|
|
|
moveLeft = "<C-h>",
|
|
|
|
moveRight = "<C-l>",
|
|
|
|
moveUp = "<C-k>",
|
|
|
|
moveDown = "<C-j>",
|
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
-- terminal related mappings
|
|
|
|
terminal = {
|
|
|
|
-- multiple mappings can be given for esc_termmode and esc_hide_termmode
|
|
|
|
-- get out of terminal mode
|
|
|
|
esc_termmode = { "jk" }, -- multiple mappings allowed
|
|
|
|
-- get out of terminal mode and hide it
|
|
|
|
esc_hide_termmode = { "JK" }, -- multiple mappings allowed
|
2021-09-19 04:11:28 -04:00
|
|
|
-- show & recover hidden terminal buffers in a telescope picker
|
2021-08-22 03:49:15 -04:00
|
|
|
pick_term = "<leader>W",
|
|
|
|
-- below three are for spawning terminals
|
|
|
|
new_horizontal = "<leader>h",
|
|
|
|
new_vertical = "<leader>v",
|
|
|
|
new_window = "<leader>w",
|
2021-08-17 14:32:48 -04:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
-- update nvchad from nvchad, chadness 101
|
|
|
|
update_nvchad = "<leader>uu",
|
2021-08-22 02:28:15 -04:00
|
|
|
}
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2021-08-22 02:28:15 -04:00
|
|
|
-- all plugins related mappings
|
2021-09-19 04:11:28 -04:00
|
|
|
M.mappings.plugins = {
|
|
|
|
-- list open buffers up the top, easy switching too
|
2021-08-22 02:28:15 -04:00
|
|
|
bufferline = {
|
|
|
|
next_buffer = "<TAB>", -- next buffer
|
|
|
|
prev_buffer = "<S-Tab>", -- previous buffer
|
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- easily (un)comment code, language aware
|
2021-08-22 02:28:15 -04:00
|
|
|
comment = {
|
2021-09-19 04:11:28 -04:00
|
|
|
toggle = "<leader>/", -- toggle comment (works on multiple lines)
|
2021-08-22 02:28:15 -04:00
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- NeoVim 'home screen' on open
|
2021-08-22 02:28:15 -04:00
|
|
|
dashboard = {
|
|
|
|
bookmarks = "<leader>bm",
|
|
|
|
new_file = "<leader>fn", -- basically create a new buffer
|
|
|
|
open = "<leader>db", -- open dashboard
|
|
|
|
session_load = "<leader>l", -- load a saved session
|
2021-09-03 10:03:25 -04:00
|
|
|
session_save = "<leader>s", -- save a session
|
2021-08-22 02:28:15 -04:00
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- map to <ESC> with no lag
|
|
|
|
better_escape = { -- <ESC> will still work
|
2021-08-22 02:28:15 -04:00
|
|
|
esc_insertmode = { "jk" }, -- multiple mappings allowed
|
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- file explorer/tree
|
2021-08-22 02:28:15 -04:00
|
|
|
nvimtree = {
|
2021-08-23 07:14:52 -04:00
|
|
|
toggle = "<C-n>",
|
2021-08-28 22:37:02 -04:00
|
|
|
focus = "<leader>e",
|
2021-08-22 02:28:15 -04:00
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- universal code formatter
|
2021-08-22 02:28:15 -04:00
|
|
|
neoformat = {
|
|
|
|
format = "<leader>fm",
|
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- multitool for finding & picking things
|
2021-08-22 02:28:15 -04:00
|
|
|
telescope = {
|
|
|
|
buffers = "<leader>fb",
|
|
|
|
find_files = "<leader>ff",
|
2021-08-24 20:06:44 -04:00
|
|
|
find_hiddenfiles = "<leader>fa",
|
2021-08-22 02:28:15 -04:00
|
|
|
git_commits = "<leader>cm",
|
|
|
|
git_status = "<leader>gt",
|
|
|
|
help_tags = "<leader>fh",
|
|
|
|
live_grep = "<leader>fw",
|
|
|
|
oldfiles = "<leader>fo",
|
2021-09-19 04:11:28 -04:00
|
|
|
themes = "<leader>th", -- NvChad theme picker
|
|
|
|
-- media previews within telescope finders
|
|
|
|
telescope_media = {
|
|
|
|
media_files = "<leader>fp",
|
|
|
|
},
|
2021-08-22 02:28:15 -04:00
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- distraction free & minimalist UI mode
|
|
|
|
truezen = {
|
2021-08-22 02:28:15 -04:00
|
|
|
ataraxis_mode = "<leader>zz", -- center
|
|
|
|
focus_mode = "<leader>zf",
|
|
|
|
minimalistic_mode = "<leader>zm", -- as it is
|
|
|
|
},
|
2021-09-19 04:11:28 -04:00
|
|
|
-- git integration & tooling
|
2021-08-22 02:28:15 -04:00
|
|
|
vim_fugitive = {
|
|
|
|
diff_get_2 = "<leader>gh",
|
|
|
|
diff_get_3 = "<leader>gl",
|
|
|
|
git = "<leader>gs",
|
|
|
|
git_blame = "<leader>gb",
|
2021-08-17 14:32:48 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-08-25 01:28:56 -04:00
|
|
|
|
2021-08-17 14:32:48 -04:00
|
|
|
return M
|