2021-09-03 14:03:25 +00:00
|
|
|
-- IMPORTANT NOTE : This is default config, so dont change anything here.
|
|
|
|
-- use custom/chadrc.lua instead
|
2021-08-18 05:40:13 +00:00
|
|
|
|
2021-08-17 18:32:48 +00:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
M.options = {
|
2021-11-14 07:13:36 +00:00
|
|
|
-- custom = {}
|
|
|
|
-- general nvim/vim options , check :h optionname to know more about an option
|
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
clipboard = "unnamedplus",
|
|
|
|
cmdheight = 1,
|
2021-09-19 08:11:28 +00:00
|
|
|
ruler = false,
|
2021-08-17 18:32:48 +00:00
|
|
|
hidden = true,
|
|
|
|
ignorecase = true,
|
2021-10-21 21:36:23 +00:00
|
|
|
smartcase = true,
|
2021-08-22 07:49:15 +00:00
|
|
|
mapleader = " ",
|
2021-08-17 18:32:48 +00:00
|
|
|
mouse = "a",
|
|
|
|
number = true,
|
|
|
|
numberwidth = 2,
|
2021-09-19 08:11:28 +00:00
|
|
|
relativenumber = false,
|
|
|
|
expandtab = true,
|
2021-08-17 18:32:48 +00:00
|
|
|
shiftwidth = 2,
|
|
|
|
smartindent = true,
|
2021-11-14 07:13:36 +00:00
|
|
|
tabstop = 8,
|
2021-08-22 07:49:15 +00:00
|
|
|
timeoutlen = 400,
|
|
|
|
updatetime = 250,
|
2021-11-14 07:13:36 +00:00
|
|
|
undofile = true,
|
2021-12-08 07:00:16 +00:00
|
|
|
fillchars = { eob = " " },
|
2022-01-31 04:33:15 +00:00
|
|
|
shadafile = vim.opt.shadafile,
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-09-19 08:11:28 +00:00
|
|
|
-- 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,
|
2022-02-20 02:21:55 +00:00
|
|
|
terminal_numbers = false,
|
2021-11-14 07:13:36 +00:00
|
|
|
|
|
|
|
-- updater
|
2021-09-19 08:11:28 +00:00
|
|
|
update_url = "https://github.com/NvChad/NvChad",
|
|
|
|
update_branch = "main",
|
|
|
|
},
|
2022-03-20 21:22:36 +00:00
|
|
|
terminal = {
|
|
|
|
behavior = {
|
|
|
|
close_on_exit = true,
|
|
|
|
},
|
|
|
|
window = {
|
|
|
|
vsplit_ratio = 0.5,
|
2022-04-01 07:36:14 +00:00
|
|
|
split_ratio = 0.4,
|
2022-03-20 21:22:36 +00:00
|
|
|
},
|
2022-04-02 07:51:33 +00:00
|
|
|
location = {
|
|
|
|
horizontal = "rightbelow",
|
|
|
|
vertical = "rightbelow",
|
2022-04-09 05:32:27 +00:00
|
|
|
float = {
|
|
|
|
relative = 'editor',
|
|
|
|
row = 0.3,
|
|
|
|
col = 0.25,
|
|
|
|
width = 0.5,
|
|
|
|
height = 0.4,
|
|
|
|
border = "single",
|
|
|
|
}
|
2022-04-02 07:51:33 +00:00
|
|
|
},
|
2022-03-20 21:22:36 +00:00
|
|
|
},
|
2021-08-22 06:28:15 +00:00
|
|
|
}
|
2021-08-22 07:49:15 +00:00
|
|
|
|
2021-11-14 07:13:36 +00:00
|
|
|
---- UI -----
|
|
|
|
|
2021-09-19 08:11:28 +00:00
|
|
|
M.ui = {
|
2021-11-14 07:13:36 +00:00
|
|
|
hl_override = "", -- path of your file that contains highlights
|
2022-03-25 17:25:06 +00:00
|
|
|
colors = "", -- path of your file that contains colors
|
2021-09-19 08:11:28 +00:00
|
|
|
italic_comments = false,
|
2021-11-14 07:13:36 +00:00
|
|
|
theme = "onedark", -- default theme
|
|
|
|
|
|
|
|
-- Change terminal bg to nvim theme's bg color so it'll match well
|
2021-09-19 08:11:28 +00:00
|
|
|
-- For Ex : if you have onedark set in nvchad, set onedark's bg color on your terminal
|
|
|
|
transparency = false,
|
2021-08-17 18:32:48 +00:00
|
|
|
}
|
2021-09-24 16:25:44 +00:00
|
|
|
|
2021-11-14 07:13:36 +00:00
|
|
|
---- PLUGIN OPTIONS ----
|
|
|
|
|
2021-09-19 08:11:28 +00:00
|
|
|
M.plugins = {
|
2022-03-31 07:22:23 +00:00
|
|
|
|
|
|
|
-- builtin nvim plugins are disabled
|
|
|
|
builtins = {
|
|
|
|
"2html_plugin",
|
|
|
|
"getscript",
|
|
|
|
"getscriptPlugin",
|
|
|
|
"gzip",
|
|
|
|
"logipat",
|
|
|
|
"netrw",
|
|
|
|
"netrwPlugin",
|
|
|
|
"netrwSettings",
|
|
|
|
"netrwFileHandlers",
|
|
|
|
"matchit",
|
|
|
|
"tar",
|
|
|
|
"tarPlugin",
|
|
|
|
"rrhelper",
|
|
|
|
"spellfile_plugin",
|
|
|
|
"vimball",
|
|
|
|
"vimballPlugin",
|
|
|
|
"zip",
|
|
|
|
"zipPlugin",
|
|
|
|
},
|
|
|
|
|
2021-11-14 07:13:36 +00:00
|
|
|
-- enable/disable plugins (false for disable)
|
2021-10-02 02:50:17 +00:00
|
|
|
status = {
|
2021-11-14 07:13:36 +00:00
|
|
|
blankline = true, -- indentline stuff
|
|
|
|
bufferline = true, -- manage and preview opened buffers
|
2021-09-24 16:25:44 +00:00
|
|
|
colorizer = false, -- color RGB, HEX, CSS, NAME color codes
|
|
|
|
comment = true, -- easily (un)comment code, language aware
|
2022-02-20 06:14:43 +00:00
|
|
|
alpha = false, -- dashboard
|
2021-12-16 07:32:49 +00:00
|
|
|
better_escape = true, -- map to <ESC> with no lag
|
2021-09-24 16:25:44 +00:00
|
|
|
feline = true, -- statusline
|
2021-11-14 07:13:36 +00:00
|
|
|
gitsigns = true,
|
2021-09-24 16:25:44 +00:00
|
|
|
lspsignature = true, -- lsp enhancements
|
2021-11-14 07:13:36 +00:00
|
|
|
vim_matchup = true, -- improved matchit
|
2021-09-26 01:51:07 +00:00
|
|
|
cmp = true,
|
2021-10-02 02:50:17 +00:00
|
|
|
nvimtree = true,
|
2021-10-22 00:17:35 +00:00
|
|
|
autopairs = true,
|
2021-09-24 16:25:44 +00:00
|
|
|
},
|
|
|
|
options = {
|
2022-01-09 03:37:18 +00:00
|
|
|
packer = {
|
|
|
|
init_file = "plugins.packerInit",
|
|
|
|
},
|
2021-11-05 14:34:52 +00:00
|
|
|
autopairs = { loadAfter = "nvim-cmp" },
|
2022-01-11 13:13:09 +00:00
|
|
|
cmp = {
|
|
|
|
lazy_load = true,
|
|
|
|
},
|
2021-09-24 16:25:44 +00:00
|
|
|
lspconfig = {
|
2021-09-30 04:21:00 +00:00
|
|
|
setup_lspconf = "", -- path of file containing setups of different lsps
|
2021-09-24 16:25:44 +00:00
|
|
|
},
|
|
|
|
nvimtree = {
|
2021-12-24 18:05:13 +00:00
|
|
|
-- packerCompile required after changing lazy_load
|
|
|
|
lazy_load = true,
|
2021-09-24 16:25:44 +00:00
|
|
|
},
|
2021-09-26 01:33:00 +00:00
|
|
|
luasnip = {
|
|
|
|
snippet_path = {},
|
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
statusline = {
|
2022-04-09 03:04:35 +00:00
|
|
|
hide_disable = false,
|
2021-11-14 07:13:36 +00:00
|
|
|
-- hide, show on specific filetypes
|
2021-09-24 16:25:44 +00:00
|
|
|
hidden = {
|
|
|
|
"help",
|
|
|
|
"NvimTree",
|
|
|
|
"terminal",
|
2022-02-20 06:14:43 +00:00
|
|
|
"alpha",
|
2021-09-24 16:25:44 +00:00
|
|
|
},
|
|
|
|
shown = {},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
|
|
|
-- truncate statusline on small screens
|
|
|
|
shortline = true,
|
|
|
|
style = "default", -- default, round , slant , block , arrow
|
2021-09-19 08:11:28 +00:00
|
|
|
},
|
2021-09-24 16:25:44 +00:00
|
|
|
esc_insertmode_timeout = 300,
|
|
|
|
},
|
|
|
|
default_plugin_config_replace = {},
|
2022-01-31 01:28:19 +00:00
|
|
|
default_plugin_remove = {},
|
2022-01-30 07:21:46 +00:00
|
|
|
install = nil,
|
2021-08-17 18:32:48 +00:00
|
|
|
}
|
|
|
|
|
2021-11-14 07:13:36 +00:00
|
|
|
-- Don't use a single keymap twice
|
|
|
|
|
|
|
|
--- MAPPINGS ----
|
|
|
|
|
|
|
|
-- non plugin
|
2021-08-17 18:32:48 +00:00
|
|
|
M.mappings = {
|
2021-11-14 07:13:36 +00:00
|
|
|
-- custom = {}, -- custom user mappings
|
|
|
|
|
|
|
|
misc = {
|
2021-12-04 15:34:04 +00:00
|
|
|
cheatsheet = "<leader>ch",
|
2021-11-14 07:13:36 +00:00
|
|
|
close_buffer = "<leader>x",
|
2022-04-01 14:06:29 +00:00
|
|
|
cp_whole_file = "<C-c>", -- copy all contents of current buffer
|
2022-03-01 07:13:34 +00:00
|
|
|
lineNR_toggle = "<leader>n", -- toggle line number
|
|
|
|
lineNR_rel_toggle = "<leader>rn",
|
2021-11-14 07:13:36 +00:00
|
|
|
update_nvchad = "<leader>uu",
|
|
|
|
new_buffer = "<S-t>",
|
|
|
|
new_tab = "<C-t>b",
|
|
|
|
save_file = "<C-s>", -- save file using :w
|
|
|
|
},
|
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- navigation in insert mode, only if enabled in options
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-08-17 18:32:48 +00:00
|
|
|
insert_nav = {
|
|
|
|
backward = "<C-h>",
|
|
|
|
end_of_line = "<C-e>",
|
2021-08-22 07:49:15 +00:00
|
|
|
forward = "<C-l>",
|
2021-08-17 18:32:48 +00:00
|
|
|
next_line = "<C-k>",
|
2021-08-22 07:49:15 +00:00
|
|
|
prev_line = "<C-j>",
|
2021-10-16 15:54:17 +00:00
|
|
|
beginning_of_line = "<C-a>",
|
2021-08-22 07:49:15 +00:00
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
|
|
|
-- better window movement
|
2021-09-04 04:34:16 +00:00
|
|
|
window_nav = {
|
|
|
|
moveLeft = "<C-h>",
|
|
|
|
moveRight = "<C-l>",
|
|
|
|
moveUp = "<C-k>",
|
|
|
|
moveDown = "<C-j>",
|
2021-09-24 16:25:44 +00:00
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- terminal related mappings
|
|
|
|
terminal = {
|
2021-11-14 07:13:36 +00:00
|
|
|
-- multiple mappings can be given for esc_termmode, esc_hide_termmode
|
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- get out of terminal mode
|
2021-11-14 07:13:36 +00:00
|
|
|
esc_termmode = { "jk" },
|
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- get out of terminal mode and hide it
|
2021-11-14 07:13:36 +00:00
|
|
|
esc_hide_termmode = { "JK" },
|
2021-09-19 08:11:28 +00:00
|
|
|
-- show & recover hidden terminal buffers in a telescope picker
|
2021-08-22 07:49:15 +00:00
|
|
|
pick_term = "<leader>W",
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2022-04-01 06:17:05 +00:00
|
|
|
-- spawn a single terminal and toggle it
|
|
|
|
-- this just works like toggleterm kinda
|
2021-08-22 07:49:15 +00:00
|
|
|
new_horizontal = "<leader>h",
|
|
|
|
new_vertical = "<leader>v",
|
2022-04-09 05:32:27 +00:00
|
|
|
new_float = "<A-i>",
|
2022-04-01 06:17:05 +00:00
|
|
|
|
|
|
|
-- spawn new terminals
|
|
|
|
spawn_horizontal = "<leader>H",
|
|
|
|
spawn_vertical = "<leader>V",
|
|
|
|
spawn_window = "<leader>w",
|
2021-08-17 18:32:48 +00:00
|
|
|
},
|
2021-08-22 06:28:15 +00:00
|
|
|
}
|
2021-08-22 07:49:15 +00:00
|
|
|
|
2021-11-14 07:13:36 +00:00
|
|
|
-- plugins related mappings
|
2022-01-22 07:21:12 +00:00
|
|
|
-- To disable a mapping, equate the variable to "" or false or nil in chadrc
|
2021-09-19 08:11:28 +00:00
|
|
|
M.mappings.plugins = {
|
2021-08-22 06:28:15 +00:00
|
|
|
bufferline = {
|
2021-11-14 07:13:36 +00:00
|
|
|
next_buffer = "<TAB>",
|
|
|
|
prev_buffer = "<S-Tab>",
|
2021-08-22 06:28:15 +00:00
|
|
|
},
|
|
|
|
comment = {
|
2021-11-14 07:13:36 +00:00
|
|
|
toggle = "<leader>/",
|
2021-08-22 06:28:15 +00:00
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-09-19 08:11:28 +00:00
|
|
|
-- map to <ESC> with no lag
|
|
|
|
better_escape = { -- <ESC> will still work
|
2021-08-22 06:28:15 +00:00
|
|
|
esc_insertmode = { "jk" }, -- multiple mappings allowed
|
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-12-18 22:39:59 +00:00
|
|
|
lspconfig = {
|
|
|
|
declaration = "gD",
|
|
|
|
definition = "gd",
|
|
|
|
hover = "K",
|
|
|
|
implementation = "gi",
|
|
|
|
signature_help = "gk",
|
|
|
|
add_workspace_folder = "<leader>wa",
|
|
|
|
remove_workspace_folder = "<leader>wr",
|
|
|
|
list_workspace_folders = "<leader>wl",
|
|
|
|
type_definition = "<leader>D",
|
2022-01-31 09:01:21 +00:00
|
|
|
rename = "<leader>ra",
|
2021-12-18 22:39:59 +00:00
|
|
|
code_action = "<leader>ca",
|
|
|
|
references = "gr",
|
2021-12-22 12:35:07 +00:00
|
|
|
float_diagnostics = "ge",
|
2021-12-18 22:39:59 +00:00
|
|
|
goto_prev = "[d",
|
|
|
|
goto_next = "]d",
|
|
|
|
set_loclist = "<leader>q",
|
|
|
|
formatting = "<leader>fm",
|
|
|
|
},
|
|
|
|
|
2021-08-22 06:28:15 +00:00
|
|
|
nvimtree = {
|
2021-08-23 11:14:52 +00:00
|
|
|
toggle = "<C-n>",
|
2021-08-29 02:37:02 +00:00
|
|
|
focus = "<leader>e",
|
2021-08-22 06:28:15 +00:00
|
|
|
},
|
2021-11-14 07:13:36 +00:00
|
|
|
|
2021-08-22 06:28:15 +00:00
|
|
|
telescope = {
|
|
|
|
buffers = "<leader>fb",
|
|
|
|
find_files = "<leader>ff",
|
2021-08-25 00:06:44 +00:00
|
|
|
find_hiddenfiles = "<leader>fa",
|
2021-08-22 06:28:15 +00:00
|
|
|
git_commits = "<leader>cm",
|
|
|
|
git_status = "<leader>gt",
|
|
|
|
help_tags = "<leader>fh",
|
|
|
|
live_grep = "<leader>fw",
|
|
|
|
oldfiles = "<leader>fo",
|
2021-09-19 08:11:28 +00:00
|
|
|
themes = "<leader>th", -- NvChad theme picker
|
2021-08-22 06:28:15 +00:00
|
|
|
},
|
2021-08-17 18:32:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return M
|