summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-12 21:11:43 -0400
committerchristianchiarulli <[email protected]>2021-07-12 21:11:43 -0400
commit2423fcdc904ec1413edaaac1fd8b9c0971f4a869 (patch)
tree388a51b436b364009dc83e301270657f40d8212a
parent476f7bb22f1d6d696ad9c2e2cc6e574167aef841 (diff)
refactor single file
-rw-r--r--README.md1
-rw-r--r--init.lua1
-rw-r--r--lua/core/autopairs.lua (renamed from lua/lv-autopairs/init.lua)0
-rw-r--r--lua/core/bufferline.lua (renamed from lua/lv-barbar/init.lua)0
-rw-r--r--lua/core/compe.lua (renamed from lua/lv-compe/init.lua)41
-rw-r--r--lua/core/dap.lua41
-rw-r--r--lua/core/dashboard.lua100
-rw-r--r--lua/core/floatterm.lua (renamed from lua/lv-floatterm/init.lua)14
-rw-r--r--lua/core/formatter.lua (renamed from lua/lv-formatter/init.lua)0
-rw-r--r--lua/core/galaxyline.lua353
-rw-r--r--lua/core/nvimtree.lua (renamed from lua/lv-nvimtree/init.lua)2
-rw-r--r--lua/core/telescope.lua94
-rw-r--r--lua/core/treesitter.lua187
-rw-r--r--lua/core/which-key.lua197
-rw-r--r--lua/core/zen.lua34
-rw-r--r--lua/default-config.lua33
-rw-r--r--lua/keymappings.lua4
-rw-r--r--lua/lv-compe/config.lua31
-rw-r--r--lua/lv-dap/config.lua9
-rw-r--r--lua/lv-dap/init.lua24
-rw-r--r--lua/lv-dashboard/config.lua49
-rw-r--r--lua/lv-dashboard/init.lua50
-rw-r--r--lua/lv-floatterm/config.lua10
-rw-r--r--lua/lv-galaxyline/config.lua19
-rw-r--r--lua/lv-galaxyline/init.lua326
-rw-r--r--lua/lv-gitsigns/config.lua47
-rw-r--r--lua/lv-gitsigns/init.lua11
-rw-r--r--lua/lv-telescope/config.lua80
-rw-r--r--lua/lv-telescope/init.lua6
-rw-r--r--lua/lv-treesitter/config.lua90
-rw-r--r--lua/lv-treesitter/init.lua90
-rw-r--r--lua/lv-utils/init.lua2
-rw-r--r--lua/lv-which-key/config.lua150
-rw-r--r--lua/lv-which-key/init.lua54
-rw-r--r--lua/lv-zen/config.lua21
-rw-r--r--lua/lv-zen/init.lua10
-rw-r--r--lua/plugins.lua74
37 files changed, 1087 insertions, 1168 deletions
diff --git a/README.md b/README.md
index 335d0230..44709bac 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,6 @@ O.leader_key = ' '
O.plugin.dashboard.active = true
O.plugin.floatterm.active = true
O.plugin.zen.active = true
-O.plugin.telescope_project.active = true
-- if you don't want all the parsers change this to a table of the ones you want
O.treesitter.ensure_installed = "all"
diff --git a/init.lua b/init.lua
index 0993a5b6..680555f2 100644
--- a/init.lua
+++ b/init.lua
@@ -8,7 +8,6 @@ require "plugins"
vim.g.colors_name = O.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs.
require "settings"
require "lv-utils"
-require "lv-treesitter"
-- TODO: these guys need to be in language files
-- require "lsp"
diff --git a/lua/lv-autopairs/init.lua b/lua/core/autopairs.lua
index b8dad5f3..b8dad5f3 100644
--- a/lua/lv-autopairs/init.lua
+++ b/lua/core/autopairs.lua
diff --git a/lua/lv-barbar/init.lua b/lua/core/bufferline.lua
index d4e4b4fe..d4e4b4fe 100644
--- a/lua/lv-barbar/init.lua
+++ b/lua/core/bufferline.lua
diff --git a/lua/lv-compe/init.lua b/lua/core/compe.lua
index badf32f6..ca8d6394 100644
--- a/lua/lv-compe/init.lua
+++ b/lua/core/compe.lua
@@ -1,12 +1,41 @@
---if not package.loaded['compe'] then
--- return
--- end
-
local M = {}
+M.config = function()
+ O.completion = {
+ enabled = true,
+ autocomplete = true,
+ debug = false,
+ min_length = 1,
+ preselect = "enable",
+ throttle_time = 80,
+ source_timeout = 200,
+ incomplete_delay = 400,
+ max_abbr_width = 100,
+ max_kind_width = 100,
+ max_menu_width = 100,
+ documentation = true,
-vim.g.vsnip_snippet_dir = O.vnsip_dir
+ source = {
+ path = { kind = "  (Path)" },
+ buffer = { kind = "  (Buffer)" },
+ calc = { kind = "  (Calc)" },
+ vsnip = { kind = "  (Snippet)" },
+ nvim_lsp = { kind = "  (LSP)" },
+ nvim_lua = false,
+ spell = { kind = "  (Spell)" },
+ tags = false,
+ vim_dadbod_completion = false,
+ snippets_nvim = false,
+ ultisnips = false,
+ treesitter = false,
+ emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } },
+ -- for emoji press : (idk if that in compe tho)
+ },
+ }
+end
+
+M.setup = function()
+ vim.g.vsnip_snippet_dir = O.vnsip_dir
-M.config = function()
local status_ok, compe = pcall(require, "compe")
if not status_ok then
return
diff --git a/lua/core/dap.lua b/lua/core/dap.lua
new file mode 100644
index 00000000..bc76e221
--- /dev/null
+++ b/lua/core/dap.lua
@@ -0,0 +1,41 @@
+local M = {}
+M.config = function()
+ O.plugin.dap = {
+ active = false,
+ breakpoint = {
+ text = "",
+ texthl = "LspDiagnosticsSignError",
+ linehl = "",
+ numhl = "",
+ },
+ }
+end
+
+M.setup = function()
+ local status_ok, dap = pcall(require, "dap")
+ if not status_ok then
+ return
+ end
+
+ vim.fn.sign_define("DapBreakpoint", O.plugin.dap.breakpoint)
+ dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
+
+ O.user_which_key["d"] = {
+ name = "Debug",
+ t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
+ b = { "<cmd>lua require'dap'.step_back()<cr>", "Step Back" },
+ c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
+ C = { "<cmd>lua require'dap'.run_to_cursor()<cr>", "Run To Cursor" },
+ d = { "<cmd>lua require'dap'.disconnect()<cr>", "Disconnect" },
+ g = { "<cmd>lua require'dap'.session()<cr>", "Get Session" },
+ i = { "<cmd>lua require'dap'.step_into()<cr>", "Step Into" },
+ o = { "<cmd>lua require'dap'.step_over()<cr>", "Step Over" },
+ u = { "<cmd>lua require'dap'.step_out()<cr>", "Step Out" },
+ p = { "<cmd>lua require'dap'.pause.toggle()<cr>", "Pause" },
+ r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Toggle Repl" },
+ s = { "<cmd>lua require'dap'.continue()<cr>", "Start" },
+ q = { "<cmd>lua require'dap'.stop()<cr>", "Quit" },
+ }
+end
+
+return M
diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua
new file mode 100644
index 00000000..e58b6f06
--- /dev/null
+++ b/lua/core/dashboard.lua
@@ -0,0 +1,100 @@
+local M = {}
+M.config = function()
+ O.plugin.dashboard = {
+ active = false,
+ search_handler = "telescope",
+ custom_header = {
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ " ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
+ "⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤",
+ "⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿",
+ "⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏",
+ "⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃",
+ "⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀",
+ },
+
+ custom_section = {
+ a = {
+ description = { " Find File " },
+ command = "Telescope find_files",
+ },
+ b = {
+ description = { " Recently Used Files" },
+ command = "Telescope oldfiles",
+ },
+ -- c = {
+ -- description = { " Load Last Session " },
+ -- command = "SessionLoad",
+ -- },
+ c = {
+ description = { " Find Word " },
+ command = "Telescope live_grep",
+ },
+ d = {
+ description = { " Settings " },
+ command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
+ },
+ },
+
+ footer = { "chrisatmachine.com" },
+ }
+end
+
+M.setup = function()
+ vim.g.dashboard_disable_at_vimenter = 0
+
+ vim.g.dashboard_custom_header = O.plugin.dashboard.custom_header
+
+ vim.g.dashboard_default_executive = O.plugin.dashboard.search_handler
+
+ vim.g.dashboard_custom_section = O.plugin.dashboard.custom_section
+
+ -- f = {
+ -- description = { " Neovim Config Files" },
+ -- command = "Telescope find_files cwd=" .. CONFIG_PATH,
+ -- },
+ -- e = {description = {' Marks '}, command = 'Telescope marks'}
+ vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'"
+ vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))"
+
+ vim.api.nvim_exec(
+ [[
+ let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' plugins']
+]],
+ false
+ )
+
+ -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
+
+ -- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
+ -- vim.g.dashboard_custom_footer = O.dashboard.footer
+ require("lv-utils").define_augroups {
+ _dashboard = {
+ -- seems to be nobuflisted that makes my stuff disapear will do more testing
+ {
+ "FileType",
+ "dashboard",
+ "setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ",
+ },
+ {
+ "FileType",
+ "dashboard",
+ "set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2",
+ },
+ { "FileType", "dashboard", "nnoremap <silent> <buffer> q :q<CR>" },
+ },
+ }
+end
+
+return M
diff --git a/lua/lv-floatterm/init.lua b/lua/core/floatterm.lua
index 1be0cd13..3d7e0e6e 100644
--- a/lua/lv-floatterm/init.lua
+++ b/lua/core/floatterm.lua
@@ -1,6 +1,18 @@
local M = {}
-
M.config = function()
+ O.plugin.floatterm = {
+ active = false,
+ dimensions = {
+ height = 0.9,
+ width = 0.9,
+ x = 0.5,
+ y = 0.3,
+ },
+ border = "single", -- or 'double'
+ }
+end
+
+M.setup = function()
local status_ok, fterm = pcall(require, "FTerm")
if not status_ok then
return
diff --git a/lua/lv-formatter/init.lua b/lua/core/formatter.lua
index ad40dd21..ad40dd21 100644
--- a/lua/lv-formatter/init.lua
+++ b/lua/core/formatter.lua
diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua
new file mode 100644
index 00000000..0e0ce1f4
--- /dev/null
+++ b/lua/core/galaxyline.lua
@@ -0,0 +1,353 @@
+local M = {}
+M.config = function()
+ O.plugin.galaxyline = {
+ active = true,
+ colors = {
+ alt_bg = "#2E2E2E",
+ grey = "#858585",
+ blue = "#569CD6",
+ green = "#608B4E",
+ yellow = "#DCDCAA",
+ orange = "#FF8800",
+ purple = "#C586C0",
+ magenta = "#D16D9E",
+ cyan = "#4EC9B0",
+ red = "#D16969",
+ error_red = "#F44747",
+ warning_orange = "#FF8800",
+ info_yellow = "#FFCC66",
+ hint_blue = "#9CDCFE",
+ },
+ }
+end
+
+M.setup = function()
+ -- if not package.loaded['galaxyline'] then
+ -- return
+ -- end
+ local status_ok, gl = pcall(require, "galaxyline")
+ if not status_ok then
+ return
+ end
+
+ -- NOTE: if someone defines colors but doesn't have them then this will break
+ local palette_status_ok, colors = pcall(require, O.colorscheme .. ".palette")
+ if not palette_status_ok then
+ colors = O.plugin.galaxyline.colors
+ end
+
+ local condition = require "galaxyline.condition"
+ local gls = gl.section
+ gl.short_line_list = { "NvimTree", "vista", "dbui", "packer" }
+
+ table.insert(gls.left, {
+ ViMode = {
+ provider = function()
+ -- auto change color according the vim mode
+ local mode_color = {
+ n = colors.blue,
+ i = colors.green,
+ v = colors.purple,
+ [""] = colors.purple,
+ V = colors.purple,
+ c = colors.magenta,
+ no = colors.blue,
+ s = colors.orange,
+ S = colors.orange,
+ [""] = colors.orange,
+ ic = colors.yellow,
+ R = colors.red,
+ Rv = colors.red,
+ cv = colors.blue,
+ ce = colors.blue,
+ r = colors.cyan,
+ rm = colors.cyan,
+ ["r?"] = colors.cyan,
+ ["!"] = colors.blue,
+ t = colors.blue,
+ }
+ vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim.fn.mode()])
+ return "▊"
+ end,
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { "NONE", colors.alt_bg },
+ },
+ })
+ -- print(vim.fn.getbufvar(0, 'ts'))
+ vim.fn.getbufvar(0, "ts")
+
+ table.insert(gls.left, {
+ GitIcon = {
+ provider = function()
+ return " "
+ end,
+ condition = condition.check_git_workspace,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.orange, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.left, {
+ GitBranch = {
+ provider = "GitBranch",
+ condition = condition.check_git_workspace,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.left, {
+ DiffAdd = {
+ provider = "DiffAdd",
+ condition = condition.hide_in_width,
+ icon = "  ",
+ highlight = { colors.green, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.left, {
+ DiffModified = {
+ provider = "DiffModified",
+ condition = condition.hide_in_width,
+ icon = " 柳",
+ highlight = { colors.blue, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.left, {
+ DiffRemove = {
+ provider = "DiffRemove",
+ condition = condition.hide_in_width,
+ icon = "  ",
+ highlight = { colors.red, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.left, {
+ Filler = {
+ provider = function()
+ return " "
+ end,
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+ -- get output from shell command
+ function os.capture(cmd, raw)
+ local f = assert(io.popen(cmd, "r"))
+ local s = assert(f:read "*a")
+ f:close()
+ if raw then
+ return s
+ end
+ s = string.gsub(s, "^%s+", "")
+ s = string.gsub(s, "%s+$", "")
+ s = string.gsub(s, "[\n\r]+", " ")
+ return s
+ end
+ -- cleanup virtual env
+ local function env_cleanup(venv)
+ if string.find(venv, "/") then
+ local final_venv = venv
+ for w in venv:gmatch "([^/]+)" do
+ final_venv = w
+ end
+ venv = final_venv
+ end
+ return venv
+ end
+ local PythonEnv = function()
+ if vim.bo.filetype == "python" then
+ local venv = os.getenv "CONDA_DEFAULT_ENV"
+ if venv ~= nil then
+ return "  (" .. env_cleanup(venv) .. ")"
+ end
+ venv = os.getenv "VIRTUAL_ENV"
+ if venv ~= nil then
+ return "  (" .. env_cleanup(venv) .. ")"
+ end
+ return ""
+ end
+ return ""
+ end
+ table.insert(gls.left, {
+ VirtualEnv = {
+ provider = PythonEnv,
+ event = "BufEnter",
+ highlight = { colors.green, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ DiagnosticError = {
+ provider = "DiagnosticError",
+ icon = "  ",
+ highlight = { colors.red, colors.alt_bg },
+ },
+ })
+ table.insert(gls.right, {
+ DiagnosticWarn = {
+ provider = "DiagnosticWarn",
+ icon = "  ",
+ highlight = { colors.orange, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ DiagnosticInfo = {
+ provider = "DiagnosticInfo",
+ icon = "  ",
+ highlight = { colors.yellow, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ DiagnosticHint = {
+ provider = "DiagnosticHint",
+ icon = "  ",
+ highlight = { colors.blue, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ TreesitterIcon = {
+ provider = function()
+ if next(vim.treesitter.highlighter.active) ~= nil then
+ return " "
+ end
+ return ""
+ end,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.green, colors.alt_bg },
+ },
+ })
+
+ local get_lsp_client = function(msg)
+ msg = msg or "LSP Inactive"
+ local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
+ local clients = vim.lsp.get_active_clients()
+ if next(clients) == nil then
+ return msg
+ end
+ local lsps = ""
+ for _, client in ipairs(clients) do
+ local filetypes = client.config.filetypes
+ if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
+ -- print(client.name)
+ if lsps == "" then
+ -- print("first", lsps)
+ lsps = client.name
+ else
+ if not string.find(lsps, client.name) then
+ lsps = lsps .. ", " .. client.name
+ end
+ -- print("more", lsps)
+ end
+ end
+ end
+ if lsps == "" then
+ return msg
+ else
+ return lsps
+ end
+ end
+
+ table.insert(gls.right, {
+ ShowLspClient = {
+ provider = get_lsp_client,
+ condition = function()
+ local tbl = { ["dashboard"] = true, [" "] = true }
+ if tbl[vim.bo.filetype] then
+ return false
+ end
+ return true
+ end,
+ icon = " ",
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ LineInfo = {
+ provider = "LineColumn",
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ PerCent = {
+ provider = "LinePercent",
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ Tabstop = {
+ provider = function()
+ return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " "
+ end,
+ condition = condition.hide_in_width,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ BufferType = {
+ provider = "FileTypeName",
+ condition = condition.hide_in_width,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ FileEncode = {
+ provider = "FileEncode",
+ condition = condition.hide_in_width,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.right, {
+ Space = {
+ provider = function()
+ return " "
+ end,
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.short_line_left, {
+ BufferType = {
+ provider = "FileTypeName",
+ separator = " ",
+ separator_highlight = { "NONE", colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ table.insert(gls.short_line_left, {
+ SFileName = {
+ provider = "SFileName",
+ condition = condition.buffer_not_empty,
+ highlight = { colors.grey, colors.alt_bg },
+ },
+ })
+
+ --table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.alt_bg}}})
+end
+
+return M
diff --git a/lua/lv-nvimtree/init.lua b/lua/core/nvimtree.lua
index fd07bf73..553bdb41 100644
--- a/lua/lv-nvimtree/init.lua
+++ b/lua/core/nvimtree.lua
@@ -8,7 +8,7 @@ if not status_ok then
return
end
--
-M.config = function()
+M.setup = function()
local g = vim.g
vim.o.termguicolors = true
diff --git a/lua/core/telescope.lua b/lua/core/telescope.lua
new file mode 100644
index 00000000..07487a3c
--- /dev/null
+++ b/lua/core/telescope.lua
@@ -0,0 +1,94 @@
+local M = {}
+M.config = function()
+ local status_ok, actions = pcall(require, "telescope.actions")
+ if not status_ok then
+ return
+ end
+
+ O.plugin.telescope = {
+ active = false,
+ defaults = {
+ find_command = {
+ "rg",
+ "--no-heading",
+ "--with-filename",
+ "--line-number",
+ "--column",
+ "--smart-case",
+ },
+ prompt_prefix = " ",
+ selection_caret = " ",
+ entry_prefix = " ",
+ initial_mode = "insert",
+ selection_strategy = "reset",
+ sorting_strategy = "descending",
+ layout_strategy = "horizontal",
+ layout_config = {
+ width = 0.75,
+ prompt_position = "bottom",
+ preview_cutoff = 120,
+ horizontal = { mirror = false },
+ vertical = { mirror = false },
+ },
+ file_sorter = require("telescope.sorters").get_fzy_sorter,
+ file_ignore_patterns = {},
+ generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
+ path_display = { "shorten" },
+ winblend = 0,
+ border = {},
+ borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
+ color_devicons = true,
+ use_less = true,
+ set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
+ file_previewer = require("telescope.previewers").vim_buffer_cat.new,
+ grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
+ qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
+
+ -- Developer configurations: Not meant for general override
+ -- buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
+ mappings = {
+ i = {
+ ["<C-c>"] = actions.close,
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+ ["<CR>"] = actions.select_default + actions.center,
+ -- To disable a keymap, put [map] = false
+ -- So, to not map "<C-n>", just put
+ -- ["<c-t>"] = trouble.open_with_trouble,
+ -- ["<c-x>"] = false,
+ -- ["<esc>"] = actions.close,
+ -- Otherwise, just set the mapping to the function that you want it to be.
+ -- ["<C-i>"] = actions.select_horizontal,
+ -- Add up multiple actions
+ -- You can perform as many actions in a row as you like
+ -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
+ },
+ n = {
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+ -- ["<c-t>"] = trouble.open_with_trouble,
+ -- ["<C-i>"] = my_cool_custom_action,
+ },
+ },
+ },
+ extensions = {
+ fzy_native = {
+ override_generic_sorter = false,
+ override_file_sorter = true,
+ },
+ },
+ }
+end
+
+M.setup = function()
+ local status_ok, telescope = pcall(require, "telescope")
+ if not status_ok then
+ return
+ end
+ telescope.setup(O.plugin.telescope)
+ vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", { noremap = true, silent = true })
+end
+
+return M
diff --git a/lua/core/treesitter.lua b/lua/core/treesitter.lua
new file mode 100644
index 00000000..2b7a2d54
--- /dev/null
+++ b/lua/core/treesitter.lua
@@ -0,0 +1,187 @@
+local M = {}
+M.config = function()
+ O.treesitter = {
+ ensure_installed = {}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
+ ignore_install = {},
+ matchup = {
+ enable = false, -- mandatory, false will disable the whole extension
+ -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
+ },
+ highlight = {
+ enable = true, -- false will disable the whole extension
+ additional_vim_regex_highlighting = true,
+ disable = { "latex" },
+ },
+ context_commentstring = {
+ enable = false,
+ config = { css = "// %s" },
+ },
+ -- indent = {enable = true, disable = {"python", "html", "javascript"}},
+ -- TODO seems to be broken
+ indent = { enable = { "javascriptreact" } },
+ autotag = { enable = false },
+ textobjects = {
+ swap = {
+ enable = false,
+ -- swap_next = textobj_swap_keymaps,
+ },
+ -- move = textobj_move_keymaps,
+ select = {
+ enable = false,
+ -- keymaps = textobj_sel_keymaps,
+ },
+ },
+ textsubjects = {
+ enable = false,
+ keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" },
+ },
+ playground = {
+ enable = false,
+ disable = {},
+ updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
+ persist_queries = false, -- Whether the query persists across vim sessions
+ keybindings = {
+ toggle_query_editor = "o",
+ toggle_hl_groups = "i",
+ toggle_injected_languages = "t",
+ toggle_anonymous_nodes = "a",
+ toggle_language_display = "I",
+ focus_language = "f",
+ unfocus_language = "F",
+ update = "R",
+ goto_node = "<cr>",
+ show_help = "?",
+ },
+ },
+ rainbow = {
+ enable = false,
+ extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
+ max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
+ },
+ }
+
+ -- -- TODO refactor treesitter
+ -- -- @usage pass a table with your desired languages
+ -- treesitter = {
+ -- ensure_installed = "all",
+ -- ignore_install = { "haskell" },
+ -- highlight = { enabled = true },
+ -- -- The below are for treesitter-textobjects plugin
+ -- textobj_prefixes = {
+ -- goto_next = "]", -- Go to next
+ -- goto_previous = "[", -- Go to previous
+ -- inner = "i", -- Select inside
+ -- outer = "a", -- Selct around
+ -- swap = "<leader>a", -- Swap with next
+ -- },
+ -- textobj_suffixes = {
+ -- -- Start and End respectively for the goto keys
+ -- -- for other keys it only uses the first
+ -- ["function"] = { "f", "F" },
+ -- ["class"] = { "m", "M" },
+ -- ["parameter"] = { "a", "A" },
+ -- ["block"] = { "k", "K" },
+ -- ["conditional"] = { "i", "I" },
+ -- ["call"] = { "c", "C" },
+ -- ["loop"] = { "l", "L" },
+ -- ["statement"] = { "s", "S" },
+ -- ["comment"] = { "/", "?" },
+ -- },
+ -- -- The below is for treesitter hint textobjects plugin
+ -- hint_labels = { "h", "j", "f", "d", "n", "v", "s", "l", "a" },
+ -- },
+end
+
+M.setup = function()
+ -- TODO: refacor this whole file and treesitter in general
+ -- if not package.loaded['nvim-treesitter'] then return end
+ --
+ -- Custom parsers
+ -- local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
+ -- parser_config.make = {
+ -- install_info = {
+ -- url = "https://github.com/alemuller/tree-sitter-make", -- local path or git repo
+ -- files = {"src/parser.c"},
+ -- requires_generate_from_grammar = true
+ -- }
+ -- }
+ -- parser_config.just = {
+ -- install_info = {
+ -- url = "~/dev/tree-sitter-just", -- local path or git repo
+ -- files = {"src/parser.c"}
+ -- }
+ -- -- filetype = "just", -- if filetype does not agrees with parser name
+ -- -- used_by = {"bar", "baz"} -- additional filetypes that use this parser
+ -- }
+ -- Custom text objects
+ -- local textobj_prefixes = O.treesitter.textobj_prefixes
+ -- local textobj_suffixes = O.treesitter.textobj_suffixes
+ -- local textobj_sel_keymaps = {}
+ -- local textobj_swap_keymaps = {}
+ -- local textobj_move_keymaps = {
+ -- enable = O.plugin.ts_textobjects,
+ -- set_jumps = true, -- whether to set jumps in the jumplist
+ -- goto_next_start = {},
+ -- goto_next_end = {},
+ -- goto_previous_start = {},
+ -- goto_previous_end = {},
+ -- }
+ -- for obj, suffix in pairs(textobj_suffixes) do
+ -- if textobj_prefixes["goto_next"] ~= nil then
+ -- textobj_move_keymaps["goto_next_start"][textobj_prefixes["goto_next"] .. suffix[1]] = "@" .. obj .. ".outer"
+ -- textobj_move_keymaps["goto_next_end"][textobj_prefixes["goto_next"] .. suffix[2]] = "@" .. obj .. ".outer"
+ -- end
+ -- if textobj_prefixes["goto_previous"] ~= nil then
+ -- textobj_move_keymaps["goto_previous_start"][textobj_prefixes["goto_previous"] .. suffix[2]] = "@" .. obj .. ".outer"
+ -- textobj_move_keymaps["goto_previous_end"][textobj_prefixes["goto_previous"] .. suffix[1]] = "@" .. obj .. ".outer"
+ -- end
+ --
+ -- if textobj_prefixes["inner"] ~= nil then
+ -- textobj_sel_keymaps[textobj_prefixes["inner"] .. suffix[1]] = "@" .. obj .. ".inner"
+ -- end
+ -- if textobj_prefixes["outer"] ~= nil then
+ -- textobj_sel_keymaps[textobj_prefixes["outer"] .. suffix[1]] = "@" .. obj .. ".outer"
+ -- end
+ --
+ -- if textobj_prefixes["swap"] ~= nil then
+ -- textobj_swap_keymaps[textobj_prefixes["swap"] .. suffix[1]] = "@" .. obj .. ".outer"
+ -- end
+ -- end
+ -- vim.g.ts_hint_textobject_keys = O.treesitter.hint_labels -- Requires https://github.com/mfussenegger/nvim-ts-hint-textobject/pull/2
+ --
+ -- -- Add which key menu entries
+ -- local status, wk = pcall(require, "which-key")
+ -- if status then
+ -- local normal = {
+ -- mode = "n", -- Normal mode
+ -- }
+ -- local operators = {
+ -- mode = "o", -- Operator mode
+ -- }
+ -- wk.register(textobj_sel_keymaps, operators)
+ -- wk.register({
+ -- ["m"] = "Hint Objects",
+ -- ["."] = "Textsubject",
+ -- [";"] = "Textsubject-big",
+ -- }, operators)
+ -- wk.register(textobj_swap_keymaps, normal)
+ -- wk.register({
+ -- [textobj_prefixes["swap"]] = "Swap",
+ -- -- [textobj_prefixes["goto_next"]] = "Jump [",
+ -- -- [textobj_prefixes["goto_previous"]] = "Jump ]"
+ -- }, normal)
+ -- wk.register(textobj_move_keymaps["goto_next_start"], normal)
+ -- wk.register(textobj_move_keymaps["goto_next_end"], normal)
+ -- wk.register(textobj_move_keymaps["goto_previous_start"], normal)
+ -- wk.register(textobj_move_keymaps["goto_previous_end"], normal)
+ -- end
+
+ local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs")
+ if not status_ok then
+ return
+ end
+
+ treesitter_configs.setup(O.treesitter)
+end
+
+return M
diff --git a/lua/core/which-key.lua b/lua/core/which-key.lua
new file mode 100644
index 00000000..ef875c30
--- /dev/null
+++ b/lua/core/which-key.lua
@@ -0,0 +1,197 @@
+local M = {}
+M.config = function()
+ O.plugin.which_key = {
+ active = false,
+ setup = {
+ plugins = {
+ marks = true, -- shows a list of your marks on ' and `
+ registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
+ -- the presets plugin, adds help for a bunch of default keybindings in Neovim
+ -- No actual key bindings are created
+ presets = {
+ operators = false, -- adds help for operators like d, y, ...
+ motions = false, -- adds help for motions
+ text_objects = false, -- help for text objects triggered after entering an operator
+ windows = true, -- default bindings on <c-w>
+ nav = true, -- misc bindings to work with windows
+ z = true, -- bindings for folds, spelling and others prefixed with z
+ g = true, -- bindings for prefixed with g
+ },
+ spelling = { enabled = true, suggestions = 20 }, -- use which-key for spelling hints
+ },
+ icons = {
+ breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
+ separator = "➜", -- symbol used between a key and it's label
+ group = "+", -- symbol prepended to a group
+ },
+ window = {
+ border = "single", -- none, single, double, shadow
+ position = "bottom", -- bottom, top
+ margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
+ padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
+ },
+ layout = {
+ height = { min = 4, max = 25 }, -- min and max height of the columns
+ width = { min = 20, max = 50 }, -- min and max width of the columns
+ spacing = 3, -- spacing between columns
+ },
+ hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
+ show_help = true, -- show help message on the command line when the popup is visible
+ },
+
+ opts = {
+ mode = "n", -- NORMAL mode
+ prefix = "<leader>",
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+ },
+ vopts = {
+ mode = "v", -- VISUAL mode
+ prefix = "<leader>",
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+ },
+ -- NOTE: Prefer using : over <cmd> as the latter avoids going back in normal-mode.
+ -- see https://neovim.io/doc/user/map.html#:map-cmd
+ vmappings = {
+ ["/"] = { ":CommentToggle<CR>", "Comment" },
+ },
+ mappings = {
+ ["w"] = { "<cmd>w!<CR>", "Save" },
+ ["q"] = { "<cmd>q!<CR>", "Quit" },
+ ["/"] = { "<cmd>CommentToggle<CR>", "Comment" },
+ ["c"] = { "<cmd>BufferClose<CR>", "Close Buffer" },
+ ["e"] = { "<cmd>lua require'core.nvimtree'.toggle_tree()<CR>", "Explorer" },
+ ["f"] = { "<cmd>Telescope find_files<CR>", "Find File" },
+ ["h"] = { '<cmd>let @/=""<CR>', "No Highlight" },
+ [";"] = { "<cmd>Dashboard<CR>", "Dashboard" },
+ p = {
+ name = "Packer",
+ c = { "<cmd>PackerCompile<cr>", "Compile" },
+ i = { "<cmd>PackerInstall<cr>", "Install" },
+ r = { "<cmd>lua require('lv-utils').reload_lv_config()<cr>", "Reload" },
+ s = { "<cmd>PackerSync<cr>", "Sync" },
+ u = { "<cmd>PackerUpdate<cr>", "Update" },
+ },
+
+ -- " Available Debug Adapters:
+ -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
+ -- " Adapter configuration and installation instructions:
+ -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
+ -- " Debug Adapter protocol:
+ -- " https://microsoft.github.io/debug-adapter-protocol/
+ -- " Debugging
+ g = {
+ name = "Git",
+ j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
+ k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
+ l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
+ p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
+ r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
+ R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
+ s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
+ u = {
+ "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
+ "Undo Stage Hunk",
+ },
+ o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
+ b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+ c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
+ C = {
+ "<cmd>Telescope git_bcommits<cr>",
+ "Checkout commit(for current file)",
+ },
+ },
+
+ l = {
+ name = "LSP",
+ a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
+ d = {
+ "<cmd>Telescope lsp_document_diagnostics<cr>",
+ "Document Diagnostics",
+ },
+ w = {
+ "<cmd>Telescope lsp_workspace_diagnostics<cr>",
+ "Workspace Diagnostics",
+ },
+ f = { "<cmd>silent FormatWrite<cr>", "Format" },
+ i = { "<cmd>LspInfo<cr>", "Info" },
+ j = {
+ "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>",
+ "Next Diagnostic",
+ },
+ k = {
+ "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>",
+ "Prev Diagnostic",
+ },
+ q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
+ r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
+ s = { "<cmd> Telescope lsp_document_symbols<cr>", "Document Symbols" },
+ S = {
+ "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
+ "Workspace Symbols",
+ },
+ },
+
+ s = {
+ name = "Search",
+ b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+ c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
+ f = { "<cmd>Telescope find_files<cr>", "Find File" },
+ h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
+ M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
+ r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
+ R = { "<cmd>Telescope registers<cr>", "Registers" },
+ t = { "<cmd>Telescope live_grep<cr>", "Text" },
+ k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
+ C = { "<cmd>Telescope commands<cr>", "Commands" },
+ },
+ T = {
+ name = "Treesitter",
+ i = { ":TSConfigInfo<cr>", "Info" },
+ },
+ },
+ }
+end
+
+M.setup = function()
+ -- if not package.loaded['which-key'] then
+ -- return
+ -- end
+ local status_ok, which_key = pcall(require, "which-key")
+ if not status_ok then
+ return
+ end
+
+ which_key.setup(O.plugin.which_key.setup)
+
+ local opts = O.plugin.which_key.opts
+ local vopts = O.plugin.which_key.vopts
+
+ local mappings = O.plugin.which_key.mappings
+ local vmappings = O.plugin.which_key.vmappings
+
+ -- if O.plugin.ts_playground.active then
+ -- vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true })
+ -- mappings[""] = "Highlight Capture"
+ -- end
+
+ if O.plugin.zen.active then
+ vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })
+ mappings["z"] = "Zen"
+ end
+
+ for k, v in pairs(O.user_which_key) do
+ mappings[k] = v
+ end
+
+ local wk = require "which-key"
+ wk.register(mappings, opts)
+ wk.register(vmappings, vopts)
+end
+
+return M
diff --git a/lua/core/zen.lua b/lua/core/zen.lua
new file mode 100644
index 00000000..99a5d769
--- /dev/null
+++ b/lua/core/zen.lua
@@ -0,0 +1,34 @@
+local M = {}
+M.config = function()
+ O.plugin["zen"] = {
+ window = {
+ backdrop = 1,
+ height = 0.85, -- height of the Zen window
+ options = {
+ signcolumn = "no", -- disable signcolumn
+ number = false, -- disable number column
+ relativenumber = false, -- disable relative numbers
+ -- cursorline = false, -- disable cursorline
+ -- cursorcolumn = false, -- disable cursor column
+ -- foldcolumn = "0", -- disable fold column
+ -- list = false, -- disable whitespace characters
+ },
+ },
+ plugins = {
+ gitsigns = { enabled = false }, -- disables git signs
+ -- your configuration comes here
+ -- or leave it empty to use the default settings
+ -- refer to the configuration section below
+ },
+ }
+end
+
+M.setup = function()
+ local status_ok, zen_mode = pcall(require, "zen-mode")
+ if not status_ok then
+ return
+ end
+ zen_mode.setup(O.plugin.zen)
+end
+
+return M
diff --git a/lua/default-config.lua b/lua/default-config.lua
index 333b9a65..e6f63128 100644
--- a/lua/default-config.lua
+++ b/lua/default-config.lua
@@ -55,6 +55,8 @@ O = {
scrolloff = 8, -- is one of my fav
},
+ plugin = {},
+
-- TODO: refactor for tree
auto_close_tree = 0,
nvim_tree_disable_netrw = 0,
@@ -66,17 +68,6 @@ O = {
database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
- plugin = {
- -- Builtins
- diffview = { active = false },
- ts_hintobjects = { active = false },
- ts_textobjects = { active = false },
- ts_textsubjects = { active = false },
- telescope_project = { active = false },
- indent_line = { active = false },
- lush = { active = false },
- },
-
-- TODO: just using mappings (leader mappings)
user_which_key = {},
@@ -293,15 +284,13 @@ O = {
},
}
-require "lv-zen.config"
-require "lv-compe.config"
-require "lv-dashboard.config"
-require "lv-floatterm.config"
-require "lv-galaxyline.config"
require("core.gitsigns").config()
--- print(vim.inspect(O["gitsigns"]))
-require "lv-telescope.config"
-require "lv-floatterm.config"
-require "lv-dap.config"
-require "lv-which-key.config"
-require "lv-treesitter.config"
+require("core.compe").config()
+require("core.dashboard").config()
+require("core.dap").config()
+require("core.floatterm").config()
+require("core.zen").config()
+require("core.galaxyline").config()
+require("core.telescope").config()
+require("core.treesitter").config()
+require("core.which-key").config()
diff --git a/lua/keymappings.lua b/lua/keymappings.lua
index ffe2072c..fed362aa 100644
--- a/lua/keymappings.lua
+++ b/lua/keymappings.lua
@@ -64,8 +64,8 @@ local mappings = {
{ "<", "<gv" },
{ ">", ">gv" },
- { "p", '"0p', { silent = true } },
- { "P", '"0P', { silent = true } },
+ -- { "p", '"0p', { silent = true } },
+ -- { "P", '"0P', { silent = true } },
},
x = { -- Visual mode
-- Move selected line / block of text in visual mode
diff --git a/lua/lv-compe/config.lua b/lua/lv-compe/config.lua
deleted file mode 100644
index 160a3dbb..00000000
--- a/lua/lv-compe/config.lua
+++ /dev/null
@@ -1,31 +0,0 @@
-O.completion = {
- enabled = true,
- autocomplete = true,
- debug = false,
- min_length = 1,
- preselect = "enable",
- throttle_time = 80,
- source_timeout = 200,
- incomplete_delay = 400,
- max_abbr_width = 100,
- max_kind_width = 100,
- max_menu_width = 100,
- documentation = true,
-
- source = {
- path = { kind = "  (Path)" },
- buffer = { kind = "  (Buffer)" },
- calc = { kind = "  (Calc)" },
- vsnip = { kind = "  (Snippet)" },
- nvim_lsp = { kind = "  (LSP)" },
- nvim_lua = false,
- spell = { kind = "  (Spell)" },
- tags = false,
- vim_dadbod_completion = false,
- snippets_nvim = false,
- ultisnips = false,
- treesitter = false,
- emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } },
- -- for emoji press : (idk if that in compe tho)
- },
-}
diff --git a/lua/lv-dap/config.lua b/lua/lv-dap/config.lua
deleted file mode 100644
index b626deaa..00000000
--- a/lua/lv-dap/config.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-O.plugin.dap = {
- active = false,
- breakpoint = {
- text = "",
- texthl = "LspDiagnosticsSignError",
- linehl = "",
- numhl = "",
- },
-}
diff --git a/lua/lv-dap/init.lua b/lua/lv-dap/init.lua
deleted file mode 100644
index f8ff845c..00000000
--- a/lua/lv-dap/init.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-local status_ok, dap = pcall(require, "dap")
-if not status_ok then
- return
-end
--- require "dap"
-vim.fn.sign_define("DapBreakpoint", O.plugin.dap.breakpoint)
-dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
-
-O.user_which_key["d"] = {
- name = "Debug",
- t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
- b = { "<cmd>lua require'dap'.step_back()<cr>", "Step Back" },
- c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
- C = { "<cmd>lua require'dap'.run_to_cursor()<cr>", "Run To Cursor" },
- d = { "<cmd>lua require'dap'.disconnect()<cr>", "Disconnect" },
- g = { "<cmd>lua require'dap'.session()<cr>", "Get Session" },
- i = { "<cmd>lua require'dap'.step_into()<cr>", "Step Into" },
- o = { "<cmd>lua require'dap'.step_over()<cr>", "Step Over" },
- u = { "<cmd>lua require'dap'.step_out()<cr>", "Step Out" },
- p = { "<cmd>lua require'dap'.pause.toggle()<cr>", "Pause" },
- r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Toggle Repl" },
- s = { "<cmd>lua require'dap'.continue()<cr>", "Start" },
- q = { "<cmd>lua require'dap'.stop()<cr>", "Quit" },
-}
diff --git a/lua/lv-dashboard/config.lua b/lua/lv-dashboard/config.lua
deleted file mode 100644
index a6240c0d..00000000
--- a/lua/lv-dashboard/config.lua
+++ /dev/null
@@ -1,49 +0,0 @@
-O.plugin.dashboard = {
- active = false,
- search_handler = "telescope",
- custom_header = {
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- " ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
- "⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤",
- "⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿",
- "⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏",
- "⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃",
- "⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀",
- },
-
- custom_section = {
- a = {
- description = { " Find File " },
- command = "Telescope find_files",
- },
- b = {
- description = { " Recently Used Files" },
- command = "Telescope oldfiles",
- },
- -- c = {
- -- description = { " Load Last Session " },
- -- command = "SessionLoad",
- -- },
- c = {
- description = { " Find Word " },
- command = "Telescope live_grep",
- },
- d = {
- description = { " Settings " },
- command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
- },
- },
-
- footer = { "chrisatmachine.com" },
-}
diff --git a/lua/lv-dashboard/init.lua b/lua/lv-dashboard/init.lua
deleted file mode 100644
index b9e69ac1..00000000
--- a/lua/lv-dashboard/init.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local M = {}
-
-M.config = function()
- vim.g.dashboard_disable_at_vimenter = 0
-
- vim.g.dashboard_custom_header = O.plugin.dashboard.custom_header
-
- vim.g.dashboard_default_executive = O.plugin.dashboard.search_handler
-
- vim.g.dashboard_custom_section = O.plugin.dashboard.custom_section
-
- -- f = {
- -- description = { " Neovim Config Files" },
- -- command = "Telescope find_files cwd=" .. CONFIG_PATH,
- -- },
- -- e = {description = {' Marks '}, command = 'Telescope marks'}
- vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'"
- vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))"
-
- vim.api.nvim_exec(
- [[
- let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' plugins']
-]],
- false
- )
-
- -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
-
- -- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
- -- vim.g.dashboard_custom_footer = O.dashboard.footer
-end
-
-require("lv-utils").define_augroups {
- _dashboard = {
- -- seems to be nobuflisted that makes my stuff disapear will do more testing
- {
- "FileType",
- "dashboard",
- "setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ",
- },
- {
- "FileType",
- "dashboard",
- "set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2",
- },
- { "FileType", "dashboard", "nnoremap <silent> <buffer> q :q<CR>" },
- },
-}
-
-return M
diff --git a/lua/lv-floatterm/config.lua b/lua/lv-floatterm/config.lua
deleted file mode 100644
index 8a4e2238..00000000
--- a/lua/lv-floatterm/config.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-O.plugin.floatterm = {
- active = false,
- dimensions = {
- height = 0.9,
- width = 0.9,
- x = 0.5,
- y = 0.3,
- },
- border = "single", -- or 'double'
-}
diff --git a/lua/lv-galaxyline/config.lua b/lua/lv-galaxyline/config.lua
deleted file mode 100644
index ddb4aa98..00000000
--- a/lua/lv-galaxyline/config.lua
+++ /dev/null
@@ -1,19 +0,0 @@
-O.plugin.galaxyline = {
- active = true,
- colors = {
- alt_bg = "#2E2E2E",
- grey = "#858585",
- blue = "#569CD6",
- green = "#608B4E",
- yellow = "#DCDCAA",
- orange = "#FF8800",
- purple = "#C586C0",
- magenta = "#D16D9E",
- cyan = "#4EC9B0",
- red = "#D16969",
- error_red = "#F44747",
- warning_orange = "#FF8800",
- info_yellow = "#FFCC66",
- hint_blue = "#9CDCFE",
- },
-}
diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua
deleted file mode 100644
index 281202a8..00000000
--- a/lua/lv-galaxyline/init.lua
+++ /dev/null
@@ -1,326 +0,0 @@
--- if not package.loaded['galaxyline'] then
--- return
--- end
-local status_ok, gl = pcall(require, "galaxyline")
-if not status_ok then
- return
-end
-
--- NOTE: if someone defines colors but doesn't have them then this will break
-local palette_status_ok, colors = pcall(require, O.colorscheme .. ".palette")
-if not palette_status_ok then
- colors = O.plugin.galaxyline.colors
-end
-
-local condition = require "galaxyline.condition"
-local gls = gl.section
-gl.short_line_list = { "NvimTree", "vista", "dbui", "packer" }
-
-table.insert(gls.left, {
- ViMode = {
- provider = function()
- -- auto change color according the vim mode
- local mode_color = {
- n = colors.blue,
- i = colors.green,
- v = colors.purple,
- [""] = colors.purple,
- V = colors.purple,
- c = colors.magenta,
- no = colors.blue,
- s = colors.orange,
- S = colors.orange,
- [""] = colors.orange,
- ic = colors.yellow,
- R = colors.red,
- Rv = colors.red,
- cv = colors.blue,
- ce = colors.blue,
- r = colors.cyan,
- rm = colors.cyan,
- ["r?"] = colors.cyan,
- ["!"] = colors.blue,
- t = colors.blue,
- }
- vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim.fn.mode()])
- return "▊"
- end,
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { "NONE", colors.alt_bg },
- },
-})
--- print(vim.fn.getbufvar(0, 'ts'))
-vim.fn.getbufvar(0, "ts")
-
-table.insert(gls.left, {
- GitIcon = {
- provider = function()
- return " "
- end,
- condition = condition.check_git_workspace,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.orange, colors.alt_bg },
- },
-})
-
-table.insert(gls.left, {
- GitBranch = {
- provider = "GitBranch",
- condition = condition.check_git_workspace,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.left, {
- DiffAdd = {
- provider = "DiffAdd",
- condition = condition.hide_in_width,
- icon = "  ",
- highlight = { colors.green, colors.alt_bg },
- },
-})
-
-table.insert(gls.left, {
- DiffModified = {
- provider = "DiffModified",
- condition = condition.hide_in_width,
- icon = " 柳",
- highlight = { colors.blue, colors.alt_bg },
- },
-})
-
-table.insert(gls.left, {
- DiffRemove = {
- provider = "DiffRemove",
- condition = condition.hide_in_width,
- icon = "  ",
- highlight = { colors.red, colors.alt_bg },
- },
-})
-
-table.insert(gls.left, {
- Filler = {
- provider = function()
- return " "
- end,
- highlight = { colors.grey, colors.alt_bg },
- },
-})
--- get output from shell command
-function os.capture(cmd, raw)
- local f = assert(io.popen(cmd, "r"))
- local s = assert(f:read "*a")
- f:close()
- if raw then
- return s
- end
- s = string.gsub(s, "^%s+", "")
- s = string.gsub(s, "%s+$", "")
- s = string.gsub(s, "[\n\r]+", " ")
- return s
-end
--- cleanup virtual env
-local function env_cleanup(venv)
- if string.find(venv, "/") then
- local final_venv = venv
- for w in venv:gmatch "([^/]+)" do
- final_venv = w
- end
- venv = final_venv
- end
- return venv
-end
-local PythonEnv = function()
- if vim.bo.filetype == "python" then
- local venv = os.getenv "CONDA_DEFAULT_ENV"
- if venv ~= nil then
- return "  (" .. env_cleanup(venv) .. ")"
- end
- venv = os.getenv "VIRTUAL_ENV"
- if venv ~= nil then
- return "  (" .. env_cleanup(venv) .. ")"
- end
- return ""
- end
- return ""
-end
-table.insert(gls.left, {
- VirtualEnv = {
- provider = PythonEnv,
- event = "BufEnter",
- highlight = { colors.green, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- DiagnosticError = {
- provider = "DiagnosticError",
- icon = "  ",
- highlight = { colors.red, colors.alt_bg },
- },
-})
-table.insert(gls.right, {
- DiagnosticWarn = {
- provider = "DiagnosticWarn",
- icon = "  ",
- highlight = { colors.orange, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- DiagnosticInfo = {
- provider = "DiagnosticInfo",
- icon = "  ",
- highlight = { colors.yellow, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- DiagnosticHint = {
- provider = "DiagnosticHint",
- icon = "  ",
- highlight = { colors.blue, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- TreesitterIcon = {
- provider = function()
- if next(vim.treesitter.highlighter.active) ~= nil then
- return " "
- end
- return ""
- end,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.green, colors.alt_bg },
- },
-})
-
-local get_lsp_client = function(msg)
- msg = msg or "LSP Inactive"
- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
- local clients = vim.lsp.get_active_clients()
- if next(clients) == nil then
- return msg
- end
- local lsps = ""
- for _, client in ipairs(clients) do
- local filetypes = client.config.filetypes
- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
- -- print(client.name)
- if lsps == "" then
- -- print("first", lsps)
- lsps = client.name
- else
- if not string.find(lsps, client.name) then
- lsps = lsps .. ", " .. client.name
- end
- -- print("more", lsps)
- end
- end
- end
- if lsps == "" then
- return msg
- else
- return lsps
- end
-end
-
-table.insert(gls.right, {
- ShowLspClient = {
- provider = get_lsp_client,
- condition = function()
- local tbl = { ["dashboard"] = true, [" "] = true }
- if tbl[vim.bo.filetype] then
- return false
- end
- return true
- end,
- icon = " ",
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- LineInfo = {
- provider = "LineColumn",
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- PerCent = {
- provider = "LinePercent",
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- Tabstop = {
- provider = function()
- return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " "
- end,
- condition = condition.hide_in_width,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- BufferType = {
- provider = "FileTypeName",
- condition = condition.hide_in_width,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- FileEncode = {
- provider = "FileEncode",
- condition = condition.hide_in_width,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.right, {
- Space = {
- provider = function()
- return " "
- end,
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.short_line_left, {
- BufferType = {
- provider = "FileTypeName",
- separator = " ",
- separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
-table.insert(gls.short_line_left, {
- SFileName = {
- provider = "SFileName",
- condition = condition.buffer_not_empty,
- highlight = { colors.grey, colors.alt_bg },
- },
-})
-
---table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.alt_bg}}})
diff --git a/lua/lv-gitsigns/config.lua b/lua/lv-gitsigns/config.lua
deleted file mode 100644
index c98811de..00000000
--- a/lua/lv-gitsigns/config.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-O.plugin.gitsigns = {
- signs = {
- -- TODO: add hl to colorscheme
- add = {
- hl = "GitSignsAdd",
- text = "▎",
- numhl = "GitSignsAddNr",
- linehl = "GitSignsAddLn",
- },
- change = {
- hl = "GitSignsChange",
- text = "▎",
- numhl = "GitSignsChangeNr",
- linehl = "GitSignsChangeLn",
- },
- delete = {
- hl = "GitSignsDelete",
- text = "契",
- numhl = "GitSignsDeleteNr",
- linehl = "GitSignsDeleteLn",
- },
- topdelete = {
- hl = "GitSignsDelete",
- text = "契",
- numhl = "GitSignsDeleteNr",
- linehl = "GitSignsDeleteLn",
- },
- changedelete = {
- hl = "GitSignsChange",
- text = "▎",
- numhl = "GitSignsChangeNr",
- linehl = "GitSignsChangeLn",
- },
- },
- numhl = false,
- linehl = false,
- keymaps = {
- -- Default keymap options
- noremap = true,
- buffer = true,
- },
- watch_index = { interval = 1000 },
- sign_priority = 6,
- update_debounce = 200,
- status_formatter = nil, -- Use default
- use_decoration_api = false,
-}
diff --git a/lua/lv-gitsigns/init.lua b/lua/lv-gitsigns/init.lua
deleted file mode 100644
index dc1938b4..00000000
--- a/lua/lv-gitsigns/init.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-local M = {}
-
-M.config = function()
- local status_ok, gitsigns = pcall(require, "gitsigns")
- if not status_ok then
- return
- end
- gitsigns.setup(O.plugin.gitsigns)
-end
-
-return M
diff --git a/lua/lv-telescope/config.lua b/lua/lv-telescope/config.lua
deleted file mode 100644
index 11e58527..00000000
--- a/lua/lv-telescope/config.lua
+++ /dev/null
@@ -1,80 +0,0 @@
-local status_ok, actions = pcall(require, "telescope.actions")
-if not status_ok then
- return
-end
-
-O.plugin.telescope = {
- active = false,
- defaults = {
- find_command = {
- "rg",
- "--no-heading",
- "--with-filename",
- "--line-number",
- "--column",
- "--smart-case",
- },
- prompt_prefix = " ",
- selection_caret = " ",
- entry_prefix = " ",
- initial_mode = "insert",
- selection_strategy = "reset",
- sorting_strategy = "descending",
- layout_strategy = "horizontal",
- layout_config = {
- width = 0.75,
- prompt_position = "bottom",
- preview_cutoff = 120,
- horizontal = { mirror = false },
- vertical = { mirror = false },
- },
- file_sorter = require("telescope.sorters").get_fzy_sorter,
- file_ignore_patterns = {},
- generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
- path_display = { "shorten" },
- winblend = 0,
- border = {},
- borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
- color_devicons = true,
- use_less = true,
- set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
- file_previewer = require("telescope.previewers").vim_buffer_cat.new,
- grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
- qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
-
- -- Developer configurations: Not meant for general override
- -- buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
- mappings = {
- i = {
- ["<C-c>"] = actions.close,
- ["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous,
- ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
- ["<CR>"] = actions.select_default + actions.center,
- -- To disable a keymap, put [map] = false
- -- So, to not map "<C-n>", just put
- -- ["<c-t>"] = trouble.open_with_trouble,
- -- ["<c-x>"] = false,
- -- ["<esc>"] = actions.close,
- -- Otherwise, just set the mapping to the function that you want it to be.
- -- ["<C-i>"] = actions.select_horizontal,
- -- Add up multiple actions
- -- You can perform as many actions in a row as you like
- -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
- },
- n = {
- ["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous,
- ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
- -- ["<c-t>"] = trouble.open_with_trouble,
- -- ["<C-i>"] = my_cool_custom_action,
- },
- },
- },
- extensions = {
- fzy_native = {
- override_generic_sorter = false,
- override_file_sorter = true,
- },
- },
-}
diff --git a/lua/lv-telescope/init.lua b/lua/lv-telescope/init.lua
deleted file mode 100644
index 50a5951a..00000000
--- a/lua/lv-telescope/init.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local status_ok, telescope = pcall(require, "telescope")
-if not status_ok then
- return
-end
-telescope.setup(O.plugin.telescope)
-vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", { noremap = true, silent = true })
diff --git a/lua/lv-treesitter/config.lua b/lua/lv-treesitter/config.lua
deleted file mode 100644
index c22f7bcf..00000000
--- a/lua/lv-treesitter/config.lua
+++ /dev/null
@@ -1,90 +0,0 @@
-O.treesitter = {
- ensure_installed = {}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
- ignore_install = {},
- matchup = {
- enable = false, -- mandatory, false will disable the whole extension
- -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
- },
- highlight = {
- enable = true, -- false will disable the whole extension
- additional_vim_regex_highlighting = true,
- disable = { "latex" },
- },
- context_commentstring = {
- enable = false,
- config = { css = "// %s" },
- },
- -- indent = {enable = true, disable = {"python", "html", "javascript"}},
- -- TODO seems to be broken
- indent = { enable = { "javascriptreact" } },
- autotag = { enable = false },
- textobjects = {
- swap = {
- enable = false,
- -- swap_next = textobj_swap_keymaps,
- },
- -- move = textobj_move_keymaps,
- select = {
- enable = false,
- -- keymaps = textobj_sel_keymaps,
- },
- },
- textsubjects = {
- enable = false,
- keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" },
- },
- playground = {
- enable = false,
- disable = {},
- updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
- persist_queries = false, -- Whether the query persists across vim sessions
- keybindings = {
- toggle_query_editor = "o",
- toggle_hl_groups = "i",
- toggle_injected_languages = "t",
- toggle_anonymous_nodes = "a",
- toggle_language_display = "I",
- focus_language = "f",
- unfocus_language = "F",
- update = "R",
- goto_node = "<cr>",
- show_help = "?",
- },
- },
- rainbow = {
- enable = false,
- extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
- max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
- },
-}
-
--- -- TODO refactor treesitter
--- -- @usage pass a table with your desired languages
--- treesitter = {
--- ensure_installed = "all",
--- ignore_install = { "haskell" },
--- highlight = { enabled = true },
--- -- The below are for treesitter-textobjects plugin
--- textobj_prefixes = {
--- goto_next = "]", -- Go to next
--- goto_previous = "[", -- Go to previous
--- inner = "i", -- Select inside
--- outer = "a", -- Selct around
--- swap = "<leader>a", -- Swap with next
--- },
--- textobj_suffixes = {
--- -- Start and End respectively for the goto keys
--- -- for other keys it only uses the first
--- ["function"] = { "f", "F" },
--- ["class"] = { "m", "M" },
--- ["parameter"] = { "a", "A" },
--- ["block"] = { "k", "K" },
--- ["conditional"] = { "i", "I" },
--- ["call"] = { "c", "C" },
--- ["loop"] = { "l", "L" },
--- ["statement"] = { "s", "S" },
--- ["comment"] = { "/", "?" },
--- },
--- -- The below is for treesitter hint textobjects plugin
--- hint_labels = { "h", "j", "f", "d", "n", "v", "s", "l", "a" },
--- },
diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua
deleted file mode 100644
index fe8bf49e..00000000
--- a/lua/lv-treesitter/init.lua
+++ /dev/null
@@ -1,90 +0,0 @@
--- TODO: refacor this whole file and treesitter in general
--- if not package.loaded['nvim-treesitter'] then return end
---
--- Custom parsers
--- local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
--- parser_config.make = {
--- install_info = {
--- url = "https://github.com/alemuller/tree-sitter-make", -- local path or git repo
--- files = {"src/parser.c"},
--- requires_generate_from_grammar = true
--- }
--- }
--- parser_config.just = {
--- install_info = {
--- url = "~/dev/tree-sitter-just", -- local path or git repo
--- files = {"src/parser.c"}
--- }
--- -- filetype = "just", -- if filetype does not agrees with parser name
--- -- used_by = {"bar", "baz"} -- additional filetypes that use this parser
--- }
--- Custom text objects
--- local textobj_prefixes = O.treesitter.textobj_prefixes
--- local textobj_suffixes = O.treesitter.textobj_suffixes
--- local textobj_sel_keymaps = {}
--- local textobj_swap_keymaps = {}
--- local textobj_move_keymaps = {
--- enable = O.plugin.ts_textobjects,
--- set_jumps = true, -- whether to set jumps in the jumplist
--- goto_next_start = {},
--- goto_next_end = {},
--- goto_previous_start = {},
--- goto_previous_end = {},
--- }
--- for obj, suffix in pairs(textobj_suffixes) do
--- if textobj_prefixes["goto_next"] ~= nil then
--- textobj_move_keymaps["goto_next_start"][textobj_prefixes["goto_next"] .. suffix[1]] = "@" .. obj .. ".outer"
--- textobj_move_keymaps["goto_next_end"][textobj_prefixes["goto_next"] .. suffix[2]] = "@" .. obj .. ".outer"
--- end
--- if textobj_prefixes["goto_previous"] ~= nil then
--- textobj_move_keymaps["goto_previous_start"][textobj_prefixes["goto_previous"] .. suffix[2]] = "@" .. obj .. ".outer"
--- textobj_move_keymaps["goto_previous_end"][textobj_prefixes["goto_previous"] .. suffix[1]] = "@" .. obj .. ".outer"
--- end
---
--- if textobj_prefixes["inner"] ~= nil then
--- textobj_sel_keymaps[textobj_prefixes["inner"] .. suffix[1]] = "@" .. obj .. ".inner"
--- end
--- if textobj_prefixes["outer"] ~= nil then
--- textobj_sel_keymaps[textobj_prefixes["outer"] .. suffix[1]] = "@" .. obj .. ".outer"
--- end
---
--- if textobj_prefixes["swap"] ~= nil then
--- textobj_swap_keymaps[textobj_prefixes["swap"] .. suffix[1]] = "@" .. obj .. ".outer"
--- end
--- end
--- vim.g.ts_hint_textobject_keys = O.treesitter.hint_labels -- Requires https://github.com/mfussenegger/nvim-ts-hint-textobject/pull/2
---
--- -- Add which key menu entries
--- local status, wk = pcall(require, "which-key")
--- if status then
--- local normal = {
--- mode = "n", -- Normal mode
--- }
--- local operators = {
--- mode = "o", -- Operator mode
--- }
--- wk.register(textobj_sel_keymaps, operators)
--- wk.register({
--- ["m"] = "Hint Objects",
--- ["."] = "Textsubject",
--- [";"] = "Textsubject-big",
--- }, operators)
--- wk.register(textobj_swap_keymaps, normal)
--- wk.register({
--- [textobj_prefixes["swap"]] = "Swap",
--- -- [textobj_prefixes["goto_next"]] = "Jump [",
--- -- [textobj_prefixes["goto_previous"]] = "Jump ]"
--- }, normal)
--- wk.register(textobj_move_keymaps["goto_next_start"], normal)
--- wk.register(textobj_move_keymaps["goto_next_end"], normal)
--- wk.register(textobj_move_keymaps["goto_previous_start"], normal)
--- wk.register(textobj_move_keymaps["goto_previous_end"], normal)
--- end
-
-local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs")
-if not status_ok then
- return
-end
-
-
-treesitter_configs.setup(O.treesitter)
diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua
index 88d06c28..ef075f15 100644
--- a/lua/lv-utils/init.lua
+++ b/lua/lv-utils/init.lua
@@ -4,7 +4,7 @@ function lv_utils.reload_lv_config()
vim.cmd "source ~/.config/nvim/lv-config.lua"
vim.cmd "source ~/.config/nvim/lua/plugins.lua"
vim.cmd "source ~/.config/nvim/lua/settings.lua"
- vim.cmd "source ~/.config/nvim/lua/lv-formatter/init.lua"
+ vim.cmd "source ~/.config/nvim/lua/core/formatter.lua"
vim.cmd ":PackerCompile"
vim.cmd ":PackerInstall"
end
diff --git a/lua/lv-which-key/config.lua b/lua/lv-which-key/config.lua
deleted file mode 100644
index cf5e2713..00000000
--- a/lua/lv-which-key/config.lua
+++ /dev/null
@@ -1,150 +0,0 @@
-O.plugin.which_key = {
- active = false,
- setup = {
- plugins = {
- marks = true, -- shows a list of your marks on ' and `
- registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
- -- the presets plugin, adds help for a bunch of default keybindings in Neovim
- -- No actual key bindings are created
- presets = {
- operators = false, -- adds help for operators like d, y, ...
- motions = false, -- adds help for motions
- text_objects = false, -- help for text objects triggered after entering an operator
- windows = true, -- default bindings on <c-w>
- nav = true, -- misc bindings to work with windows
- z = true, -- bindings for folds, spelling and others prefixed with z
- g = true, -- bindings for prefixed with g
- },
- spelling = { enabled = true, suggestions = 20 }, -- use which-key for spelling hints
- },
- icons = {
- breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
- separator = "➜", -- symbol used between a key and it's label
- group = "+", -- symbol prepended to a group
- },
- window = {
- border = "single", -- none, single, double, shadow
- position = "bottom", -- bottom, top
- margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
- padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
- },
- layout = {
- height = { min = 4, max = 25 }, -- min and max height of the columns
- width = { min = 20, max = 50 }, -- min and max width of the columns
- spacing = 3, -- spacing between columns
- },
- hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
- show_help = true, -- show help message on the command line when the popup is visible
- },
-
- opts = {
- mode = "n", -- NORMAL mode
- prefix = "<leader>",
- buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
- silent = true, -- use `silent` when creating keymaps
- noremap = true, -- use `noremap` when creating keymaps
- nowait = true, -- use `nowait` when creating keymaps
- },
- vopts = {
- mode = "v", -- VISUAL mode
- prefix = "<leader>",
- buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
- silent = true, -- use `silent` when creating keymaps
- noremap = true, -- use `noremap` when creating keymaps
- nowait = true, -- use `nowait` when creating keymaps
- },
- -- NOTE: Prefer using : over <cmd> as the latter avoids going back in normal-mode.
- -- see https://neovim.io/doc/user/map.html#:map-cmd
- vmappings ={
- ["/"] = { ":CommentToggle<CR>", "Comment" },
- },
- mappings = {
- ["w"] = { "<cmd>w!<CR>", "Save" },
- ["q"] = { "<cmd>q!<CR>", "Quit" },
- ["/"] = { "<cmd>CommentToggle<CR>", "Comment" },
- ["c"] = { "<cmd>BufferClose<CR>", "Close Buffer" },
- ["e"] = { "<cmd>lua require'lv-nvimtree'.toggle_tree()<CR>", "Explorer" },
- ["f"] = { "<cmd>Telescope find_files<CR>", "Find File" },
- ["h"] = { '<cmd>let @/=""<CR>', "No Highlight" },
- [";"] = { "<cmd>Dashboard<CR>", "Dashboard" },
- p = {
- name = "Packer",
- c = { "<cmd>PackerCompile<cr>", "Compile" },
- i = { "<cmd>PackerInstall<cr>", "Install" },
- r = { "<cmd>lua require('lv-utils').reload_lv_config()<cr>", "Reload" },
- s = { "<cmd>PackerSync<cr>", "Sync" },
- u = { "<cmd>PackerUpdate<cr>", "Update" },
- },
-
- -- " Available Debug Adapters:
- -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
- -- " Adapter configuration and installation instructions:
- -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
- -- " Debug Adapter protocol:
- -- " https://microsoft.github.io/debug-adapter-protocol/
- -- " Debugging
- g = {
- name = "Git",
- j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
- k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
- l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
- p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
- r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
- R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
- s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
- u = {
- "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
- "Undo Stage Hunk",
- },
- o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
- b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
- c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
- C = {
- "<cmd>Telescope git_bcommits<cr>",
- "Checkout commit(for current file)",
- },
- },
-
- l = {
- name = "LSP",
- a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
- d = {
- "<cmd>Telescope lsp_document_diagnostics<cr>",
- "Document Diagnostics",
- },
- w = {
- "<cmd>Telescope lsp_workspace_diagnostics<cr>",
- "Workspace Diagnostics",
- },
- f = { "<cmd>silent FormatWrite<cr>", "Format" },
- i = { "<cmd>LspInfo<cr>", "Info" },
- j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
- k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
- q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
- r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
- s = { "<cmd> Telescope lsp_document_symbols<cr>", "Document Symbols" },
- S = {
- "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
- "Workspace Symbols",
- },
- },
-
- s = {
- name = "Search",
- b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
- c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
- f = { "<cmd>Telescope find_files<cr>", "Find File" },
- h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
- M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
- r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
- R = { "<cmd>Telescope registers<cr>", "Registers" },
- t = { "<cmd>Telescope live_grep<cr>", "Text" },
- k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
- C = { "<cmd>Telescope commands<cr>", "Commands" },
- },
- T = {
- name = "Treesitter",
- i = { ":TSConfigInfo<cr>", "Info" },
- },
- },
-}
diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua
deleted file mode 100644
index 50583b4e..00000000
--- a/lua/lv-which-key/init.lua
+++ /dev/null
@@ -1,54 +0,0 @@
--- if not package.loaded['which-key'] then
--- return
--- end
-local status_ok, which_key = pcall(require, "which-key")
-if not status_ok then
- return
-end
-
-which_key.setup(O.plugin.which_key.setup)
-
-local opts = O.plugin.which_key.opts
-local vopts = O.plugin.which_key.vopts
-
-local mappings = O.plugin.which_key.mappings
-local vmappings = O.plugin.which_key.vmappings;
-
--- if O.plugin.ts_playground.active then
--- vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true })
--- mappings[""] = "Highlight Capture"
--- end
-
-if O.plugin.zen.active then
- vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })
- mappings["z"] = "Zen"
-end
-
-if O.plugin.telescope_project.active then
- -- open projects
- vim.api.nvim_set_keymap(
- "n",
- "<leader>P",
- ":lua require'telescope'.extensions.project.project{}<CR>",
- { noremap = true, silent = true }
- )
- mappings["P"] = "Projects"
-end
-
-if O.plugin.lush.active then
- mappings["L"] = {
- name = "+Lush",
- l = { ":Lushify<cr>", "Lushify" },
- x = { ":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export" },
- t = { ":LushRunTutorial<cr>", "Lush Tutorial" },
- q = { ":LushRunQuickstart<cr>", "Lush Quickstart" },
- }
-end
-
-for k, v in pairs(O.user_which_key) do
- mappings[k] = v
-end
-
-local wk = require "which-key"
-wk.register(mappings, opts)
-wk.register(vmappings, vopts)
diff --git a/lua/lv-zen/config.lua b/lua/lv-zen/config.lua
deleted file mode 100644
index ef1e2bc5..00000000
--- a/lua/lv-zen/config.lua
+++ /dev/null
@@ -1,21 +0,0 @@
-O.plugin["zen"] = {
- window = {
- backdrop = 1,
- height = 0.85, -- height of the Zen window
- options = {
- signcolumn = "no", -- disable signcolumn
- number = false, -- disable number column
- relativenumber = false, -- disable relative numbers
- -- cursorline = false, -- disable cursorline
- -- cursorcolumn = false, -- disable cursor column
- -- foldcolumn = "0", -- disable fold column
- -- list = false, -- disable whitespace characters
- },
- },
- plugins = {
- gitsigns = { enabled = false }, -- disables git signs
- -- your configuration comes here
- -- or leave it empty to use the default settings
- -- refer to the configuration section below
- },
-}
diff --git a/lua/lv-zen/init.lua b/lua/lv-zen/init.lua
deleted file mode 100644
index ce48a4b0..00000000
--- a/lua/lv-zen/init.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local M = {}
-local status_ok, zen_mode = pcall(require, "zen-mode")
-if not status_ok then
- return
-end
-
-M.config = function()
- zen_mode.setup(O.plugin.zen)
-end
-return M
diff --git a/lua/plugins.lua b/lua/plugins.lua
index d840bed7..71695c86 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -44,7 +44,7 @@ return require("packer").startup(function(use)
-- Telescope
use {
"nvim-telescope/telescope.nvim",
- config = [[require('lv-telescope')]],
+ config = [[require('core.telescope').setup()]],
}
-- Autocomplete
@@ -52,7 +52,7 @@ return require("packer").startup(function(use)
"hrsh7th/nvim-compe",
-- event = "InsertEnter",
config = function()
- require("lv-compe").config()
+ require("core.compe").setup()
end,
}
@@ -62,7 +62,7 @@ return require("packer").startup(function(use)
-- event = "InsertEnter",
after = { "telescope.nvim" },
config = function()
- require "lv-autopairs"
+ require "core.autopairs"
end,
}
@@ -72,13 +72,18 @@ return require("packer").startup(function(use)
use { "rafamadriz/friendly-snippets", event = "InsertEnter" }
-- Treesitter
- use { "nvim-treesitter/nvim-treesitter" }
+ use {
+ "nvim-treesitter/nvim-treesitter",
+ config = function()
+ require("core.treesitter").setup()
+ end,
+ }
-- Formatter.nvim
use {
"mhartington/formatter.nvim",
config = function()
- require "lv-formatter"
+ require "core.formatter"
end,
event = "BufRead",
}
@@ -90,7 +95,7 @@ return require("packer").startup(function(use)
-- cmd = "NvimTreeToggle",
commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
config = function()
- require("lv-nvimtree").config()
+ require("core.nvimtree").setup()
end,
}
@@ -107,7 +112,7 @@ return require("packer").startup(function(use)
use {
"folke/which-key.nvim",
config = function()
- require "lv-which-key"
+ require("core.which-key").setup()
end,
event = "BufWinEnter",
}
@@ -140,7 +145,7 @@ return require("packer").startup(function(use)
use {
"glepnir/galaxyline.nvim",
config = function()
- require "lv-galaxyline"
+ require("core.galaxyline").setup()
end,
event = "BufWinEnter",
disable = not O.plugin.galaxyline.active,
@@ -149,7 +154,7 @@ return require("packer").startup(function(use)
use {
"romgrk/barbar.nvim",
config = function()
- require "lv-barbar"
+ require "core.bufferline"
end,
event = "BufWinEnter",
}
@@ -159,7 +164,7 @@ return require("packer").startup(function(use)
"mfussenegger/nvim-dap",
-- event = "BufWinEnter",
config = function()
- require "lv-dap"
+ require("core.dap").setup()
end,
disable = not O.plugin.dap.active,
}
@@ -179,7 +184,7 @@ return require("packer").startup(function(use)
"ChristianChiarulli/dashboard-nvim",
event = "BufWinEnter",
config = function()
- require("lv-dashboard").config()
+ require("core.dashboard").setup()
end,
disable = not O.plugin.dashboard.active,
}
@@ -190,7 +195,7 @@ return require("packer").startup(function(use)
"numToStr/FTerm.nvim",
event = "BufWinEnter",
config = function()
- require("lv-floatterm").config()
+ require("core.floatterm").setup()
end,
disable = not O.plugin.floatterm.active,
}
@@ -201,31 +206,11 @@ return require("packer").startup(function(use)
cmd = "ZenMode",
event = "BufRead",
config = function()
- require("lv-zen").config()
+ require("core.zen").setup()
end,
disable = not O.plugin.zen.active,
}
- use {
- "lukas-reineke/indent-blankline.nvim",
- event = "BufRead",
- setup = function()
- vim.g.indentLine_enabled = 1
- vim.g.indent_blankline_char = "▏"
-
- vim.g.indent_blankline_filetype_exclude = {
- "help",
- "terminal",
- "dashboard",
- }
- vim.g.indent_blankline_buftype_exclude = { "terminal" }
-
- vim.g.indent_blankline_show_trailing_blankline_indent = false
- vim.g.indent_blankline_show_first_indent_level = true
- end,
- disable = not O.plugin.indent_line.active,
- }
-
---------------------------------------------------------------------------------
-- LANGUAGE SPECIFIC GOES HERE
@@ -262,27 +247,4 @@ return require("packer").startup(function(use)
-- ft = { "java" },
disable = not O.lang.java.java_tools.active,
}
-
- -- Custom semantic text objects
- use {
- "nvim-treesitter/nvim-treesitter-textobjects",
- disable = not O.plugin.ts_textobjects.active,
- }
-
- -- Smart text objects
- use {
- "RRethy/nvim-treesitter-textsubjects",
- disable = not O.plugin.ts_textsubjects.active,
- }
-
- -- Text objects using hint labels
- use {
- "mfussenegger/nvim-ts-hint-textobject",
- event = "BufRead",
- disable = not O.plugin.ts_hintobjects.active,
- }
-
- for _, plugin in pairs(O.user_plugins) do
- packer.use(plugin)
- end
end)