mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-24 16:28:41 -05:00
Update nvim
Signed-off-by: The-Repo-Club <wayne6324@gmail.com>
This commit is contained in:
parent
69c8ca6af3
commit
bac28f8791
@ -1,4 +1,4 @@
|
||||
#? Config file for btop v. 1.2.7
|
||||
#? Config file for btop v. 1.2.8
|
||||
|
||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||
@ -60,7 +60,7 @@ proc_sorting = "cpu lazy"
|
||||
proc_reversed = False
|
||||
|
||||
#* Show processes as a tree.
|
||||
proc_tree = False
|
||||
proc_tree = True
|
||||
|
||||
#* Use the cpu graph colors in the process list.
|
||||
proc_colors = True
|
||||
@ -80,6 +80,9 @@ proc_info_smaps = False
|
||||
#* Show proc box on left side of screen instead of right.
|
||||
proc_left = False
|
||||
|
||||
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||
proc_filter_kernel = False
|
||||
|
||||
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
||||
#* Select from a list of detected attributes from the options menu.
|
||||
cpu_graph_upper = "total"
|
||||
|
@ -197,7 +197,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=70041c12
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=745203ec
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -425,7 +425,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=6d3e86c7
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=ff3d3721
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -675,7 +675,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=b17121ec
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=adc9b68
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -733,7 +733,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\CurrentMode={51EB6E3A-27A0-4AD6-A35C-6B67E0329A3D}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\HwModified=7ffd
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=cdf45323
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=aa018cfe
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Name=Multi
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\KeyMap=K68 GB
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\UseRealNames=true
|
||||
@ -929,7 +929,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=9e7c9170
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=774d4af8
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -1157,7 +1157,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=e39dadb9
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=2c5e3c51
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -1407,7 +1407,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=1101fcbe
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=25d14653
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -1465,7 +1465,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\CurrentMode={11C11AE3-3195-4DFC-B8AC-2FEA703414E5}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\HwModified=40b6f054
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=4df1f967
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=faead8da
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Name=Demo
|
||||
|
||||
[Popups]
|
||||
|
Binary file not shown.
@ -917,7 +917,7 @@ $super_b+minus \
|
||||
for_window [class="(?i)dropdown-terminal"] floating enable
|
||||
for_window [class="(?i)dropdown-terminal"] resize set 1100 800
|
||||
for_window [class="(?i)dropdown-terminal"] move scratchpad
|
||||
$exe $TerminalEmulator --title "dropdown-terminal" --class "dropdown-terminal","dropdown-terminal";focus
|
||||
$exe $TerminalEmulator --title "dropdown-terminal" --class "dropdown-terminal","dropdown-terminal"
|
||||
|
||||
## Category: Scratchpad;
|
||||
# Description: Toggle $TerminalEmulator;
|
||||
@ -927,7 +927,7 @@ $control_b+Return \
|
||||
for_window [class="(?i)btop-terminal"] floating enable
|
||||
for_window [class="(?i)btop-terminal"] resize set 1100 800
|
||||
for_window [class="(?i)btop-terminal"] move scratchpad
|
||||
$exe $TerminalEmulator --title "btop-terminal" --class "btop-terminal","btop-terminal" -e btop;focus
|
||||
$exe $TerminalEmulator --title "btop-terminal" --class "btop-terminal","btop-terminal" -e btop
|
||||
|
||||
## Category: Scratchpad;
|
||||
# Description: Toggle btop;
|
||||
|
@ -0,0 +1 @@
|
||||
quitOnTopLevelReturn: true
|
@ -1,6 +1,8 @@
|
||||
lastupdatecheck: 0
|
||||
recentrepos:
|
||||
- /home/dt
|
||||
- /mnt/500GB/.gitlabs/instawm
|
||||
- /mnt/500GB/.gitlabs/Arch.TheRepo.Club
|
||||
startuppopupversion: 5
|
||||
customcommandshistory:
|
||||
- ""
|
||||
- q
|
||||
hidecommandlog: false
|
||||
|
@ -1,26 +1,23 @@
|
||||
local ok, err = pcall(require, "core")
|
||||
|
||||
vim.g.dracula_show_end_of_buffer = true -- default false, Turn on or off EndOfBuffer symbol
|
||||
vim.g.dracula_transparent_bg = true -- default false, enables transparent background
|
||||
|
||||
vim.cmd[[colorscheme minimalmistakes]]
|
||||
vim.cmd("hi! link DashboardHeader Error")
|
||||
vim.cmd("hi! link DashboardCenter Keyword")
|
||||
vim.cmd("set colorcolumn=90")
|
||||
|
||||
if not ok then
|
||||
error("Error loading core" .. "\n\n" .. err)
|
||||
end
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars:append("space:⋅")
|
||||
vim.opt.listchars:append("eol:↴")
|
||||
|
||||
vim.g.header_email = "wayne6324@gmail.com"
|
||||
vim.g.header_github = "The-Repo-Club"
|
||||
vim.g.header_username = "The-Repo-Club"
|
||||
|
||||
vim.g.header_sh = "bash"
|
||||
vim.g.header_auto_update = "true"
|
||||
require "user.options"
|
||||
require "user.keymaps"
|
||||
require "user.plugins"
|
||||
require "user.colorscheme"
|
||||
require "user.cmp"
|
||||
require "user.lsp"
|
||||
require "user.telescope"
|
||||
require "user.treesitter"
|
||||
require "user.autopairs"
|
||||
require "user.comment"
|
||||
require "user.gitsigns"
|
||||
require "user.nvim-tree"
|
||||
require "user.bufferline"
|
||||
require "user.lualine"
|
||||
require "user.toggleterm"
|
||||
require "user.project"
|
||||
require "user.impatient"
|
||||
require "user.indentline"
|
||||
require "user.alpha"
|
||||
require "user.whichkey"
|
||||
require "user.autocommands"
|
||||
require "user.header"
|
||||
require "user.trim"
|
||||
|
@ -1,14 +0,0 @@
|
||||
-- uncomment this if you want to open nvim with a dir
|
||||
-- vim.cmd [[ autocmd BufEnter * if &buftype != "terminal" | lcd %:p:h | endif ]]
|
||||
|
||||
-- Use relative & absolute line numbers in 'n' & 'i' modes respectively
|
||||
-- vim.cmd[[ au InsertEnter * set norelativenumber ]]
|
||||
-- vim.cmd[[ au InsertLeave * set relativenumber ]]
|
||||
|
||||
-- Don't show any numbers inside terminals
|
||||
vim.cmd [[ au TermOpen term://* setlocal nonumber norelativenumber | setfiletype terminal ]]
|
||||
|
||||
-- Open a file from its last left off position
|
||||
-- vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
||||
-- File extension specific tabbing
|
||||
-- vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]
|
@ -1,22 +0,0 @@
|
||||
local function isModuleAvailable(name)
|
||||
if package.loaded[name] then
|
||||
return true
|
||||
else
|
||||
for _, searcher in ipairs(package.searchers or package.loaders) do
|
||||
local loader = searcher(name)
|
||||
if type(loader) == "function" then
|
||||
package.preload[name] = loader
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local loadIfExists = function(module)
|
||||
if isModuleAvailable(module) then
|
||||
require(module)
|
||||
end
|
||||
end
|
||||
|
||||
loadIfExists "custom"
|
@ -1,182 +0,0 @@
|
||||
-- IMPORTANT NOTE : This is default config, so dont change anything here.
|
||||
-- use custom/nvimrc.lua instead
|
||||
|
||||
local M = {}
|
||||
M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
|
||||
|
||||
-- non plugin normal, available without any plugins
|
||||
M.options = {
|
||||
-- NeoVim/Vim options
|
||||
clipboard = "unnamedplus",
|
||||
cmdheight = 1,
|
||||
ruler = false,
|
||||
hidden = true,
|
||||
ignorecase = true,
|
||||
smartcase = true,
|
||||
mapleader = " ",
|
||||
mouse = "a",
|
||||
number = true,
|
||||
-- relative numbers in normal mode tool at the bottom of options.lua
|
||||
numberwidth = 2,
|
||||
relativenumber = false,
|
||||
expandtab = true,
|
||||
shiftwidth = 2,
|
||||
smartindent = true,
|
||||
tabstop = 8, -- Number of spaces that a <Tab> in the file counts for
|
||||
timeoutlen = 400,
|
||||
-- interval for writing swap file to disk, also used by gitsigns
|
||||
updatetime = 250,
|
||||
undofile = true, -- keep a permanent undo (across restarts)
|
||||
}
|
||||
|
||||
-- ui configs
|
||||
M.ui = {
|
||||
italic_comments = false,
|
||||
-- Enable this only if your terminal has the colorscheme set which neovim uses
|
||||
-- For Ex : if you have onedark set in neovim, set onedark's bg color on your terminal
|
||||
transparency = false,
|
||||
}
|
||||
|
||||
-- these are plugin related options
|
||||
M.plugins = {
|
||||
-- enable and disable plugins (false for disable)
|
||||
status = {
|
||||
blankline = true, -- show code scope with symbols
|
||||
bufferline = true, -- list open buffers up the top, easy switching too
|
||||
colorizer = false, -- color RGB, HEX, CSS, NAME color codes
|
||||
comment = true, -- easily (un)comment code, language aware
|
||||
dashboard = true, -- NeoVim 'home screen' on open
|
||||
esc_insertmode = true, -- map to <ESC> with no lag
|
||||
gitsigns = true, -- gitsigns in statusline
|
||||
lspsignature = true, -- lsp enhancements
|
||||
telescope_media = false, -- media previews within telescope finders
|
||||
vim_matchup = true, -- % operator enhancements
|
||||
cmp = true,
|
||||
clap = true,
|
||||
nvimtree = true,
|
||||
autopairs = true,
|
||||
startify = false,
|
||||
},
|
||||
options = {
|
||||
lspconfig = {
|
||||
setup_lspconf = "", -- path of file containing setups of different lsps
|
||||
},
|
||||
nvimtree = {
|
||||
enable_git = 1,
|
||||
},
|
||||
luasnip = {
|
||||
snippet_path = {},
|
||||
},
|
||||
statusline = { -- statusline related options
|
||||
-- these are filetypes, not pattern matched
|
||||
-- shown filetypes will overrule hidden filetypes
|
||||
hidden = {
|
||||
"help",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"terminal",
|
||||
},
|
||||
-- show short statusline on small screens
|
||||
shortline = true,
|
||||
shown = {},
|
||||
-- default, round , slant , block , arrow
|
||||
style = "default",
|
||||
},
|
||||
esc_insertmode_timeout = 300,
|
||||
},
|
||||
default_plugin_config_replace = {},
|
||||
}
|
||||
|
||||
-- mappings -- don't use a single keymap twice --
|
||||
-- non plugin mappings
|
||||
M.mappings = {
|
||||
-- custom = {}, -- all custom user mappings
|
||||
-- close current focused buffer
|
||||
close_buffer = "<leader>x",
|
||||
copy_whole_file = "<C-a>", -- copy all contents of the current buffer
|
||||
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
|
||||
-- navigation in insert mode, only if enabled in options
|
||||
insert_nav = {
|
||||
backward = "<C-h>",
|
||||
end_of_line = "<C-e>",
|
||||
forward = "<C-l>",
|
||||
next_line = "<C-k>",
|
||||
prev_line = "<C-j>",
|
||||
beginning_of_line = "<C-a>",
|
||||
},
|
||||
--better window movement
|
||||
window_nav = {
|
||||
moveLeft = "<C-h>",
|
||||
moveRight = "<C-l>",
|
||||
moveUp = "<C-k>",
|
||||
moveDown = "<C-j>",
|
||||
},
|
||||
-- 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
|
||||
-- show & recover hidden terminal buffers in a telescope picker
|
||||
pick_term = "<leader>W",
|
||||
-- below three are for spawning terminals
|
||||
new_horizontal = "<leader>h",
|
||||
new_vertical = "<leader>v",
|
||||
new_window = "<leader>w",
|
||||
},
|
||||
}
|
||||
|
||||
-- all plugins related mappings
|
||||
M.mappings.plugins = {
|
||||
-- list open buffers up the top, easy switching too
|
||||
bufferline = {
|
||||
next_buffer = "<TAB>", -- next buffer
|
||||
prev_buffer = "<S-Tab>", -- previous buffer
|
||||
},
|
||||
-- easily (un)comment code, language aware
|
||||
comment = {
|
||||
toggle = "<leader>/", -- toggle comment (works on multiple lines)
|
||||
},
|
||||
-- NeoVim 'home screen' on open
|
||||
dashboard = {
|
||||
find_files = "<leader>dff",
|
||||
browser = "<leader>dfb",
|
||||
find_word = "<leader>dfw",
|
||||
new_file = "<leader>dfn", -- basically create a new buffer
|
||||
open = "<leader>do", -- open dashboard
|
||||
session_load = "<leader>dl", -- load a saved session
|
||||
session_save = "<leader>ds", -- save a session
|
||||
},
|
||||
-- map to <ESC> with no lag
|
||||
better_escape = { -- <ESC> will still work
|
||||
esc_insertmode = { "jk" }, -- multiple mappings allowed
|
||||
},
|
||||
-- file explorer/tree
|
||||
nvimtree = {
|
||||
toggle = "<C-n>",
|
||||
focus = "<leader>e",
|
||||
},
|
||||
-- multitool for finding & picking things
|
||||
telescope = {
|
||||
buffers = "<leader>fb",
|
||||
find_files = "<leader>ff",
|
||||
find_hiddenfiles = "<leader>fa",
|
||||
git_commits = "<leader>cm",
|
||||
git_status = "<leader>gt",
|
||||
help_tags = "<leader>fh",
|
||||
live_grep = "<leader>fw",
|
||||
oldfiles = "<leader>fo",
|
||||
themes = "<leader>th", -- NeoVim theme picker
|
||||
-- media previews within telescope finders
|
||||
telescope_media = {
|
||||
media_files = "<leader>fp",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
@ -1,28 +0,0 @@
|
||||
local utils = require "core.utils"
|
||||
local system = require "core.system"
|
||||
local M = {}
|
||||
|
||||
M.edit_config = function()
|
||||
local selected_config = tonumber(vim.fn.inputlist({
|
||||
"Select a configuration file to edit:",
|
||||
"1. init.lua (default)",
|
||||
"2. init.lua",
|
||||
"3. nvimrc.lua",
|
||||
}))
|
||||
local config = utils.load_config()
|
||||
local setting = config.plugins.options
|
||||
|
||||
local open_command = setting.open_command and "split" or "edit"
|
||||
|
||||
if selected_config == 1 then
|
||||
vim.cmd(string.format("%s %s%sinit.lua", open_command, system.nvim_default_root, system.sep))
|
||||
elseif selected_config == 2 then
|
||||
vim.cmd(string.format("%s %s%sinit.lua", open_command, system.nvim_configs_root, system.sep))
|
||||
elseif selected_config == 3 then
|
||||
vim.cmd(string.format("%s %s%snvimrc.lua", open_command, system.nvim_configs_root, system.sep))
|
||||
elseif selected_config ~= 0 then
|
||||
log.error("Invalid option selected.")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -1,68 +0,0 @@
|
||||
local hooks, overrides, M = {}, {}, {}
|
||||
local allowed_hooks = {
|
||||
"install_plugins",
|
||||
"setup_mappings",
|
||||
"ready",
|
||||
}
|
||||
|
||||
local function has_value(tab, val)
|
||||
for _, value in ipairs(tab) do
|
||||
if value == val then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
M.add = function(name, fn)
|
||||
if not (has_value(allowed_hooks, name)) then
|
||||
error("Custom lua uses unallowed hook " .. name)
|
||||
end
|
||||
if hooks[name] == nil then
|
||||
hooks[name] = {}
|
||||
end
|
||||
table.insert(hooks[name], fn)
|
||||
end
|
||||
|
||||
M.run = function(name, args)
|
||||
if hooks[name] == nil then
|
||||
return
|
||||
end
|
||||
|
||||
for _, hook in pairs(hooks[name]) do
|
||||
hook(args)
|
||||
end
|
||||
end
|
||||
|
||||
M.createOverrides = function(module)
|
||||
local O = {}
|
||||
|
||||
O.get = function(name, default)
|
||||
local current = default
|
||||
if overrides[module] and overrides[module][name] then
|
||||
if type(overrides[module][name]) == "function" then
|
||||
current = overrides[module][name]
|
||||
elseif type(overrides[module][name]) == "table" then
|
||||
for _, override in pairs(overrides[module][name]) do
|
||||
current = override(current)
|
||||
end
|
||||
end
|
||||
end
|
||||
return current
|
||||
end
|
||||
|
||||
return O
|
||||
end
|
||||
|
||||
M.override = function(module, name, overwrite)
|
||||
if overrides[module] == nil then
|
||||
overrides[module] = {}
|
||||
end
|
||||
if overrides[module][name] == nil then
|
||||
overrides[module][name] = {}
|
||||
end
|
||||
table.insert(overrides[module][name], overwrite)
|
||||
end
|
||||
|
||||
return M
|
@ -1,20 +0,0 @@
|
||||
local core_modules = {
|
||||
"core.custom",
|
||||
"core.options",
|
||||
"core.autocmds",
|
||||
"core.mappings",
|
||||
}
|
||||
|
||||
local hooks = require "core.hooks"
|
||||
|
||||
for _, module in ipairs(core_modules) do
|
||||
local ok, err = pcall(require, module)
|
||||
if not ok then
|
||||
error("Error loading " .. module .. "\n\n" .. err)
|
||||
end
|
||||
end
|
||||
|
||||
-- set all the non plugin mappings
|
||||
require("core.mappings").misc()
|
||||
|
||||
hooks.run "ready"
|
@ -1,127 +0,0 @@
|
||||
local utils = require "core.utils"
|
||||
local hooks = require "core.hooks"
|
||||
|
||||
local config = utils.load_config()
|
||||
local map = utils.map
|
||||
|
||||
local maps = config.mappings
|
||||
local plugin_maps = maps.plugins
|
||||
|
||||
local cmd = vim.cmd
|
||||
|
||||
local M = {}
|
||||
|
||||
-- these mappings will only be called during initialization
|
||||
M.misc = function()
|
||||
local function non_config_mappings()
|
||||
-- Don't copy the replaced text after pasting in visual mode
|
||||
map("v", "p", '"_dP')
|
||||
|
||||
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
|
||||
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
|
||||
-- empty mode is same as using :map
|
||||
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
|
||||
map("", "j", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map("", "k", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
map("", "<Down>", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map("", "<Up>", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
|
||||
-- use ESC to turn off search highlighting
|
||||
map("n", "<Esc>", ":noh <CR>")
|
||||
end
|
||||
|
||||
local function optional_mappings()
|
||||
|
||||
end
|
||||
|
||||
local function required_mappings()
|
||||
map("n", maps.close_buffer, ":lua require('core.utils').close_buffer() <CR>") -- close buffer
|
||||
map("n", maps.copy_whole_file, ":%y+ <CR>") -- copy whole file content
|
||||
map("n", maps.new_buffer, ":enew <CR>") -- new buffer
|
||||
map("n", maps.new_tab, ":tabnew <CR>") -- new tabs
|
||||
map("n", maps.line_number_toggle, ":set nu! <CR>") -- toggle numbers
|
||||
map("n", maps.save_file, ":w <CR>") -- ctrl + s to save file
|
||||
|
||||
-- terminal mappings --
|
||||
local term_maps = maps.terminal
|
||||
-- get out of terminal mode
|
||||
map("t", term_maps.esc_termmode, "<C-\\><C-n>")
|
||||
-- hide a term from within terminal mode
|
||||
map("t", term_maps.esc_hide_termmode, "<C-\\><C-n> :lua require('core.utils').close_buffer() <CR>")
|
||||
-- pick a hidden term
|
||||
map("n", term_maps.pick_term, ":Telescope terms <CR>")
|
||||
-- Open terminals
|
||||
-- TODO this opens on top of an existing vert/hori term, fixme
|
||||
map("n", term_maps.new_horizontal, ":execute 15 .. 'new +terminal' | let b:term_type = 'hori' | startinsert <CR>")
|
||||
map("n", term_maps.new_vertical, ":execute 'vnew +terminal' | let b:term_type = 'vert' | startinsert <CR>")
|
||||
map("n", term_maps.new_window, ":execute 'terminal' | let b:term_type = 'wind' | startinsert <CR>")
|
||||
-- terminal mappings end --
|
||||
|
||||
-- Add Packer commands because we are not loading it at startup
|
||||
cmd "silent! command PackerClean lua require 'plugins' require('packer').clean()"
|
||||
cmd "silent! command PackerCompile lua require 'plugins' require('packer').compile()"
|
||||
cmd "silent! command PackerInstall lua require 'plugins' require('packer').install()"
|
||||
cmd "silent! command PackerStatus lua require 'plugins' require('packer').status()"
|
||||
cmd "silent! command PackerSync lua require 'plugins' require('packer').sync()"
|
||||
cmd "silent! command PackerUpdate lua require 'plugins' require('packer').update()"
|
||||
end
|
||||
|
||||
non_config_mappings()
|
||||
optional_mappings()
|
||||
required_mappings()
|
||||
hooks.run("setup_mappings", map)
|
||||
end
|
||||
|
||||
-- below are all plugin related mappings
|
||||
|
||||
M.bufferline = function()
|
||||
local m = plugin_maps.bufferline
|
||||
|
||||
map("n", m.next_buffer, ":BufferLineCycleNext <CR>")
|
||||
map("n", m.prev_buffer, ":BufferLineCyclePrev <CR>")
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
local m = plugin_maps.comment.toggle
|
||||
map("n", m, ":CommentToggle <CR>")
|
||||
map("v", m, ":CommentToggle <CR>")
|
||||
end
|
||||
|
||||
M.dashboard = function()
|
||||
local m = plugin_maps.dashboard
|
||||
|
||||
map("n", m.find_files, ":Telescope find_files find_command=rg,--hidden,--files <CR>")
|
||||
map("n", m.browser, ":Telescope file_browser <CR>")
|
||||
map("n", m.find_word, ":Telescope live_grep <CR>")
|
||||
map("n", m.new_file, ":DashboardNewFile <CR>")
|
||||
map("n", m.open, ":Dashboard <CR>")
|
||||
map("n", m.session_load, ":SessionLoad <CR>")
|
||||
map("n", m.session_save, ":SessionSave <CR>")
|
||||
end
|
||||
|
||||
M.nvimtree = function()
|
||||
map("n", plugin_maps.nvimtree.toggle, ":NvimTreeToggle <CR>")
|
||||
map("n", plugin_maps.nvimtree.focus, ":NvimTreeFocus <CR>")
|
||||
end
|
||||
|
||||
M.telescope = function()
|
||||
local m = plugin_maps.telescope
|
||||
|
||||
map("n", m.buffers, ":Telescope buffers <CR>")
|
||||
map("n", m.find_files, ":Telescope find_files <CR>")
|
||||
map("n", m.find_hiddenfiles, ":Telescope find_files hidden=true <CR>")
|
||||
map("n", m.git_commits, ":Telescope git_commits <CR>")
|
||||
map("n", m.git_status, ":Telescope git_status <CR>")
|
||||
map("n", m.help_tags, ":Telescope help_tags <CR>")
|
||||
map("n", m.live_grep, ":Telescope live_grep <CR>")
|
||||
map("n", m.oldfiles, ":Telescope oldfiles <CR>")
|
||||
map("n", m.themes, ":Telescope themes <CR>")
|
||||
end
|
||||
|
||||
M.telescope_media = function()
|
||||
local m = plugin_maps.telescope.telescope_media
|
||||
|
||||
map("n", m.media_files, ":Telescope media_files <CR>")
|
||||
end
|
||||
|
||||
return M
|
@ -1,77 +0,0 @@
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
-- export user config as a global varibale
|
||||
g.neovim_user_config = "nvimrc"
|
||||
|
||||
local options = require("core.utils").load_config().options
|
||||
|
||||
opt.title = true
|
||||
opt.clipboard = options.clipboard
|
||||
opt.cmdheight = options.cmdheight
|
||||
opt.cul = true -- cursor line
|
||||
|
||||
-- Indentline
|
||||
opt.expandtab = options.expandtab
|
||||
opt.shiftwidth = options.shiftwidth
|
||||
opt.smartindent = options.smartindent
|
||||
|
||||
-- disable tilde on end of buffer: https://github.com/neovim/neovim/pull/8546#issuecomment-643643758
|
||||
opt.fillchars = { eob = " " }
|
||||
|
||||
opt.hidden = options.hidden
|
||||
opt.ignorecase = options.ignorecase
|
||||
opt.smartcase = options.smartcase
|
||||
opt.mouse = options.mouse
|
||||
|
||||
-- Numbers
|
||||
opt.number = options.number
|
||||
opt.numberwidth = options.numberwidth
|
||||
opt.relativenumber = options.relativenumber
|
||||
opt.ruler = options.ruler
|
||||
|
||||
-- disable nvim intro
|
||||
opt.shortmess:append "sI"
|
||||
|
||||
opt.signcolumn = "yes"
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.tabstop = options.tabstop
|
||||
opt.termguicolors = true
|
||||
opt.timeoutlen = options.timeoutlen
|
||||
opt.undofile = options.undofile
|
||||
|
||||
-- interval for writing swap file to disk, also used by gitsigns
|
||||
opt.updatetime = options.updatetime
|
||||
|
||||
-- go to previous/next line with h,l,left arrow and right arrow
|
||||
-- when cursor reaches end/beginning of line
|
||||
opt.whichwrap:append "<>[]hl"
|
||||
|
||||
g.mapleader = options.mapleader
|
||||
|
||||
-- disable some builtin vim plugins
|
||||
local disabled_built_ins = {
|
||||
"2html_plugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
@ -1,44 +0,0 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- Path - nvim/lua/core/system.lua
|
||||
-- GitHub - https://github.com/The-Repo-Club/
|
||||
-- Author - The-Repo-Club [wayne6324@gmail.com]
|
||||
-- Start On - Fri 05 Nov 00:16:08 GMT 2021
|
||||
-- Modified On - Fri 05 Nov 00:16:08 GMT 2021
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local M = {}
|
||||
|
||||
-- get_config_dir will get the config path based in the current system, e.g.
|
||||
-- 'C:\Users\JohnDoe\AppData\Local' for windows and '~/.config' for *nix
|
||||
-- @return string
|
||||
local function get_config_dir()
|
||||
if string.find(vim.loop.os_uname().sysname, "Windows") then
|
||||
return os.getenv("USERPROFILE") .. "\\AppData\\Local\\"
|
||||
end
|
||||
|
||||
return (os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME"))
|
||||
or (os.getenv("HOME") .. "/.config")
|
||||
end
|
||||
|
||||
-- get_separator will return the system paths separator, e.g. \ for Windows and / for *nix
|
||||
-- @return string
|
||||
local function get_separator()
|
||||
if vim.loop.os_uname().sysname == "Windows" then
|
||||
return "\\"
|
||||
end
|
||||
|
||||
return "/"
|
||||
end
|
||||
|
||||
M.config_dir = get_config_dir()
|
||||
|
||||
M.sep = get_separator()
|
||||
|
||||
-- The nvim root directory, works as a fallback for looking nvim configurations
|
||||
-- in case that nvim_configs_root directory does not exists.
|
||||
M.nvim_root = string.format("%s%snvim", M.config_dir, M.sep)
|
||||
-- The nvim configurations root directory
|
||||
M.nvim_default_root = string.format("%s%snvim%slua%splugins", M.config_dir, M.sep, M.sep, M.sep)
|
||||
M.nvim_configs_root = string.format("%s%snvim%slua%scustom", M.config_dir, M.sep, M.sep, M.sep)
|
||||
|
||||
return M
|
@ -1,311 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.close_buffer = function(bufexpr, force)
|
||||
-- This is a modification of a NeoVim plugin from
|
||||
-- Author: ojroques - Olivier Roques
|
||||
-- Src: https://github.com/ojroques/nvim-bufdel
|
||||
-- (Author has okayed copy-paste)
|
||||
|
||||
-- Options
|
||||
local opts = {
|
||||
next = "cycle", -- how to retrieve the next buffer
|
||||
quit = false, -- exit when last buffer is deleted
|
||||
--TODO make this a nvimrc flag/option
|
||||
}
|
||||
|
||||
-- ----------------
|
||||
-- Helper functions
|
||||
-- ----------------
|
||||
|
||||
-- Switch to buffer 'buf' on each window from list 'windows'
|
||||
local function switch_buffer(windows, buf)
|
||||
local cur_win = vim.fn.winnr()
|
||||
for _, winid in ipairs(windows) do
|
||||
vim.cmd(string.format("%d wincmd w", vim.fn.win_id2win(winid)))
|
||||
vim.cmd(string.format("buffer %d", buf))
|
||||
end
|
||||
vim.cmd(string.format("%d wincmd w", cur_win)) -- return to original window
|
||||
end
|
||||
|
||||
-- Select the first buffer with a number greater than given buffer
|
||||
local function get_next_buf(buf)
|
||||
local next = vim.fn.bufnr "#"
|
||||
if opts.next == "alternate" and vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
for i = 0, vim.fn.bufnr "$" - 1 do
|
||||
next = (buf + i) % vim.fn.bufnr "$" + 1 -- will loop back to 1
|
||||
if vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ----------------
|
||||
-- End helper functions
|
||||
-- ----------------
|
||||
|
||||
local buf = vim.fn.bufnr()
|
||||
if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid
|
||||
vim.cmd "close"
|
||||
return
|
||||
end
|
||||
|
||||
if #vim.fn.getbufinfo { buflisted = 1 } < 2 then
|
||||
if opts.quit then
|
||||
-- exit when there is only one buffer left
|
||||
if force then
|
||||
vim.cmd "qall!"
|
||||
else
|
||||
vim.cmd "confirm qall"
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
if chad_term then
|
||||
-- Must be a window type
|
||||
vim.cmd(string.format("setlocal nobl", buf))
|
||||
vim.cmd "enew"
|
||||
return
|
||||
end
|
||||
-- don't exit and create a new empty buffer
|
||||
vim.cmd "enew"
|
||||
vim.cmd "bp"
|
||||
end
|
||||
|
||||
local next_buf = get_next_buf(buf)
|
||||
local windows = vim.fn.getbufinfo(buf)[1].windows
|
||||
|
||||
-- force deletion of terminal buffers to avoid the prompt
|
||||
if force or vim.fn.getbufvar(buf, "&buftype") == "terminal" then
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
-- TODO this scope is error prone, make resilient
|
||||
if chad_term then
|
||||
if type == "wind" then
|
||||
-- hide from bufferline
|
||||
vim.cmd(string.format("%d bufdo setlocal nobl", buf))
|
||||
-- swtich to another buff
|
||||
-- TODO switch to next bufffer, this works too
|
||||
vim.cmd "BufferLineCycleNext"
|
||||
else
|
||||
local cur_win = vim.fn.winnr()
|
||||
-- we can close this window
|
||||
vim.cmd(string.format("%d wincmd c", cur_win))
|
||||
return
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("bd! %d", buf))
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("silent! confirm bd %d", buf))
|
||||
end
|
||||
-- revert buffer switches if user has canceled deletion
|
||||
if vim.fn.buflisted(buf) == 1 then
|
||||
switch_buffer(windows, buf)
|
||||
end
|
||||
end
|
||||
|
||||
-- load config
|
||||
-- 1st arg = boolean - whether to force reload
|
||||
-- Modifies _G._NEOVIM_CONFIG global variable
|
||||
M.load_config = function(reload)
|
||||
-- only do the stuff below one time, otherwise just return the set config
|
||||
if _G._NEOVIM_CONFIG_CONTENTS ~= nil and not (reload or false) then
|
||||
return _G._NEOVIM_CONFIG_CONTENTS
|
||||
end
|
||||
|
||||
-- these are the table value which will be always prioritiezed to take user config value
|
||||
local to_replace = {
|
||||
"['mappings']['plugins']['esc_insertmode']",
|
||||
"['mappings']['terminal']['esc_termmode']",
|
||||
"['mappings']['terminal']['esc_hide_termmode']",
|
||||
}
|
||||
|
||||
local default_config = "core.default_config"
|
||||
local config_name = vim.g.neovim_user_config or "nvimrc"
|
||||
local config_file = vim.fn.stdpath "config" .. "/lua/custom/" .. config_name .. ".lua"
|
||||
|
||||
-- unload the modules if force reload
|
||||
if reload then
|
||||
package.loaded[default_config or false] = nil
|
||||
package.loaded[config_name or false] = nil
|
||||
end
|
||||
|
||||
-- don't enclose in pcall, it better break when default config is faulty
|
||||
_G._NEOVIM_CONFIG_CONTENTS = require(default_config)
|
||||
|
||||
-- user config is not required to run neovim but a optional
|
||||
-- Make sure the config doesn't break the whole system if user config is not present or in bad state or not a table
|
||||
-- print warning texts if user config file is present
|
||||
-- check if the user config is present
|
||||
if vim.fn.filereadable(vim.fn.glob(config_file)) == 1 then
|
||||
local present, config = pcall(require, "custom/" .. config_name)
|
||||
if present then
|
||||
-- make sure the returned value is table
|
||||
if type(config) == "table" then
|
||||
-- data = require(config_name)
|
||||
_G._NEOVIM_CONFIG_CONTENTS = require("core.utils").merge_table(
|
||||
_G._NEOVIM_CONFIG_CONTENTS,
|
||||
config,
|
||||
to_replace
|
||||
)
|
||||
else
|
||||
print("Warning: " .. config_name .. " sourced successfully but did not return a lua table.")
|
||||
end
|
||||
else
|
||||
print("Warning: " .. config_file .. " is present but sourcing failed.")
|
||||
end
|
||||
end
|
||||
return _G._NEOVIM_CONFIG_CONTENTS
|
||||
end
|
||||
|
||||
M.map = function(mode, keys, cmd, opt)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opt then
|
||||
options = vim.tbl_extend("force", options, opt)
|
||||
end
|
||||
|
||||
-- all valid modes allowed for mappings
|
||||
-- :h map-modes
|
||||
local valid_modes = {
|
||||
[""] = true,
|
||||
["n"] = true,
|
||||
["v"] = true,
|
||||
["s"] = true,
|
||||
["x"] = true,
|
||||
["o"] = true,
|
||||
["!"] = true,
|
||||
["i"] = true,
|
||||
["l"] = true,
|
||||
["c"] = true,
|
||||
["t"] = true,
|
||||
}
|
||||
|
||||
-- helper function for M.map
|
||||
-- can gives multiple modes and keys
|
||||
local function map_wrapper(mode, lhs, rhs, options)
|
||||
if type(lhs) == "table" then
|
||||
for _, key in ipairs(lhs) do
|
||||
map_wrapper(mode, key, rhs, options)
|
||||
end
|
||||
else
|
||||
if type(mode) == "table" then
|
||||
for _, m in ipairs(mode) do
|
||||
map_wrapper(m, lhs, rhs, options)
|
||||
end
|
||||
else
|
||||
if valid_modes[mode] and lhs and rhs then
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
else
|
||||
mode, lhs, rhs = mode or "", lhs or "", rhs or ""
|
||||
print("Cannot set mapping [ mode = '" .. mode .. "' | key = '" .. lhs .. "' | cmd = '" .. rhs .. "' ]")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
map_wrapper(mode, keys, cmd, options)
|
||||
end
|
||||
|
||||
-- Base code: https://gist.github.com/revolucas/184aec7998a6be5d2f61b984fac1d7f7
|
||||
-- Changes over it: preserving table 1 contents and also update with table b, without duplicating
|
||||
-- 1st arg - base table
|
||||
-- 2nd arg - table to merge
|
||||
-- 3rg arg - list of nodes as a table, if the node is found replace the from table2 to result, rather than adding the value
|
||||
-- e.g: merge_table(t1, t2, { ['mappings']['plugins']['bufferline'] })
|
||||
M.merge_table = function(into, from, nodes_to_replace)
|
||||
-- make sure both are table
|
||||
if type(into) ~= "table" or type(from) ~= "table" then
|
||||
return into
|
||||
end
|
||||
|
||||
local stack, seen = {}, {}
|
||||
local table1, table2 = into, from
|
||||
|
||||
if type(nodes_to_replace) == "table" then
|
||||
-- function that will be executed with loadstring
|
||||
local replace_fn = function(node)
|
||||
local base_fn = [[
|
||||
return function(table1, table2)
|
||||
local t1, t2 = table1_node or false , table2_node or false
|
||||
if t1 and t2 then
|
||||
table1_node = table2_node
|
||||
end
|
||||
return table1
|
||||
end]]
|
||||
|
||||
-- replace the _node in base_fn to actual given node value
|
||||
local fn = base_fn:gsub("_node", node)
|
||||
-- return the function created from the string base_fn
|
||||
return loadstring(fn)()(table1, table2)
|
||||
end
|
||||
|
||||
for _, node in ipairs(nodes_to_replace) do
|
||||
-- pcall() is a poor workaround for if "['mappings']['plugins']['esc_insertmode']" 'plugins' sub-table does not exist
|
||||
local ok, result = pcall(replace_fn, node)
|
||||
if ok then
|
||||
-- if the node is found then replace
|
||||
table1 = result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
while true do
|
||||
for k, v in pairs(table2) do
|
||||
if type(v) == "table" and type(table1[k]) == "table" then
|
||||
table.insert(stack, { table1[k], table2[k] })
|
||||
else
|
||||
local present = seen[v] or false
|
||||
if not present then
|
||||
if type(k) == "number" then
|
||||
-- add the value to seen table until value is found
|
||||
-- only do when key is number we just want to append to subtables
|
||||
-- todo: maybe improve this
|
||||
|
||||
for _, value in pairs(table1) do
|
||||
if value == v then
|
||||
present = true
|
||||
break
|
||||
end
|
||||
end
|
||||
seen[v] = true
|
||||
if not present then
|
||||
table1[#table1 + 1] = v
|
||||
end
|
||||
else
|
||||
table1[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #stack > 0 then
|
||||
local t = stack[#stack]
|
||||
table1, table2 = t[1], t[2]
|
||||
stack[#stack] = nil
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
return into
|
||||
end
|
||||
|
||||
-- load plugin after entering vim ui
|
||||
M.packer_lazy_load = function(plugin, timer)
|
||||
if plugin then
|
||||
timer = timer or 0
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader(plugin)
|
||||
end, timer)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -1,162 +0,0 @@
|
||||
-- Dracual config for lualine
|
||||
-- Author: Wayne Wesley
|
||||
-- Credit: TheRepoClub
|
||||
local lualine = require 'lualine'
|
||||
|
||||
-- Color table for highlights
|
||||
local colors = {
|
||||
bg = '#283036',
|
||||
fg = '#e5e9f0',
|
||||
yellow = '#ffff59',
|
||||
cyan = '#59fff9',
|
||||
darkblue = '#081633',
|
||||
green = '#59ff59',
|
||||
orange = '#ff9c59',
|
||||
violet = '#9059ff',
|
||||
magenta = '#ff59f9',
|
||||
blue = '#51afef',
|
||||
red = '#ff5959'
|
||||
}
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function() return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 end,
|
||||
hide_in_width = function() return vim.fn.winwidth(0) > 80 end,
|
||||
check_git_workspace = function()
|
||||
local filepath = vim.fn.expand('%:p:h')
|
||||
local gitdir = vim.fn.finddir('.git', filepath .. ';')
|
||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
end
|
||||
}
|
||||
|
||||
-- Config
|
||||
local config = {
|
||||
options = {
|
||||
-- Disable sections and component separators
|
||||
icons_enabled = true,
|
||||
theme = 'dracula',
|
||||
section_separators = {'', ''},
|
||||
component_separators = {'', ''},
|
||||
disabled_filetypes = {}
|
||||
},
|
||||
sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'bo:filetype'},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
-- These will be filled later
|
||||
lualine_c = {},
|
||||
lualine_x = {}
|
||||
},
|
||||
inactive_sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {},
|
||||
lualine_v = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {}
|
||||
},
|
||||
tabline = {},
|
||||
}
|
||||
|
||||
-- Inserts a component in lualine_c at left section
|
||||
local function ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
end
|
||||
|
||||
-- Inserts a component in lualine_x ot right section
|
||||
local function ins_right(component)
|
||||
table.insert(config.sections.lualine_x, component)
|
||||
end
|
||||
|
||||
ins_left {
|
||||
function() return '▊' end,
|
||||
color = {fg = colors.blue}, -- Sets highlighting of component
|
||||
left_padding = 0 -- We don't need space before this
|
||||
}
|
||||
|
||||
ins_left {
|
||||
-- filesize component
|
||||
function()
|
||||
local function format_file_size(file)
|
||||
local size = vim.fn.getfsize(file)
|
||||
if size <= 0 then return '' end
|
||||
local sufixes = {'b', 'k', 'm', 'g'}
|
||||
local i = 1
|
||||
while size > 1024 do
|
||||
size = size / 1024
|
||||
i = i + 1
|
||||
end
|
||||
return string.format('%.1f%s', size, sufixes[i])
|
||||
end
|
||||
local file = vim.fn.expand('%:p')
|
||||
if string.len(file) == 0 then return '' end
|
||||
return format_file_size(file)
|
||||
end,
|
||||
condition = conditions.buffer_not_empty
|
||||
}
|
||||
|
||||
ins_left {
|
||||
'filename',
|
||||
condition = conditions.buffer_not_empty,
|
||||
color = {fg = colors.magenta, gui = 'bold'}
|
||||
}
|
||||
|
||||
ins_left {'location'}
|
||||
|
||||
ins_left {'progress', color = {fg = colors.fg, gui = 'bold'}}
|
||||
|
||||
ins_left {
|
||||
'diagnostics',
|
||||
sources = {'nvim_diagnostic'},
|
||||
symbols = {error = ' ', warn = ' ', info = ' '},
|
||||
color_error = colors.red,
|
||||
color_warn = colors.yellow,
|
||||
color_info = colors.cyan
|
||||
}
|
||||
|
||||
-- Insert mid section. You can make any number of sections in neovim :)
|
||||
-- for lualine it's any number greater then 2
|
||||
ins_left {function() return '%=' end}
|
||||
|
||||
-- Add components to right sections
|
||||
ins_right {
|
||||
'o:encoding', -- option component same as &encoding in viml
|
||||
upper = true, -- I'm not sure why it's upper case either ;)
|
||||
condition = conditions.hide_in_width,
|
||||
color = {fg = colors.green, gui = 'bold'}
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'fileformat',
|
||||
upper = true,
|
||||
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
|
||||
color = {fg = colors.green, gui = 'bold'}
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'branch',
|
||||
icon = '',
|
||||
condition = conditions.check_git_workspace,
|
||||
color = {fg = colors.violet, gui = 'bold'}
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'diff',
|
||||
-- Is it me or the symbol for modified us really weird
|
||||
symbols = {added = ' ', modified = ' ', removed = ' '},
|
||||
color_added = colors.green,
|
||||
color_modified = colors.orange,
|
||||
color_removed = colors.red,
|
||||
condition = conditions.hide_in_width
|
||||
}
|
||||
|
||||
ins_right {
|
||||
function() return '▊' end,
|
||||
color = {fg = colors.blue},
|
||||
right_padding = 0
|
||||
}
|
||||
|
||||
-- Now don't forget to initialize lualine
|
||||
lualine.setup(config)
|
@ -1,112 +0,0 @@
|
||||
local g = vim.g
|
||||
local fn = vim.fn
|
||||
|
||||
g.webdevicons_enable_startify = 1
|
||||
g.startify_enable_special = 0
|
||||
g.startify_update_oldfiles = 1
|
||||
g.startify_files_number = 30
|
||||
g.startify_session_autoload = 1
|
||||
g.startify_session_persistence = 1
|
||||
g.startify_session_dir = '~/.config/nvim/session'
|
||||
g.startify_session_delete_buffers = 1
|
||||
g.startify_change_to_vcs_root = 1
|
||||
g.startify_fortune_use_unicode = 1
|
||||
g.startify_session_persistence = 1
|
||||
g.startify_relative_path = 1
|
||||
g.startify_change_to_dir = 1
|
||||
|
||||
g.startify_custom_header = {
|
||||
" ██ ",
|
||||
" ░░ ",
|
||||
" ███████ █████ ██████ ██ ██ ██ ██████████ ",
|
||||
" ░░██░░░██ ██░░░██ ██░░░░██░██ ░██░██░░██░░██░░██ ",
|
||||
" ░██ ░██░███████░██ ░██░░██ ░██ ░██ ░██ ░██ ░██ ",
|
||||
" ░██ ░██░██░░░░ ░██ ░██ ░░████ ░██ ░██ ░██ ░██ ",
|
||||
" ███ ░██░░██████░░██████ ░░██ ░██ ███ ░██ ░██ ",
|
||||
" ░░░ ░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░░ ░░ ░░ ",
|
||||
" ",
|
||||
" [ Think NeoVim Author:The-Repo-Club ] ",
|
||||
}
|
||||
|
||||
g.startify_custom_footer = {
|
||||
" +-----------------------------------------------+",
|
||||
" | Think NeoVim ^_^ |",
|
||||
" | Talk is cheap Show me the code |",
|
||||
" | |",
|
||||
" | Github:The-Repo-Club |",
|
||||
" +-----------------------------------------------+",
|
||||
}
|
||||
|
||||
local function lsCustomPluginSettingsDir()
|
||||
local settings_dir = "~/.config/nvim/lua/custom/configs/"
|
||||
local files = fn.systemlist("find -L ".. settings_dir .." -maxdepth 1 -type f | LC_ALL=C sort | rev | cut -d'/' -f-1 | rev")
|
||||
local lst = {}
|
||||
for key, file in pairs(files) do
|
||||
lst[key] = { line = file, path = (settings_dir..""..file) }
|
||||
end
|
||||
return lst
|
||||
end
|
||||
|
||||
local function lsDefaultPluginSettingsDir()
|
||||
local settings_dir = "~/.config/nvim/lua/plugins/configs/"
|
||||
local files = fn.systemlist("find -L ".. settings_dir .." -maxdepth 1 -type f | LC_ALL=C sort | rev | cut -d'/' -f-1 | rev")
|
||||
local lst = {}
|
||||
for key, file in pairs(files) do
|
||||
lst[key] = { line = file, path = (settings_dir..""..file) }
|
||||
end
|
||||
return lst
|
||||
end
|
||||
|
||||
local function lsCustomSettingsDir()
|
||||
local settings_dir = "~/.config/nvim/lua/custom/"
|
||||
local files = fn.systemlist("find -L ".. settings_dir .." -maxdepth 1 -type f | LC_ALL=C sort | rev | cut -d'/' -f-1 | rev")
|
||||
local lst = {}
|
||||
for key, file in pairs(files) do
|
||||
lst[key] = { line = file, path = (settings_dir..""..file) }
|
||||
end
|
||||
return lst
|
||||
end
|
||||
|
||||
local function lsDefaultSettingsDir()
|
||||
local settings_dir = "~/.config/nvim/lua/plugins/"
|
||||
local files = fn.systemlist("find -L ".. settings_dir .." -maxdepth 1 -type f | LC_ALL=C sort | rev | cut -d'/' -f-1 | rev")
|
||||
local lst = {}
|
||||
for key, file in pairs(files) do
|
||||
lst[key] = { line = file, path = (settings_dir..""..file) }
|
||||
end
|
||||
return lst
|
||||
end
|
||||
|
||||
local function lsGitDir()
|
||||
local files = fn.systemlist('getfolders -a /mnt/500GB/.gitlabs/')
|
||||
return fn.map(files, "{'line': v:val, 'path': v:val}")
|
||||
end
|
||||
|
||||
local function lsAurDir()
|
||||
local files = fn.systemlist('getfolders -a /mnt/500GB/.aur/')
|
||||
return fn.map(files, "{'line': v:val, 'path': v:val}")
|
||||
end
|
||||
|
||||
local function lsPwd()
|
||||
local files = fn.systemlist('find -L . -maxdepth 1 -type f -printf "%p\n" | LC_ALL=C sort')
|
||||
return fn.map(files, "{'line': v:val, 'path': v:val}")
|
||||
end
|
||||
|
||||
g.startify_lists = {
|
||||
{ type = 'sessions', header = {' Recent Sessions'}},
|
||||
{ type = 'bookmarks', header = {' Bookmarked files'}},
|
||||
{ type = lsPwd, header = {' Current Directory: '}},
|
||||
{ type = lsGitDir, header = {' Git projects'}},
|
||||
{ type = lsAurDir, header = {' AUR projects'}},
|
||||
{ type = lsCustomPluginSettingsDir, header = {' Custom Plugin Settings: '}},
|
||||
{ type = lsDefaultPluginSettingsDir, header = {' Default Plugin Settings: '}},
|
||||
{ type = lsCustomSettingsDir, header = {' Custom Settings: '}},
|
||||
{ type = lsDefaultSettingsDir, header = {' Default Settings: '}},
|
||||
{ type = 'files', header = {' Recent files'}},
|
||||
}
|
||||
|
||||
g.startify_bookmarks = {
|
||||
-- { D = '~/documents/' },
|
||||
-- { d = '~/downloads/' },
|
||||
-- { c = '~/.config/' },
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
require("which-key").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
-- This is where your custom modules and plugins go.
|
||||
-- See the wiki for a guide on how to extend NeoVim
|
||||
|
||||
local hooks = require "core.hooks"
|
||||
local status = require("core.utils").load_config().plugins.status
|
||||
|
||||
hooks.add("setup_mappings", function(map)
|
||||
map("n", "<C-f>", "za <CR>")
|
||||
map("n", "<leader>oc", '<cmd> lua require("core.functions").edit_config() <CR>')
|
||||
end)
|
||||
|
||||
-- NOTE: To use this, make a copy with `cp example_init.lua init.lua`
|
||||
|
||||
hooks.add("install_plugins", function(use)
|
||||
use {
|
||||
"wakatime/vim-wakatime"
|
||||
}
|
||||
|
||||
use {
|
||||
"gko/vim-coloresque"
|
||||
}
|
||||
|
||||
use {
|
||||
"liuchengxu/vim-clap"
|
||||
}
|
||||
|
||||
use {
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("custom.configs.which-key")
|
||||
end
|
||||
}
|
||||
use {
|
||||
"cappyzawa/trim.nvim",
|
||||
config = function()
|
||||
require("custom.configs.trim")
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
disable = not status.bufferline,
|
||||
config = function()
|
||||
require("custom.configs.lualine")
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"Minimal-Mistakes/vim",
|
||||
}
|
||||
use {
|
||||
"ap/vim-css-color",
|
||||
}
|
||||
use {
|
||||
"jremmen/vim-ripgrep",
|
||||
}
|
||||
use {
|
||||
"tpope/vim-fugitive",
|
||||
}
|
||||
use {
|
||||
"airblade/vim-gitgutter",
|
||||
}
|
||||
use {
|
||||
"leafgarland/typescript-vim",
|
||||
}
|
||||
use {
|
||||
"vim-utils/vim-man",
|
||||
}
|
||||
use {
|
||||
"lyuts/vim-rtags",
|
||||
}
|
||||
use {
|
||||
"mbbill/undotree",
|
||||
}
|
||||
use {
|
||||
"ctrlpvim/ctrlp.vim",
|
||||
}
|
||||
use {
|
||||
"mhinz/vim-startify",
|
||||
disable = not status.startify,
|
||||
config = function()
|
||||
require("custom.configs.startify")
|
||||
end
|
||||
}
|
||||
use {
|
||||
"mboughaba/i3config.vim",
|
||||
}
|
||||
use {
|
||||
"The-Repo-Club/Vim_Headers"
|
||||
}
|
||||
use {
|
||||
"The-Repo-Club/Vim_Keys"
|
||||
}
|
||||
use{
|
||||
"Thyrum/vim-stabs"
|
||||
}
|
||||
end)
|
@ -1,74 +0,0 @@
|
||||
local M = {}
|
||||
M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
|
||||
|
||||
-- NOTE: To use this, make a copy with `cp example_nvimrc.lua nvimrc.lua`
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
-- To use this file, copy the structure of `core/default_config.lua`,
|
||||
-- examples of setting relative number & changing theme:
|
||||
|
||||
M.options = {
|
||||
mousdde = "a",
|
||||
encoding = "UTF-8",
|
||||
relativenumber = true,
|
||||
number = true,
|
||||
linebreak = true,
|
||||
showbreak = "+++",
|
||||
textwidth = 0,
|
||||
showmatch = true,
|
||||
visualbell = true,
|
||||
|
||||
smartcase = true,
|
||||
gdefault = true,
|
||||
ignorecase = true,
|
||||
nohlsearch = true,
|
||||
nohlsearch = true,
|
||||
|
||||
autoindent = true,
|
||||
cindent = true,
|
||||
noexpandtab = true,
|
||||
copyindent = true,
|
||||
preserveindent = true,
|
||||
expandtab = false,
|
||||
smartindent = false,
|
||||
smarttab = false,
|
||||
shiftwidth = 4,
|
||||
tabstop = 4,
|
||||
softtabstop = 4,
|
||||
-- Advance
|
||||
|
||||
confirm = true,
|
||||
ruler = true,
|
||||
noshowmode = true,
|
||||
noruler = true,
|
||||
noshowcmd = true,
|
||||
cmdheight=1,
|
||||
nowrap = true,
|
||||
hidden = true,
|
||||
noswapfile = true,
|
||||
nobackup = true,
|
||||
undodir = "~/.config/nvim/undodir",
|
||||
undofile = true,
|
||||
scrolloff = 8,
|
||||
signcolumn = true,
|
||||
undolevels = 1000,
|
||||
backspace = {
|
||||
"indent",
|
||||
"eol",
|
||||
"start",
|
||||
},
|
||||
|
||||
nocompatible = true,
|
||||
termguicolors = true,
|
||||
background = "dark",
|
||||
|
||||
}
|
||||
|
||||
M.plugins = {
|
||||
options = {
|
||||
open_command = false,
|
||||
}
|
||||
}
|
||||
|
||||
return M
|
@ -1,49 +0,0 @@
|
||||
local colors = require('dracula').colors()
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
local present, bufferline = pcall(require, "bufferline")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
numbers = "both",
|
||||
offsets = { { filetype = "NvimTree", text = "File Explorer", padding = 1 } },
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
show_close_icon = true,
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 14,
|
||||
max_prefix_length = 13,
|
||||
tab_size = 20,
|
||||
show_tab_indicators = true,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
show_buffer_icons = true,
|
||||
separator_style = "thin",
|
||||
always_show_bufferline = true,
|
||||
diagnostics = false, -- "or nvim_lsp"
|
||||
custom_filter = function(buf_number)
|
||||
-- Func to filter out our managed/persistent split terms
|
||||
local present_type, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf_number, "term_type")
|
||||
end)
|
||||
|
||||
if present_type then
|
||||
if type == "vert" then
|
||||
return false
|
||||
elseif type == "hori" then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
local present, cmp = pcall(require, "cmp")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
vim.opt.completeopt = "menuone,noselect"
|
||||
|
||||
-- nvim-cmp setup
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- load lspkind icons
|
||||
vim_item.kind = string.format(
|
||||
"%s %s",
|
||||
require("plugins.configs.lspkind_icons").icons[vim_item.kind],
|
||||
vim_item.kind
|
||||
)
|
||||
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
buffer = "[BUF]",
|
||||
})[entry.source.name]
|
||||
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<CR>"] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
["<Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require("luasnip").expand_or_jumpable() then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<S-Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = 'orgmode' },
|
||||
{ name = "buffer" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
},
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
local home = os.getenv('HOME')
|
||||
local db = require('dashboard')
|
||||
|
||||
db.session_directory = "~/.config/nvim/session"
|
||||
|
||||
-- linux
|
||||
db.hide_statusline = 1
|
||||
db.hide_tabline = 0
|
||||
|
||||
db.custom_header = {
|
||||
" ",
|
||||
"================= =============== =============== ======== ========",
|
||||
"\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //",
|
||||
"||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||",
|
||||
"|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||",
|
||||
"||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||",
|
||||
"|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||",
|
||||
"||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||",
|
||||
"|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||",
|
||||
"||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||",
|
||||
"|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||",
|
||||
"|| `' || || `' || || `' || || | \\ / | ||",
|
||||
"|| .===' `===. .==='.`===. .===' /==. | \\/ | ||",
|
||||
"|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||",
|
||||
"|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||",
|
||||
"|| .==' _-' `-__\\._-' `-_./__-' `' |. /| | ||",
|
||||
"||.==' _-' `' | /==.||",
|
||||
"==' _-' \\/ `==",
|
||||
"\\ _-' `-_ /",
|
||||
" `'' [ Think NeoVim Author:The-Repo-Club ] ``' ",
|
||||
" "
|
||||
}
|
||||
|
||||
db.custom_center = {
|
||||
{
|
||||
icon = ' ',
|
||||
desc = 'Find File ',
|
||||
shortcut = 'SPC d f f'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'File Browser ',
|
||||
shortcut = 'SPC d f b'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Find Word ',
|
||||
shortcut = 'SPC d f w'
|
||||
}, {
|
||||
icon = '洛 ',
|
||||
desc = 'File New ',
|
||||
shortcut = 'SPC d f n'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Load Last Session ',
|
||||
shortcut = 'SPC d l '
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Save Session ',
|
||||
shortcut = 'SPC d s '
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Open Private Configuration ',
|
||||
action = 'lua require("core.functions").edit_config()',
|
||||
shortcut = 'SPC o c '
|
||||
}
|
||||
}
|
||||
|
||||
db.custom_footer = {
|
||||
" ",
|
||||
" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ",
|
||||
" ┃ ╔═══════════════════════════════════════╗ ┃ ",
|
||||
" ┃ ║ Think NeoVim ^_^ ║ ┃ ",
|
||||
" ┃ ║ ║ ┃ ",
|
||||
" ┃ ║ Talk is cheap Show us the code. ║ ┃ ",
|
||||
" ┃ ║ ║ ┃ ",
|
||||
" ┃ ║ Github:The-Repo-Club ║ ┃ ",
|
||||
" ┃ ╚═══════════════════════════════════════╝ ┃ ",
|
||||
" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ",
|
||||
" "
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
local present, gitsigns = pcall(require, "gitsigns")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
buffer = true,
|
||||
noremap = true,
|
||||
["n ]c"] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'" },
|
||||
["n [c"] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'" },
|
||||
["n <leader>hs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||
["n <leader>hu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||
["n <leader>hr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||
["n <leader>hp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
||||
},
|
||||
numhl = false,
|
||||
|
||||
sign_priority = 5,
|
||||
signs = {
|
||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||
changedelete = { hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr" },
|
||||
delete = { hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
||||
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||
},
|
||||
|
||||
status_formatter = nil, -- Use default
|
||||
watch_gitdir = {
|
||||
interval = 100,
|
||||
},
|
||||
}
|
@ -1,146 +0,0 @@
|
||||
local present, icons = pcall(require, "nvim-web-devicons")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local colors = require('dracula').colors()
|
||||
|
||||
icons.setup {
|
||||
override = {
|
||||
c = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "c",
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "css",
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "deb",
|
||||
},
|
||||
Dockerfile = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "Dockerfile",
|
||||
},
|
||||
html = {
|
||||
icon = "",
|
||||
color = colors.baby_pink,
|
||||
name = "html",
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpeg",
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpg",
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "js",
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "kt",
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
color = colors.red,
|
||||
name = "lock",
|
||||
},
|
||||
lua = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "lua",
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp3",
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp4",
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "out",
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "png",
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "py",
|
||||
},
|
||||
["robots.txt"] = {
|
||||
icon = "ﮧ",
|
||||
color = colors.red,
|
||||
name = "robots",
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "toml",
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
color = colors.teal,
|
||||
name = "ts",
|
||||
},
|
||||
ttf = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "TrueTypeFont",
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
color = colors.pink,
|
||||
name = "rb",
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "rpm",
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
color = colors.vibrant_green,
|
||||
name = "vue",
|
||||
},
|
||||
woff = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "WebOpenFontFormat",
|
||||
},
|
||||
woff2 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "WebOpenFontFormat2",
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "xz",
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "zip",
|
||||
},
|
||||
},
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
local overrides = require("core.hooks").createOverrides "lsp"
|
||||
|
||||
local function on_attach(_, bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
buf_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "gk", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||
buf_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "ge", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>fm", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
buf_set_keymap("v", "<space>ca", "<cmd>lua vim.lsp.buf.range_code_action()<CR>", opts)
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.documentationFormat = { "markdown", "plaintext" }
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities.textDocument.completion.completionItem.preselectSupport = true
|
||||
capabilities.textDocument.completion.completionItem.insertReplaceSupport = true
|
||||
capabilities.textDocument.completion.completionItem.labelDetailsSupport = true
|
||||
capabilities.textDocument.completion.completionItem.deprecatedSupport = true
|
||||
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
|
||||
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
|
||||
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
||||
properties = {
|
||||
"documentation",
|
||||
"detail",
|
||||
"additionalTextEdits",
|
||||
},
|
||||
}
|
||||
|
||||
-- replace the default lsp diagnostic symbols
|
||||
local function lspSymbol(name, icon)
|
||||
vim.fn.sign_define("LspDiagnosticsSign" .. name, { text = icon, numhl = "LspDiagnosticsDefault" .. name })
|
||||
end
|
||||
|
||||
lspSymbol("Error", "")
|
||||
lspSymbol("Information", "")
|
||||
lspSymbol("Hint", "")
|
||||
lspSymbol("Warning", "")
|
||||
|
||||
local lsp_publish_diagnostics_options = overrides.get("publish_diagnostics", {
|
||||
virtual_text = {
|
||||
prefix = "",
|
||||
spacing = 0,
|
||||
},
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false, -- update diagnostics insert mode
|
||||
})
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics,
|
||||
lsp_publish_diagnostics_options
|
||||
)
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "single",
|
||||
})
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "single",
|
||||
})
|
||||
|
||||
-- suppress error messages from lang servers
|
||||
vim.notify = function(msg, log_level, _opts)
|
||||
if msg:match "exit code" then
|
||||
return
|
||||
end
|
||||
if log_level == vim.log.levels.ERROR then
|
||||
vim.api.nvim_err_writeln(msg)
|
||||
else
|
||||
vim.api.nvim_echo({ { msg } }, true, {})
|
||||
end
|
||||
end
|
||||
|
||||
-- requires a file containing user's lspconfigs
|
||||
|
||||
local addlsp_confs = require("core.utils").load_config().plugins.options.lspconfig.setup_lspconf
|
||||
|
||||
if string.len(addlsp_confs) ~= 0 then
|
||||
require(addlsp_confs).setup_lsp(on_attach, capabilities)
|
||||
end
|
@ -1,31 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.icons = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "ﰠ",
|
||||
Variable = "",
|
||||
Class = "ﴯ",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "ﰠ",
|
||||
Unit = "塞",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "פּ",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
|
||||
return M
|
@ -1,82 +0,0 @@
|
||||
local present, nvimtree = pcall(require, "nvim-tree")
|
||||
local git_status = require("core.utils").load_config().plugins.options.nvimtree.enable_git
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local g = vim.g
|
||||
|
||||
vim.o.termguicolors = true
|
||||
|
||||
g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names
|
||||
g.nvim_tree_git_hl = git_status
|
||||
g.nvim_tree_gitignore = 0
|
||||
g.nvim_tree_highlight_opened_files = 0
|
||||
g.nvim_tree_indent_markers = 1
|
||||
g.nvim_tree_ignore = { ".git", "node_modules", ".cache" }
|
||||
g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened
|
||||
g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" }
|
||||
--
|
||||
g.nvim_tree_show_icons = {
|
||||
folders = 1,
|
||||
-- folder_arrows= 1
|
||||
files = 1,
|
||||
git = git_status,
|
||||
}
|
||||
|
||||
g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
renamed = "➜",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
unstaged = "✗",
|
||||
untracked = "★",
|
||||
},
|
||||
folder = {
|
||||
-- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below!
|
||||
-- arrow_open = "",
|
||||
-- arrow_closed = "",
|
||||
default = "",
|
||||
empty = "", --
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
}
|
||||
|
||||
nvimtree.setup {
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
},
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
ignore_ft_on_setup = { "dashboard" },
|
||||
auto_close = false,
|
||||
open_on_tab = false,
|
||||
hijack_cursor = true,
|
||||
update_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = false,
|
||||
},
|
||||
view = {
|
||||
allow_resize = true,
|
||||
side = "left",
|
||||
width = 25,
|
||||
},
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
local nvimrc_config = require("core.utils").load_config()
|
||||
M.autopairs = function()
|
||||
local present1, autopairs = pcall(require, "nvim-autopairs")
|
||||
local present2, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
|
||||
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
end
|
||||
|
||||
autopairs.setup()
|
||||
|
||||
-- not needed if you disable cmp, the above var related to cmp tooo! override default config for autopairs
|
||||
local cmp = require "cmp"
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end
|
||||
|
||||
M.better_escape = function()
|
||||
require("better_escape").setup {
|
||||
mapping = nvimrc_config.mappings.plugins.better_escape.esc_insertmode,
|
||||
timeout = nvimrc_config.plugins.options.esc_insertmode_timeout,
|
||||
}
|
||||
end
|
||||
|
||||
M.blankline = function()
|
||||
require("indent_blankline").setup {
|
||||
indentLine_enabled = 1,
|
||||
char = "|",
|
||||
filetype_exclude = {
|
||||
"help",
|
||||
"terminal",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"lspinfo",
|
||||
"TelescopePrompt",
|
||||
"TelescopeResults",
|
||||
},
|
||||
buftype_exclude = { "terminal" },
|
||||
show_trailing_blankline_indent = true,
|
||||
show_first_indent_level = true,
|
||||
space_char_blankline = " ",
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
M.colorizer = function()
|
||||
local present, colorizer = pcall(require, "colorizer")
|
||||
if present then
|
||||
colorizer.setup({ "*" }, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = false, -- "Name" codes like Blue
|
||||
RRGGBBAA = false, -- #RRGGBBAA hex codes
|
||||
rgb_fn = false, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = false, -- CSS hsl() and hsla() functions
|
||||
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
|
||||
-- Available modes: foreground, background
|
||||
mode = "background", -- Set the display mode.
|
||||
})
|
||||
vim.cmd "ColorizerReloadAllBuffers"
|
||||
end
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
local present, nvim_comment = pcall(require, "nvim_comment")
|
||||
if present then
|
||||
nvim_comment.setup()
|
||||
end
|
||||
end
|
||||
|
||||
M.luasnip = function()
|
||||
local present, luasnip = pcall(require, "luasnip")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
}
|
||||
|
||||
require("luasnip/loaders/from_vscode").load { paths = nvimrc_config.plugins.options.luasnip.snippet_path }
|
||||
require("luasnip/loaders/from_vscode").load()
|
||||
end
|
||||
|
||||
M.signature = function()
|
||||
local present, lspsignature = pcall(require, "lsp_signature")
|
||||
if present then
|
||||
lspsignature.setup {
|
||||
bind = true,
|
||||
doc_lines = 0,
|
||||
floating_window = true,
|
||||
fix_pos = true,
|
||||
hint_enable = true,
|
||||
hint_prefix = " ",
|
||||
hint_scheme = "String",
|
||||
hi_parameter = "Search",
|
||||
max_height = 22,
|
||||
max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||
handler_opts = {
|
||||
border = "single", -- double, single, shadow, none
|
||||
},
|
||||
zindex = 200, -- by default it will be on top of all floating windows, set to 50 send it to bottom
|
||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -1,82 +0,0 @@
|
||||
local present, telescope = pcall(require, "telescope")
|
||||
if not present then return end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg", "--color=never", "--no-heading", "--with-filename",
|
||||
"--line-number", "--column", "--smart-case"
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8
|
||||
},
|
||||
vertical = {mirror = false},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120
|
||||
},
|
||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||
file_ignore_patterns = {"node_modules"},
|
||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
path_display = {"absolute"},
|
||||
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
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = false, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case" -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
},
|
||||
media_files = {
|
||||
filetypes = {"png", "webp", "jpg", "jpeg"},
|
||||
find_cmd = "rg" -- find command (defaults to `fd`)
|
||||
},
|
||||
file_browser = {
|
||||
theme = "dracula",
|
||||
-- disables netrw and use telescope-file-browser in its place
|
||||
hijack_netrw = true,
|
||||
mappings = {
|
||||
["i"] = {
|
||||
-- your custom insert mode mappings
|
||||
},
|
||||
["n"] = {
|
||||
-- your custom normal mode mappings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local extensions = {"themes", "terms", "fzf"}
|
||||
local packer_repos = [["extensions", "telescope-fzf-native.nvim", "telescope-file-browser.nvim"]]
|
||||
|
||||
if vim.fn.executable "ueberzug" == 1 then
|
||||
table.insert(extensions, "media_files")
|
||||
packer_repos = packer_repos .. ', "telescope-media-files.nvim"'
|
||||
end
|
||||
|
||||
pcall(function()
|
||||
for _, ext in ipairs(extensions) do telescope.load_extension(ext) end
|
||||
end)
|
@ -1,32 +0,0 @@
|
||||
local present, ts_config = pcall(require, "nvim-treesitter.configs")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
||||
|
||||
parser_config.org = {
|
||||
install_info = {
|
||||
url = 'https://github.com/milisims/tree-sitter-org',
|
||||
revision = 'f110024d539e676f25b72b7c80b0fd43c34264ef',
|
||||
files = {'src/parser.c', 'src/scanner.cc'},
|
||||
},
|
||||
filetype = 'org',
|
||||
}
|
||||
|
||||
ts_config.setup {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"org",
|
||||
"haskell",
|
||||
"cpp",
|
||||
"c",
|
||||
"javascript",
|
||||
"markdown"
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
additional_vim_regex_highlighting = {'org'},
|
||||
},
|
||||
}
|
@ -1,270 +0,0 @@
|
||||
local present, packer = pcall(require, "plugins.packerInit")
|
||||
|
||||
if not present then
|
||||
return false
|
||||
end
|
||||
|
||||
local use = packer.use
|
||||
|
||||
return packer.startup(function()
|
||||
local status = require("core.utils").load_config().plugins.status
|
||||
|
||||
-- FUNCTION: override_req, use `nvimrc` plugin config override if present
|
||||
-- name = name inside `default_config` / `nvimrc`
|
||||
-- default_req = run this if 'name' does not exist in `default_config` / `nvimrc`
|
||||
-- if override or default_req start with `(`, then strip that and assume override calls a function, not a whole file
|
||||
local override_req = function(name, default_req)
|
||||
local override = require("core.utils").load_config().plugins.default_plugin_config_replace[name]
|
||||
local result
|
||||
|
||||
if override == nil then
|
||||
result = default_req
|
||||
else
|
||||
result = override
|
||||
end
|
||||
|
||||
if string.match(result, "^%(") then
|
||||
result = result:sub(2)
|
||||
result = result:gsub("%)%.", "').", 1)
|
||||
return "require('" .. result
|
||||
else
|
||||
return "require('" .. result .. "')"
|
||||
end
|
||||
end
|
||||
|
||||
-- this is arranged on the basis of when a plugin starts
|
||||
|
||||
|
||||
|
||||
use {
|
||||
"wbthomason/packer.nvim",
|
||||
event = "VimEnter",
|
||||
}
|
||||
|
||||
-- this is the neovim core repo containing utilities for some features like theme swticher, no need to lazy load
|
||||
use {
|
||||
"nvim-lua/plenary.nvim",
|
||||
}
|
||||
|
||||
use {
|
||||
"Mofiqul/dracula.nvim",
|
||||
after = "packer.nvim",
|
||||
}
|
||||
|
||||
use {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
after = "packer.nvim",
|
||||
config = override_req("nvim_web_devicons", "plugins.configs.icons"),
|
||||
}
|
||||
|
||||
use {
|
||||
"akinsho/bufferline.nvim",
|
||||
disable = not status.bufferline,
|
||||
after = "nvim-web-devicons",
|
||||
config = override_req("bufferline", "plugins.configs.bufferline"),
|
||||
setup = function()
|
||||
require("core.mappings").bufferline()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
disable = not status.blankline,
|
||||
event = "BufRead",
|
||||
config = override_req("indent_blankline", "(plugins.configs.others).blankline()"),
|
||||
}
|
||||
|
||||
use {
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
disable = not status.colorizer,
|
||||
event = "BufRead",
|
||||
config = override_req("nvim_colorizer", "(plugins.configs.others).colorizer()"),
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "master",
|
||||
event = "BufRead",
|
||||
config = override_req("nvim_treesitter", "plugins.configs.treesitter"),
|
||||
}
|
||||
|
||||
-- git stuff
|
||||
use {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
disable = not status.gitsigns,
|
||||
opt = true,
|
||||
config = override_req("gitsigns", "plugins.configs.gitsigns"),
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "gitsigns.nvim"
|
||||
end,
|
||||
}
|
||||
|
||||
-- lsp stuff
|
||||
|
||||
use {
|
||||
"neovim/nvim-lspconfig",
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "nvim-lspconfig"
|
||||
-- reload the current file so lsp actually starts for it
|
||||
vim.defer_fn(function()
|
||||
vim.cmd 'if &ft == "packer" | echo "" | else | silent! e %'
|
||||
end, 0)
|
||||
end,
|
||||
config = override_req("lspconfig", "plugins.configs.lspconfig"),
|
||||
}
|
||||
|
||||
use {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
disable = not status.lspsignature,
|
||||
after = "nvim-lspconfig",
|
||||
config = override_req("signature", "(plugins.configs.others).signature()"),
|
||||
}
|
||||
|
||||
use {
|
||||
"andymass/vim-matchup",
|
||||
disable = not status.vim_matchup,
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "vim-matchup"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"max397574/better-escape.nvim",
|
||||
disable = not status.esc_insertmode,
|
||||
event = "InsertEnter",
|
||||
config = override_req("better_escape", "(plugins.configs.others).better_escape()"),
|
||||
}
|
||||
|
||||
-- load luasnips + cmp related in insert mode only
|
||||
|
||||
use {
|
||||
"rafamadriz/friendly-snippets",
|
||||
disable = not status.cmp,
|
||||
event = "InsertEnter",
|
||||
}
|
||||
|
||||
use {
|
||||
"L3MON4D3/LuaSnip",
|
||||
disable = not status.cmp,
|
||||
wants = "friendly-snippets",
|
||||
after = "nvim-cmp",
|
||||
config = override_req("luasnip", "(plugins.configs.others).luasnip()"),
|
||||
}
|
||||
|
||||
use {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
disable = not status.cmp,
|
||||
after = "LuaSnip",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
disable = not status.cmp,
|
||||
after = "cmp_luasnip",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
disable = not status.cmp,
|
||||
after = "cmp-nvim-lua",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/cmp-buffer",
|
||||
disable = not status.cmp,
|
||||
after = "cmp-nvim-lsp",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/cmp-path",
|
||||
disable = not status.cmp,
|
||||
after = "cmp-buffer",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/cmp-cmdline",
|
||||
disable = not status.cmp,
|
||||
after = "cmp-path",
|
||||
}
|
||||
|
||||
use {
|
||||
"hrsh7th/nvim-cmp",
|
||||
disable = not status.cmp,
|
||||
after = "cmp-path",
|
||||
config = override_req("nvim_cmp", "plugins.configs.cmp"),
|
||||
}
|
||||
-- misc plugins
|
||||
use {
|
||||
"windwp/nvim-autopairs",
|
||||
disable = not status.autopairs,
|
||||
after = "nvim-cmp",
|
||||
config = override_req("nvim_autopairs", "(plugins.configs.others).autopairs()"),
|
||||
}
|
||||
|
||||
use {
|
||||
"glepnir/dashboard-nvim",
|
||||
disable = not status.dashboard,
|
||||
config = override_req("dashboard", "plugins.configs.dashboard"),
|
||||
setup = function()
|
||||
require("core.mappings").dashboard()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"junegunn/fzf.vim",
|
||||
disable = not status.clap,
|
||||
after = "dashboard-nvim",
|
||||
}
|
||||
|
||||
use {
|
||||
"terrortylor/nvim-comment",
|
||||
disable = not status.comment,
|
||||
cmd = "CommentToggle",
|
||||
config = override_req("nvim_comment", "(plugins.configs.others).comment()"),
|
||||
setup = function()
|
||||
require("core.mappings").comment()
|
||||
end,
|
||||
}
|
||||
|
||||
-- file managing , picker etc
|
||||
use {
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
disable = not status.nvimtree,
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
config = override_req("nvim_tree", "plugins.configs.nvimtree"),
|
||||
setup = function()
|
||||
require("core.mappings").nvimtree()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
module = "telescope",
|
||||
cmd = "Telescope",
|
||||
requires = {
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
run = "make",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
run = "make",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-media-files.nvim",
|
||||
disable = not status.telescope_media,
|
||||
setup = function()
|
||||
require("core.mappings").telescope_media()
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = override_req("telescope", "plugins.configs.telescope"),
|
||||
setup = function()
|
||||
require("core.mappings").telescope()
|
||||
end,
|
||||
}
|
||||
|
||||
require("core.hooks").run("install_plugins", use)
|
||||
end)
|
@ -1,47 +0,0 @@
|
||||
local cmd = vim.cmd
|
||||
|
||||
cmd "packadd packer.nvim"
|
||||
|
||||
local present, packer = pcall(require, "packer")
|
||||
|
||||
if not present then
|
||||
local packer_path = vim.fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
||||
|
||||
print "Cloning packer.."
|
||||
-- remove the dir before cloning
|
||||
vim.fn.delete(packer_path, "rf")
|
||||
vim.fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
"--depth",
|
||||
"20",
|
||||
packer_path,
|
||||
}
|
||||
|
||||
cmd "packadd packer.nvim"
|
||||
present, packer = pcall(require, "packer")
|
||||
|
||||
if present then
|
||||
print "Packer cloned successfully."
|
||||
else
|
||||
error("Couldn't clone packer !\nPacker path: " .. packer_path .. "\n" .. packer)
|
||||
end
|
||||
end
|
||||
|
||||
packer.init {
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "single" }
|
||||
end,
|
||||
prompt_border = "single",
|
||||
},
|
||||
git = {
|
||||
clone_timeout = 600, -- Timeout, in seconds, for git clones
|
||||
},
|
||||
auto_clean = true,
|
||||
compile_on_sync = true,
|
||||
-- auto_reload_compiled = true
|
||||
}
|
||||
|
||||
return packer
|
57
nvim/.config/nvim/lua/user/alpha.lua
Normal file
57
nvim/.config/nvim/lua/user/alpha.lua
Normal file
@ -0,0 +1,57 @@
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
"================= =============== =============== ======== ========",
|
||||
"\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //",
|
||||
"||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||",
|
||||
"|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||",
|
||||
"||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||",
|
||||
"|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||",
|
||||
"||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||",
|
||||
"|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||",
|
||||
"||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||",
|
||||
"|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||",
|
||||
"|| `' || || `' || || `' || || | \\ / | ||",
|
||||
"|| .===' `===. .==='.`===. .===' /==. | \\/ | ||",
|
||||
"|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||",
|
||||
"|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||",
|
||||
"|| .==' _-' `-__\\._-' `-_./__-' `' |. /| | ||",
|
||||
"||.==' _-' `' | /==.||",
|
||||
"==' _-' \\/ `==",
|
||||
"\\ _-' `-_ /",
|
||||
" `'' [ Think NeoVim Author:The-Repo-Club ] ``' ",
|
||||
" "
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("p", " Find project", ":Telescope projects <CR>"),
|
||||
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("t", " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua <CR>"),
|
||||
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
|
||||
local function footer()
|
||||
-- NOTE: requires the fortune-mod package to work
|
||||
-- local handle = io.popen("fortune")
|
||||
-- local fortune = handle:read("*a")
|
||||
-- handle:close()
|
||||
-- return fortune
|
||||
return "[ Think NeoVim Author:The-Repo-Club ]"
|
||||
end
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
-- vim.cmd([[autocmd User AlphaReady echo 'ready']])
|
||||
alpha.setup(dashboard.opts)
|
38
nvim/.config/nvim/lua/user/autocommands.lua
Normal file
38
nvim/.config/nvim/lua/user/autocommands.lua
Normal file
@ -0,0 +1,38 @@
|
||||
vim.cmd [[
|
||||
augroup _general_settings
|
||||
autocmd!
|
||||
autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR>
|
||||
autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200})
|
||||
autocmd BufWinEnter * :set formatoptions-=cro
|
||||
autocmd FileType qf set nobuflisted
|
||||
augroup end
|
||||
|
||||
augroup _git
|
||||
autocmd!
|
||||
autocmd FileType gitcommit setlocal wrap
|
||||
autocmd FileType gitcommit setlocal spell
|
||||
augroup end
|
||||
|
||||
augroup _markdown
|
||||
autocmd!
|
||||
autocmd FileType markdown setlocal wrap
|
||||
autocmd FileType markdown setlocal spell
|
||||
augroup end
|
||||
|
||||
augroup _auto_resize
|
||||
autocmd!
|
||||
autocmd VimResized * tabdo wincmd =
|
||||
augroup end
|
||||
|
||||
augroup _alpha
|
||||
autocmd!
|
||||
autocmd User AlphaReady set laststatus=0 | autocmd BufUnload <buffer> set laststatus=2
|
||||
autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Autoformat
|
||||
-- augroup _lsp
|
||||
-- autocmd!
|
||||
-- autocmd BufWritePre * lua vim.lsp.buf.formatting()
|
||||
-- augroup end
|
33
nvim/.config/nvim/lua/user/autopairs.lua
Normal file
33
nvim/.config/nvim/lua/user/autopairs.lua
Normal file
@ -0,0 +1,33 @@
|
||||
-- Setup nvim-cmp.
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
npairs.setup {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
167
nvim/.config/nvim/lua/user/bufferline.lua
Normal file
167
nvim/.config/nvim/lua/user/bufferline.lua
Normal file
@ -0,0 +1,167 @@
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
-- NOTE: this plugin is designed with this icon in mind,
|
||||
-- and so changing this is NOT recommended, this is intended
|
||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||
indicator_icon = "▎",
|
||||
buffer_close_icon = "",
|
||||
-- buffer_close_icon = '',
|
||||
modified_icon = "●",
|
||||
close_icon = "",
|
||||
-- close_icon = '',
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||
--- Please note some names can/will break the
|
||||
--- bufferline so use this at your discretion knowing that it has
|
||||
--- some limitations that will *NOT* be fixed.
|
||||
-- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- -- remove extension from markdown files for example
|
||||
-- if buf.name:match('%.md') then
|
||||
-- return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
-- end
|
||||
-- end,
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 21,
|
||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||
diagnostics_update_in_insert = false,
|
||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
-- return "("..count..")"
|
||||
-- end,
|
||||
-- NOTE: this will be called a lot so don't do any heavy processing here
|
||||
-- custom_filter = function(buf_number)
|
||||
-- -- filter out filetypes you don't want to see
|
||||
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out by buffer name
|
||||
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out based on arbitrary rules
|
||||
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||
-- -- add custom logic
|
||||
-- return buffer_a.modified > buffer_b.modified
|
||||
-- end
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
guifg = { attribute = "fg", highlight = "#ff0000" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
background = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
-- buffer_selected = {
|
||||
-- guifg = {attribute='fg',highlight='#ff0000'},
|
||||
-- guibg = {attribute='bg',highlight='#0000ff'},
|
||||
-- gui = 'none'
|
||||
-- },
|
||||
buffer_visible = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
close_button = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
-- close_button_selected = {
|
||||
-- guifg = {attribute='fg',highlight='TabLineSel'},
|
||||
-- guibg ={attribute='bg',highlight='TabLineSel'}
|
||||
-- },
|
||||
|
||||
tab_selected = {
|
||||
guifg = { attribute = "fg", highlight = "Normal" },
|
||||
guibg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
guibg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
|
||||
duplicate_selected = {
|
||||
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
guibg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
gui = "italic",
|
||||
},
|
||||
duplicate_visible = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
gui = "italic",
|
||||
},
|
||||
duplicate = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
gui = "italic",
|
||||
},
|
||||
|
||||
modified = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
guifg = { attribute = "fg", highlight = "Normal" },
|
||||
guibg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
separator = {
|
||||
guifg = { attribute = "bg", highlight = "TabLine" },
|
||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = { attribute = "bg", highlight = "Normal" },
|
||||
guibg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
-- separator_visible = {
|
||||
-- guifg = {attribute='bg',highlight='TabLine'},
|
||||
-- guibg = {attribute='bg',highlight='TabLine'}
|
||||
-- },
|
||||
indicator_selected = {
|
||||
guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
guibg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
}
|
131
nvim/.config/nvim/lua/user/cmp.lua
Normal file
131
nvim/.config/nvim/lua/user/cmp.lua
Normal file
@ -0,0 +1,131 @@
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col "." - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "m",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping {
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
},
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm { select = true },
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
documentation = {
|
||||
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = false,
|
||||
native_menu = false,
|
||||
},
|
||||
}
|
8
nvim/.config/nvim/lua/user/colorscheme.lua
Normal file
8
nvim/.config/nvim/lua/user/colorscheme.lua
Normal file
@ -0,0 +1,8 @@
|
||||
vim.cmd [[
|
||||
try
|
||||
colorscheme minimalmistakes
|
||||
catch /^Vim\%((\a\+)\)\=:E185/
|
||||
colorscheme default
|
||||
set background=dark
|
||||
endtry
|
||||
]]
|
22
nvim/.config/nvim/lua/user/comment.lua
Normal file
22
nvim/.config/nvim/lua/user/comment.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup {
|
||||
pre_hook = function(ctx)
|
||||
local U = require "Comment.utils"
|
||||
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.block then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring {
|
||||
key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
location = location,
|
||||
}
|
||||
end,
|
||||
}
|
48
nvim/.config/nvim/lua/user/gitsigns.lua
Normal file
48
nvim/.config/nvim/lua/user/gitsigns.lua
Normal file
@ -0,0 +1,48 @@
|
||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
signs = {
|
||||
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" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
}
|
6
nvim/.config/nvim/lua/user/header.lua
Normal file
6
nvim/.config/nvim/lua/user/header.lua
Normal file
@ -0,0 +1,6 @@
|
||||
vim.g.header_email = "wayne6324@gmail.com"
|
||||
vim.g.header_github = "The-Repo-Club"
|
||||
vim.g.header_username = "The-Repo-Club"
|
||||
|
||||
vim.g.header_sh = "bash"
|
||||
vim.g.header_auto_update = "true"
|
6
nvim/.config/nvim/lua/user/impatient.lua
Normal file
6
nvim/.config/nvim/lua/user/impatient.lua
Normal file
@ -0,0 +1,6 @@
|
||||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
70
nvim/.config/nvim/lua/user/indentline.lua
Normal file
70
nvim/.config/nvim/lua/user/indentline.lua
Normal file
@ -0,0 +1,70 @@
|
||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
-- vim.g.indent_blankline_char = "│"
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
-- vim.g.indent_blankline_char = "▎"
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = true
|
||||
vim.g.indent_blankline_use_treesitter = true
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
vim.g.indent_blankline_context_patterns = {
|
||||
"class",
|
||||
"return",
|
||||
"function",
|
||||
"method",
|
||||
"^if",
|
||||
"^while",
|
||||
"jsx_element",
|
||||
"^for",
|
||||
"^object",
|
||||
"^table",
|
||||
"block",
|
||||
"arguments",
|
||||
"if_statement",
|
||||
"else_clause",
|
||||
"jsx_element",
|
||||
"jsx_self_closing_element",
|
||||
"try_statement",
|
||||
"catch_clause",
|
||||
"import_statement",
|
||||
"operation_type",
|
||||
}
|
||||
-- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
||||
vim.wo.colorcolumn = "99999"
|
||||
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]]
|
||||
-- vim.opt.list = true
|
||||
-- vim.opt.listchars:append "space:⋅"
|
||||
-- vim.opt.listchars:append "space:"
|
||||
-- vim.opt.listchars:append "eol:↴"
|
||||
|
||||
indent_blankline.setup({
|
||||
-- show_end_of_line = true,
|
||||
-- space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
-- show_current_context_start = true,
|
||||
-- char_highlight_list = {
|
||||
-- "IndentBlanklineIndent1",
|
||||
-- "IndentBlanklineIndent2",
|
||||
-- "IndentBlanklineIndent3",
|
||||
-- },
|
||||
})
|
69
nvim/.config/nvim/lua/user/keymaps.lua
Normal file
69
nvim/.config/nvim/lua/user/keymaps.lua
Normal file
@ -0,0 +1,69 @@
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local term_opts = { silent = true }
|
||||
|
||||
-- Shorten function name
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
--Remap space as leader key
|
||||
keymap("", "<Space>", "<Nop>", opts)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Modes
|
||||
-- normal_mode = "n",
|
||||
-- insert_mode = "i",
|
||||
-- visual_mode = "v",
|
||||
-- visual_block_mode = "x",
|
||||
-- term_mode = "t",
|
||||
-- command_mode = "c",
|
||||
|
||||
-- Normal --
|
||||
-- Better window navigation
|
||||
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||
keymap("n", "<C-k>", "<C-w>k", opts)
|
||||
keymap("n", "<C-l>", "<C-w>l", opts)
|
||||
|
||||
-- Resize with arrows
|
||||
keymap("n", "<C-Up>", ":resize -2<CR>", opts)
|
||||
keymap("n", "<C-Down>", ":resize +2<CR>", opts)
|
||||
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
|
||||
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
||||
|
||||
-- Navigate buffers
|
||||
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
|
||||
keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
|
||||
|
||||
-- Insert --
|
||||
-- Press jk fast to exit insert mode
|
||||
keymap("i", "jk", "<ESC>", opts)
|
||||
|
||||
-- Visual --
|
||||
-- Stay in indent mode
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
|
||||
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
|
||||
keymap("v", "p", '"_dP', opts)
|
||||
|
||||
-- Visual Block --
|
||||
-- Move text up and down
|
||||
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
|
||||
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
|
||||
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
|
||||
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
|
||||
|
||||
-- Terminal --
|
||||
-- Better terminal navigation
|
||||
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
|
||||
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
|
||||
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
|
||||
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
|
||||
|
24
nvim/.config/nvim/lua/user/lsp/configs.lua
Normal file
24
nvim/.config/nvim/lua/user/lsp/configs.lua
Normal file
@ -0,0 +1,24 @@
|
||||
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "jsonls", "sumneko_lua" }
|
||||
|
||||
lsp_installer.setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
local opts = {
|
||||
on_attach = require("user.lsp.handlers").on_attach,
|
||||
capabilities = require("user.lsp.handlers").capabilities,
|
||||
}
|
||||
local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
|
||||
if has_custom_opts then
|
||||
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
|
||||
end
|
||||
lspconfig[server].setup(opts)
|
||||
end
|
102
nvim/.config/nvim/lua/user/lsp/handlers.lua
Normal file
102
nvim/.config/nvim/lua/user/lsp/handlers.lua
Normal file
@ -0,0 +1,102 @@
|
||||
local M = {}
|
||||
|
||||
-- TODO: backfill this to template
|
||||
M.setup = function()
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = "" },
|
||||
{ name = "DiagnosticSignWarn", text = "" },
|
||||
{ name = "DiagnosticSignHint", text = "" },
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
local config = {
|
||||
-- disable virtual text
|
||||
virtual_text = false,
|
||||
-- show signs
|
||||
signs = {
|
||||
active = signs,
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "rounded",
|
||||
width = 60,
|
||||
})
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "rounded",
|
||||
width = 60,
|
||||
})
|
||||
end
|
||||
|
||||
local function lsp_highlight_document(client)
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
illuminate.on_attach(client)
|
||||
-- end
|
||||
end
|
||||
|
||||
local function lsp_keymaps(bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
bufnr,
|
||||
"n",
|
||||
"gl",
|
||||
'<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>',
|
||||
opts
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]])
|
||||
end
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
-- vim.notify(client.name .. " starting...")
|
||||
-- TODO: refactor this into a method that checks if string in list
|
||||
if client.name == "tsserver" then
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
end
|
||||
lsp_keymaps(bufnr)
|
||||
lsp_highlight_document(client)
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)
|
||||
|
||||
return M
|
8
nvim/.config/nvim/lua/user/lsp/init.lua
Normal file
8
nvim/.config/nvim/lua/user/lsp/init.lua
Normal file
@ -0,0 +1,8 @@
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require "user.lsp.configs"
|
||||
require("user.lsp.handlers").setup()
|
||||
require "user.lsp.null-ls"
|
19
nvim/.config/nvim/lua/user/lsp/null-ls.lua
Normal file
19
nvim/.config/nvim/lua/user/lsp/null-ls.lua
Normal file
@ -0,0 +1,19 @@
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
sources = {
|
||||
formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
|
||||
formatting.black.with({ extra_args = { "--fast" } }),
|
||||
formatting.stylua,
|
||||
-- diagnostics.flake8
|
||||
},
|
||||
})
|
197
nvim/.config/nvim/lua/user/lsp/settings/jsonls.lua
Normal file
197
nvim/.config/nvim/lua/user/lsp/settings/jsonls.lua
Normal file
@ -0,0 +1,197 @@
|
||||
local default_schemas = nil
|
||||
local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
|
||||
if status_ok then
|
||||
default_schemas = jsonls_settings.get_default_schemas()
|
||||
end
|
||||
|
||||
local schemas = {
|
||||
{
|
||||
description = "TypeScript compiler configuration file",
|
||||
fileMatch = {
|
||||
"tsconfig.json",
|
||||
"tsconfig.*.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/tsconfig.json",
|
||||
},
|
||||
{
|
||||
description = "Lerna config",
|
||||
fileMatch = { "lerna.json" },
|
||||
url = "https://json.schemastore.org/lerna.json",
|
||||
},
|
||||
{
|
||||
description = "Babel configuration",
|
||||
fileMatch = {
|
||||
".babelrc.json",
|
||||
".babelrc",
|
||||
"babel.config.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/babelrc.json",
|
||||
},
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = {
|
||||
".eslintrc.json",
|
||||
".eslintrc",
|
||||
},
|
||||
url = "https://json.schemastore.org/eslintrc.json",
|
||||
},
|
||||
{
|
||||
description = "Bucklescript config",
|
||||
fileMatch = { "bsconfig.json" },
|
||||
url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
|
||||
},
|
||||
{
|
||||
description = "Prettier config",
|
||||
fileMatch = {
|
||||
".prettierrc",
|
||||
".prettierrc.json",
|
||||
"prettier.config.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/prettierrc",
|
||||
},
|
||||
{
|
||||
description = "Vercel Now config",
|
||||
fileMatch = { "now.json" },
|
||||
url = "https://json.schemastore.org/now",
|
||||
},
|
||||
{
|
||||
description = "Stylelint config",
|
||||
fileMatch = {
|
||||
".stylelintrc",
|
||||
".stylelintrc.json",
|
||||
"stylelint.config.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/stylelintrc",
|
||||
},
|
||||
{
|
||||
description = "A JSON schema for the ASP.NET LaunchSettings.json files",
|
||||
fileMatch = { "launchsettings.json" },
|
||||
url = "https://json.schemastore.org/launchsettings.json",
|
||||
},
|
||||
{
|
||||
description = "Schema for CMake Presets",
|
||||
fileMatch = {
|
||||
"CMakePresets.json",
|
||||
"CMakeUserPresets.json",
|
||||
},
|
||||
url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
|
||||
},
|
||||
{
|
||||
description = "Configuration file as an alternative for configuring your repository in the settings page.",
|
||||
fileMatch = {
|
||||
".codeclimate.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/codeclimate.json",
|
||||
},
|
||||
{
|
||||
description = "LLVM compilation database",
|
||||
fileMatch = {
|
||||
"compile_commands.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/compile-commands.json",
|
||||
},
|
||||
{
|
||||
description = "Config file for Command Task Runner",
|
||||
fileMatch = {
|
||||
"commands.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/commands.json",
|
||||
},
|
||||
{
|
||||
description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
|
||||
fileMatch = {
|
||||
"*.cf.json",
|
||||
"cloudformation.json",
|
||||
},
|
||||
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
|
||||
},
|
||||
{
|
||||
description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
|
||||
fileMatch = {
|
||||
"serverless.template",
|
||||
"*.sam.json",
|
||||
"sam.json",
|
||||
},
|
||||
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
|
||||
},
|
||||
{
|
||||
description = "Json schema for properties json file for a GitHub Workflow template",
|
||||
fileMatch = {
|
||||
".github/workflow-templates/**.properties.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/github-workflow-template-properties.json",
|
||||
},
|
||||
{
|
||||
description = "golangci-lint configuration file",
|
||||
fileMatch = {
|
||||
".golangci.toml",
|
||||
".golangci.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/golangci-lint.json",
|
||||
},
|
||||
{
|
||||
description = "JSON schema for the JSON Feed format",
|
||||
fileMatch = {
|
||||
"feed.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/feed.json",
|
||||
versions = {
|
||||
["1"] = "https://json.schemastore.org/feed-1.json",
|
||||
["1.1"] = "https://json.schemastore.org/feed.json",
|
||||
},
|
||||
},
|
||||
{
|
||||
description = "Packer template JSON configuration",
|
||||
fileMatch = {
|
||||
"packer.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/packer.json",
|
||||
},
|
||||
{
|
||||
description = "NPM configuration file",
|
||||
fileMatch = {
|
||||
"package.json",
|
||||
},
|
||||
url = "https://json.schemastore.org/package.json",
|
||||
},
|
||||
{
|
||||
description = "JSON schema for Visual Studio component configuration files",
|
||||
fileMatch = {
|
||||
"*.vsconfig",
|
||||
},
|
||||
url = "https://json.schemastore.org/vsconfig.json",
|
||||
},
|
||||
{
|
||||
description = "Resume json",
|
||||
fileMatch = { "resume.json" },
|
||||
url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
|
||||
},
|
||||
}
|
||||
|
||||
local function extend(tab1, tab2)
|
||||
for _, value in ipairs(tab2 or {}) do
|
||||
table.insert(tab1, value)
|
||||
end
|
||||
return tab1
|
||||
end
|
||||
|
||||
local extended_schemas = extend(schemas, default_schemas)
|
||||
|
||||
local opts = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = extended_schemas,
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
commands = {
|
||||
Format = {
|
||||
function()
|
||||
vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
16
nvim/.config/nvim/lua/user/lsp/settings/sumneko_lua.lua
Normal file
16
nvim/.config/nvim/lua/user/lsp/settings/sumneko_lua.lua
Normal file
@ -0,0 +1,16 @@
|
||||
return {
|
||||
settings = {
|
||||
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
78
nvim/.config/nvim/lua/user/lualine.lua
Normal file
78
nvim/.config/nvim/lua/user/lualine.lua
Normal file
@ -0,0 +1,78 @@
|
||||
local status_ok, lualine = pcall(require, "lualine")
|
||||
if not status_ok then return end
|
||||
|
||||
local hide_in_width = function() return vim.fn.winwidth(0) > 80 end
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = {"nvim_diagnostic"},
|
||||
sections = {"error", "warn"},
|
||||
symbols = {error = " ", warn = " "},
|
||||
colored = false,
|
||||
update_in_insert = false,
|
||||
always_visible = true
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = false,
|
||||
symbols = {added = " ", modified = " ", removed = " "}, -- changes diff symbols
|
||||
cond = hide_in_width
|
||||
}
|
||||
|
||||
local mode = {"mode", fmt = function(str) return "-- " .. str .. " --" end}
|
||||
|
||||
local filetype = {"filetype", icons_enabled = false, icon = nil}
|
||||
|
||||
local branch = {"branch", icons_enabled = true, icon = ""}
|
||||
|
||||
local location = {"location", padding = 0}
|
||||
|
||||
-- cool function for progress
|
||||
local progress = function()
|
||||
local current_line = vim.fn.line(".")
|
||||
local total_lines = vim.fn.line("$")
|
||||
local chars = {
|
||||
"__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆",
|
||||
"▇▇", "██"
|
||||
}
|
||||
local line_ratio = current_line / total_lines
|
||||
local index = math.ceil(line_ratio * #chars)
|
||||
return chars[index]
|
||||
end
|
||||
|
||||
local spaces = function()
|
||||
return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
end
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "minimalmistakes-nvim",
|
||||
component_separators = {left = "", right = ""},
|
||||
section_separators = {left = "", right = ""},
|
||||
disabled_filetypes = {
|
||||
"alpha", "dashboard", "NvimTree", "Outline", "packer"
|
||||
},
|
||||
always_divide_middle = true
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {branch, diagnostics},
|
||||
lualine_b = {mode},
|
||||
lualine_c = {},
|
||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_x = {diff, spaces, "encoding", filetype},
|
||||
lualine_y = {location},
|
||||
lualine_z = {progress}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {"filename"},
|
||||
lualine_x = {"location"},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {"nvim-tree"}
|
||||
})
|
68
nvim/.config/nvim/lua/user/nvim-tree.lua
Normal file
68
nvim/.config/nvim/lua/user/nvim-tree.lua
Normal file
@ -0,0 +1,68 @@
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||
if not config_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup {
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
},
|
||||
renderer = {
|
||||
root_folder_modifier = ":t",
|
||||
icons = {
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
show_on_dirs = true,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
height = 30,
|
||||
side = "left",
|
||||
mappings = {
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
48
nvim/.config/nvim/lua/user/options.lua
Normal file
48
nvim/.config/nvim/lua/user/options.lua
Normal file
@ -0,0 +1,48 @@
|
||||
local options = {
|
||||
list = true,
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||
cmdheight = 1, -- more space in the neovim command line for displaying messages
|
||||
completeopt = {"menuone", "noselect"}, -- mostly just for cmp
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||
showtabline = 2, -- always show tabs
|
||||
smartcase = true, -- smart case
|
||||
smartindent = true, -- make indenting smarter again
|
||||
splitbelow = true, -- force all horizontal splits to go below current window
|
||||
splitright = true, -- force all vertical splits to go to the right of current window
|
||||
swapfile = false, -- creates a swapfile
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 300, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 2, -- the number of spaces inserted for each indentation
|
||||
tabstop = 2, -- insert 2 spaces for a tab
|
||||
cursorline = true, -- highlight the current line
|
||||
number = true, -- set numbered lines
|
||||
relativenumber = true, -- set relative numbered lines
|
||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||
wrap = false, -- display lines as one long line
|
||||
scrolloff = 8, -- is one of my fav
|
||||
sidescrolloff = 8,
|
||||
laststatus = 2,
|
||||
guifont = "monospace:h17" -- the font used in graphical neovim applications
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append "c"
|
||||
vim.opt.listchars:append "space:⋅"
|
||||
vim.opt.listchars:append "eol:↴"
|
||||
|
||||
for k, v in pairs(options) do vim.opt[k] = v end
|
||||
|
||||
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
||||
vim.cmd [[set iskeyword+=-]]
|
||||
vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work
|
191
nvim/.config/nvim/lua/user/plugins.lua
Normal file
191
nvim/.config/nvim/lua/user/plugins.lua
Normal file
@ -0,0 +1,191 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system({
|
||||
"git", "clone", "--depth", "1",
|
||||
"https://github.com/wbthomason/packer.nvim", install_path
|
||||
})
|
||||
print("Installing packer close and reopen Neovim...")
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]])
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then return end
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init({
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float({border = "rounded"})
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
-- Install your plugins here
|
||||
return packer.startup(function(use)
|
||||
-- My plugins here
|
||||
|
||||
use({
|
||||
"wbthomason/packer.nvim",
|
||||
commit = "00ec5adef58c5ff9a07f11f45903b9dbbaa1b422"
|
||||
}) -- Have packer manage itself
|
||||
use({
|
||||
"nvim-lua/plenary.nvim",
|
||||
commit = "968a4b9afec0c633bc369662e78f8c5db0eba249"
|
||||
}) -- Useful lua functions used by lots of plugins
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
commit = "fa6876f832ea1b71801c4e481d8feca9a36215ec"
|
||||
}) -- Autopairs, integrates with both cmp and treesitter
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
commit = "2c26a00f32b190390b664e56e32fd5347613b9e2"
|
||||
})
|
||||
use({
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
commit = "88343753dbe81c227a1c1fd2c8d764afb8d36269"
|
||||
})
|
||||
use({
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
commit = "8d2c5337f0a2d0a17de8e751876eeb192b32310e"
|
||||
})
|
||||
use({
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
commit = "bdb6d4a25410da35bbf7ce0dbdaa8d60432bc243"
|
||||
})
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
commit = "c78b3ecf9539a719828bca82fc7ddb9b3ba0c353"
|
||||
})
|
||||
use({"moll/vim-bbye", commit = "25ef93ac5a87526111f43e5110675032dbcacf56"})
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
commit = "3362b28f917acc37538b1047f187ff1b5645ecdd"
|
||||
})
|
||||
use({
|
||||
"akinsho/toggleterm.nvim",
|
||||
commit = "aaeed9e02167c5e8f00f25156895a6fd95403af8"
|
||||
})
|
||||
use({
|
||||
"ahmedkhalf/project.nvim",
|
||||
commit = "541115e762764bc44d7d3bf501b6e367842d3d4f"
|
||||
})
|
||||
use({
|
||||
"lewis6991/impatient.nvim",
|
||||
commit = "969f2c5c90457612c09cf2a13fee1adaa986d350"
|
||||
})
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
commit = "6177a59552e35dfb69e1493fd68194e673dc3ee2"
|
||||
})
|
||||
use({
|
||||
"goolord/alpha-nvim",
|
||||
commit = "ef27a59e5b4d7b1c2fe1950da3fe5b1c5f3b4c94"
|
||||
})
|
||||
use("folke/which-key.nvim")
|
||||
|
||||
-- Colorschemes
|
||||
use({
|
||||
"folke/tokyonight.nvim",
|
||||
commit = "8223c970677e4d88c9b6b6d81bda23daf11062bb"
|
||||
})
|
||||
use("lunarvim/darkplus.nvim")
|
||||
use("Minimal-Mistakes/minimalmistakes-nvim")
|
||||
|
||||
-- cmp plugins
|
||||
use({
|
||||
"hrsh7th/nvim-cmp",
|
||||
commit = "df6734aa018d6feb4d76ba6bda94b1aeac2b378a"
|
||||
}) -- The completion plugin
|
||||
use({
|
||||
"hrsh7th/cmp-buffer",
|
||||
commit = "62fc67a2b0205136bc3e312664624ba2ab4a9323"
|
||||
}) -- buffer completions
|
||||
use({
|
||||
"hrsh7th/cmp-path",
|
||||
commit = "466b6b8270f7ba89abd59f402c73f63c7331ff6e"
|
||||
}) -- path completions
|
||||
use({
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36"
|
||||
}) -- snippet completions
|
||||
use({
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
commit = "affe808a5c56b71630f17aa7c38e15c59fd648a8"
|
||||
})
|
||||
use({
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21"
|
||||
})
|
||||
|
||||
-- snippets
|
||||
use({
|
||||
"L3MON4D3/LuaSnip",
|
||||
commit = "79b2019c68a2ff5ae4d732d50746c901dd45603a"
|
||||
}) -- snippet engine
|
||||
use({
|
||||
"rafamadriz/friendly-snippets",
|
||||
commit = "d27a83a363e61009278b6598703a763ce9c8e617"
|
||||
}) -- a bunch of snippets to use
|
||||
|
||||
-- LSP
|
||||
use({
|
||||
"neovim/nvim-lspconfig",
|
||||
commit = "148c99bd09b44cf3605151a06869f6b4d4c24455"
|
||||
}) -- enable LSP
|
||||
use({
|
||||
"williamboman/nvim-lsp-installer",
|
||||
commit = "e9f13d7acaa60aff91c58b923002228668c8c9e6"
|
||||
}) -- simple to use language server installer
|
||||
use({
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
commit = "ff40739e5be6581899b43385997e39eecdbf9465"
|
||||
}) -- for formatters and linters
|
||||
|
||||
-- Telescope
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
commit = "d96eaa914aab6cfc4adccb34af421bdd496468b0"
|
||||
})
|
||||
|
||||
-- Treesitter
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
commit = "518e27589c0463af15463c9d675c65e464efc2fe"
|
||||
})
|
||||
|
||||
-- Git
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
commit = "c18e016864c92ecf9775abea1baaa161c28082c3"
|
||||
})
|
||||
|
||||
-- Custom
|
||||
use {"cappyzawa/trim.nvim"}
|
||||
use {"ap/vim-css-color"}
|
||||
use {"tpope/vim-fugitive"}
|
||||
use {"airblade/vim-gitgutter"}
|
||||
use {"mbbill/undotree"}
|
||||
use {"ctrlpvim/ctrlp.vim"}
|
||||
use {"lyuts/vim-rtags"}
|
||||
use {"wakatime/vim-wakatime"}
|
||||
use {"mboughaba/i3config.vim"}
|
||||
use {"The-Repo-Club/Vim_Headers"}
|
||||
use {"The-Repo-Club/Vim_Keys"}
|
||||
use {"Thyrum/vim-stabs"}
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then require("packer").sync() end
|
||||
end)
|
48
nvim/.config/nvim/lua/user/project.lua
Normal file
48
nvim/.config/nvim/lua/user/project.lua
Normal file
@ -0,0 +1,48 @@
|
||||
local status_ok, project = pcall(require, "project_nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
project.setup({
|
||||
---@usage set to false to disable project.nvim.
|
||||
--- This is on by default since it's currently the expected behavior.
|
||||
active = true,
|
||||
|
||||
on_config_done = nil,
|
||||
|
||||
---@usage set to true to disable setting the current-woriking directory
|
||||
--- Manual mode doesn't automatically change your root directory, so you have
|
||||
--- the option to manually do so using `:ProjectRoot` command.
|
||||
manual_mode = false,
|
||||
|
||||
---@usage Methods of detecting the root directory
|
||||
--- Allowed values: **"lsp"** uses the native neovim lsp
|
||||
--- **"pattern"** uses vim-rooter like glob pattern matching. Here
|
||||
--- order matters: if one is not detected, the other is used as fallback. You
|
||||
--- can also delete or rearangne the detection methods.
|
||||
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
|
||||
detection_methods = { "pattern" },
|
||||
|
||||
---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
|
||||
|
||||
---@ Show hidden files in telescope when searching for files in a project
|
||||
show_hidden = false,
|
||||
|
||||
---@usage When set to false, you will get a message when project.nvim changes your directory.
|
||||
-- When set to false, you will get a message when project.nvim changes your directory.
|
||||
silent_chdir = true,
|
||||
|
||||
---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... }
|
||||
ignore_lsp = {},
|
||||
|
||||
---@type string
|
||||
---@usage path to store the project history for use in telescope
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
|
||||
local tele_status_ok, telescope = pcall(require, "telescope")
|
||||
if not tele_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension('projects')
|
96
nvim/.config/nvim/lua/user/telescope.lua
Normal file
96
nvim/.config/nvim/lua/user/telescope.lua
Normal file
@ -0,0 +1,96 @@
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local actions = require "telescope.actions"
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Default configuration for builtin pickers goes here:
|
||||
-- picker_name = {
|
||||
-- picker_config_key = value,
|
||||
-- ...
|
||||
-- }
|
||||
-- Now the picker_config_key will be applied every time you call this
|
||||
-- builtin picker
|
||||
},
|
||||
extensions = {
|
||||
-- Your extension configuration goes here:
|
||||
-- extension_name = {
|
||||
-- extension_config_key = value,
|
||||
-- }
|
||||
-- please take a look at the readme of the extension you want to configure
|
||||
},
|
||||
}
|
70
nvim/.config/nvim/lua/user/toggleterm.lua
Normal file
70
nvim/.config/nvim/lua/user/toggleterm.lua
Normal file
@ -0,0 +1,70 @@
|
||||
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup({
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {noremap = true}
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
|
||||
|
||||
function _NCDU_TOGGLE()
|
||||
ncdu:toggle()
|
||||
end
|
||||
|
||||
local htop = Terminal:new({ cmd = "btop", hidden = true })
|
||||
|
||||
function _HTOP_TOGGLE()
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({ cmd = "python", hidden = true })
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
17
nvim/.config/nvim/lua/user/treesitter.lua
Normal file
17
nvim/.config/nvim/lua/user/treesitter.lua
Normal file
@ -0,0 +1,17 @@
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = "all", -- one of "all" or a list of languages
|
||||
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "css" }, -- list of language that will be disabled
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
})
|
@ -1,4 +1,9 @@
|
||||
require('trim').setup({
|
||||
local status_ok, trim = pcall(require, "trim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
trim.setup({
|
||||
-- if you want to ignore markdown file.
|
||||
-- you can specify filetypes.
|
||||
disable = {"markdown"},
|
||||
@ -9,4 +14,4 @@ require('trim').setup({
|
||||
[[%s/\($\n\s*\)\+\%$//]],
|
||||
[[%s/\(\n\n\)\n\+/\1/]],
|
||||
},
|
||||
})
|
||||
})
|
188
nvim/.config/nvim/lua/user/whichkey.lua
Normal file
188
nvim/.config/nvim/lua/user/whichkey.lua
Normal file
@ -0,0 +1,188 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local 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
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- 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, ... and registers them for motion / text object completion
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- 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
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
-- operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
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
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- 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]
|
||||
winblend = 0,
|
||||
},
|
||||
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
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
|
||||
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
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local 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
|
||||
}
|
||||
|
||||
local mappings = {
|
||||
["a"] = { "<cmd>Alpha<cr>", "Alpha" },
|
||||
["b"] = {
|
||||
"<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})<cr>",
|
||||
"Buffers",
|
||||
},
|
||||
["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||
["w"] = { "<cmd>w!<CR>", "Save" },
|
||||
["q"] = { "<cmd>q!<CR>", "Quit" },
|
||||
["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" },
|
||||
["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
|
||||
["f"] = {
|
||||
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>",
|
||||
"Find files",
|
||||
},
|
||||
["F"] = { "<cmd>Telescope live_grep theme=ivy<cr>", "Find Text" },
|
||||
["P"] = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
|
||||
|
||||
p = {
|
||||
name = "Packer",
|
||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
||||
S = { "<cmd>PackerStatus<cr>", "Status" },
|
||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
||||
},
|
||||
|
||||
g = {
|
||||
name = "Git",
|
||||
g = { "<cmd>lua _LAZYGIT_TOGGLE()<CR>", "Lazygit" },
|
||||
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" },
|
||||
d = {
|
||||
"<cmd>Gitsigns diffthis HEAD<cr>",
|
||||
"Diff",
|
||||
},
|
||||
},
|
||||
|
||||
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>lua vim.lsp.buf.format{async=true}<cr>", "Format" },
|
||||
i = { "<cmd>LspInfo<cr>", "Info" },
|
||||
I = { "<cmd>LspInstallInfo<cr>", "Installer Info" },
|
||||
j = {
|
||||
"<cmd>lua vim.lsp.diagnostic.goto_next()<CR>",
|
||||
"Next Diagnostic",
|
||||
},
|
||||
k = {
|
||||
"<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>",
|
||||
"Prev Diagnostic",
|
||||
},
|
||||
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
|
||||
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<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" },
|
||||
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" },
|
||||
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
|
||||
C = { "<cmd>Telescope commands<cr>", "Commands" },
|
||||
},
|
||||
|
||||
t = {
|
||||
name = "Terminal",
|
||||
n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
|
||||
u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
|
||||
t = { "<cmd>lua _HTOP_TOGGLE()<cr>", "Htop" },
|
||||
l = { "<cmd>lua _LAZYGIT_TOGGLE()<cr>", "Lazygit" },
|
||||
p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" },
|
||||
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
|
||||
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
|
||||
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
|
||||
},
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
which_key.register(mappings, opts)
|
@ -69,15 +69,15 @@ end
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
LuaSnip = {
|
||||
after = { "cmp_luasnip" },
|
||||
config = { "require('plugins.configs.others').luasnip()" },
|
||||
load_after = {},
|
||||
["Comment.nvim"] = {
|
||||
loaded = true,
|
||||
needs_bufread = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip",
|
||||
wants = { "friendly-snippets" }
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/Comment.nvim",
|
||||
url = "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
LuaSnip = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
Vim_Headers = {
|
||||
loaded = true,
|
||||
@ -89,75 +89,39 @@ _G.packer_plugins = {
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/Vim_Keys",
|
||||
url = "https://github.com/The-Repo-Club/Vim_Keys"
|
||||
},
|
||||
["better-escape.nvim"] = {
|
||||
config = { "require('plugins.configs.others').better_escape()" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/better-escape.nvim",
|
||||
url = "https://github.com/max397574/better-escape.nvim"
|
||||
["alpha-nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/alpha-nvim",
|
||||
url = "https://github.com/goolord/alpha-nvim"
|
||||
},
|
||||
["bufferline.nvim"] = {
|
||||
config = { "require('plugins.configs.bufferline')" },
|
||||
load_after = {
|
||||
["nvim-web-devicons"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/bufferline.nvim",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/bufferline.nvim",
|
||||
url = "https://github.com/akinsho/bufferline.nvim"
|
||||
},
|
||||
["cmp-buffer"] = {
|
||||
after = { "cmp-path" },
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-buffer",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
["cmp-cmdline"] = {
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-cmdline/after/plugin/cmp_cmdline.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-cmdline",
|
||||
url = "https://github.com/hrsh7th/cmp-cmdline"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
after = { "cmp-buffer" },
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
["cmp-nvim-lua"] = {
|
||||
after = { "cmp-nvim-lsp" },
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lua"
|
||||
},
|
||||
["cmp-path"] = {
|
||||
after = { "nvim-cmp", "cmp-cmdline" },
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-path/after/plugin/cmp_path.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp-path",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||
url = "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
after = { "cmp-nvim-lua" },
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp_luasnip/after/plugin/cmp_luasnip.lua" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/cmp_luasnip",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["ctrlp.vim"] = {
|
||||
@ -165,42 +129,19 @@ _G.packer_plugins = {
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/ctrlp.vim",
|
||||
url = "https://github.com/ctrlpvim/ctrlp.vim"
|
||||
},
|
||||
["dashboard-nvim"] = {
|
||||
after = { "fzf.vim" },
|
||||
config = { "require('plugins.configs.dashboard')" },
|
||||
["darkplus.nvim"] = {
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/dashboard-nvim",
|
||||
url = "https://github.com/glepnir/dashboard-nvim"
|
||||
},
|
||||
["dracula.nvim"] = {
|
||||
load_after = {
|
||||
["packer.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/dracula.nvim",
|
||||
url = "https://github.com/Mofiqul/dracula.nvim"
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/darkplus.nvim",
|
||||
url = "https://github.com/lunarvim/darkplus.nvim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/friendly-snippets",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["fzf.vim"] = {
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/fzf.vim",
|
||||
url = "https://github.com/junegunn/fzf.vim"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
config = { "require('plugins.configs.gitsigns')" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
["i3config.vim"] = {
|
||||
@ -208,98 +149,74 @@ _G.packer_plugins = {
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/i3config.vim",
|
||||
url = "https://github.com/mboughaba/i3config.vim"
|
||||
},
|
||||
["impatient.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/impatient.nvim",
|
||||
url = "https://github.com/lewis6991/impatient.nvim"
|
||||
},
|
||||
["indent-blankline.nvim"] = {
|
||||
config = { "require('plugins.configs.others').blankline()" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
||||
},
|
||||
["lsp_signature.nvim"] = {
|
||||
config = { "require('plugins.configs.others').signature()" },
|
||||
load_after = {
|
||||
["nvim-lspconfig"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/lsp_signature.nvim",
|
||||
url = "https://github.com/ray-x/lsp_signature.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
config = { "\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27custom.configs.lualine\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["nvim-autopairs"] = {
|
||||
config = { "require('plugins.configs.others').autopairs()" },
|
||||
load_after = {},
|
||||
["minimalmistakes-nvim"] = {
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-autopairs",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/minimalmistakes-nvim",
|
||||
url = "https://github.com/Minimal-Mistakes/minimalmistakes-nvim"
|
||||
},
|
||||
["null-ls.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||
},
|
||||
["nvim-autopairs"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
|
||||
url = "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
after = { "LuaSnip", "nvim-autopairs" },
|
||||
config = { "require('plugins.configs.cmp')" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-cmp",
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-comment"] = {
|
||||
commands = { "CommentToggle" },
|
||||
config = { "require('plugins.configs.others').comment()" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-comment",
|
||||
url = "https://github.com/terrortylor/nvim-comment"
|
||||
["nvim-lsp-installer"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer",
|
||||
url = "https://github.com/williamboman/nvim-lsp-installer"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
after = { "lsp_signature.nvim" },
|
||||
config = { "require('plugins.configs.lspconfig')" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
commands = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
config = { "require('plugins.configs.nvimtree')" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/kyazdani42/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
config = { "require('plugins.configs.treesitter')" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-treesitter",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-ts-context-commentstring"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-ts-context-commentstring",
|
||||
url = "https://github.com/JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
after = { "bufferline.nvim" },
|
||||
config = { "require('plugins.configs.icons')" },
|
||||
load_after = {
|
||||
["packer.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
after = { "dracula.nvim", "nvim-web-devicons" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/packer.nvim",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
@ -307,55 +224,40 @@ _G.packer_plugins = {
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["telescope-file-browser.nvim"] = {
|
||||
["project.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/telescope-file-browser.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-file-browser.nvim"
|
||||
},
|
||||
["telescope-fzf-native.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/project.nvim",
|
||||
url = "https://github.com/ahmedkhalf/project.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
commands = { "Telescope" },
|
||||
config = { "require('plugins.configs.telescope')" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/telescope.nvim",
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["toggleterm.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/toggleterm.nvim",
|
||||
url = "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
["tokyonight.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/tokyonight.nvim",
|
||||
url = "https://github.com/folke/tokyonight.nvim"
|
||||
},
|
||||
["trim.nvim"] = {
|
||||
config = { "\27LJ\2\n3\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\24custom.configs.trim\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/trim.nvim",
|
||||
url = "https://github.com/cappyzawa/trim.nvim"
|
||||
},
|
||||
["typescript-vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/typescript-vim",
|
||||
url = "https://github.com/leafgarland/typescript-vim"
|
||||
},
|
||||
undotree = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/undotree",
|
||||
url = "https://github.com/mbbill/undotree"
|
||||
},
|
||||
vim = {
|
||||
["vim-bbye"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim",
|
||||
url = "https://github.com/Minimal-Mistakes/vim"
|
||||
},
|
||||
["vim-clap"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-clap",
|
||||
url = "https://github.com/liuchengxu/vim-clap"
|
||||
},
|
||||
["vim-coloresque"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-coloresque",
|
||||
url = "https://github.com/gko/vim-coloresque"
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-bbye",
|
||||
url = "https://github.com/moll/vim-bbye"
|
||||
},
|
||||
["vim-css-color"] = {
|
||||
loaded = true,
|
||||
@ -372,23 +274,6 @@ _G.packer_plugins = {
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
|
||||
url = "https://github.com/airblade/vim-gitgutter"
|
||||
},
|
||||
["vim-man"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-man",
|
||||
url = "https://github.com/vim-utils/vim-man"
|
||||
},
|
||||
["vim-matchup"] = {
|
||||
after_files = { "/home/repo/.local/share/nvim/site/pack/packer/opt/vim-matchup/after/plugin/matchit.vim" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/opt/vim-matchup",
|
||||
url = "https://github.com/andymass/vim-matchup"
|
||||
},
|
||||
["vim-ripgrep"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-ripgrep",
|
||||
url = "https://github.com/jremmen/vim-ripgrep"
|
||||
},
|
||||
["vim-rtags"] = {
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/vim-rtags",
|
||||
@ -405,7 +290,6 @@ _G.packer_plugins = {
|
||||
url = "https://github.com/wakatime/vim-wakatime"
|
||||
},
|
||||
["which-key.nvim"] = {
|
||||
config = { "\27LJ\2\n8\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\29custom.configs.which-key\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/repo/.local/share/nvim/site/pack/packer/start/which-key.nvim",
|
||||
url = "https://github.com/folke/which-key.nvim"
|
||||
@ -413,122 +297,6 @@ _G.packer_plugins = {
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
local module_lazy_loads = {
|
||||
["^telescope"] = "telescope.nvim"
|
||||
}
|
||||
local lazy_load_called = {['packer.load'] = true}
|
||||
local function lazy_load_module(module_name)
|
||||
local to_load = {}
|
||||
if lazy_load_called[module_name] then return nil end
|
||||
lazy_load_called[module_name] = true
|
||||
for module_pat, plugin_name in pairs(module_lazy_loads) do
|
||||
if not _G.packer_plugins[plugin_name].loaded and string.match(module_name, module_pat) then
|
||||
to_load[#to_load + 1] = plugin_name
|
||||
end
|
||||
end
|
||||
|
||||
if #to_load > 0 then
|
||||
require('packer.load')(to_load, {module = module_name}, _G.packer_plugins)
|
||||
local loaded_mod = package.loaded[module_name]
|
||||
if loaded_mod then
|
||||
return function(modname) return loaded_mod end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not vim.g.packer_custom_loader_enabled then
|
||||
table.insert(package.loaders, 1, lazy_load_module)
|
||||
vim.g.packer_custom_loader_enabled = true
|
||||
end
|
||||
|
||||
-- Setup for: telescope.nvim
|
||||
time([[Setup for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14telescope\18core.mappings\frequire\0", "setup", "telescope.nvim")
|
||||
time([[Setup for telescope.nvim]], false)
|
||||
-- Setup for: nvim-lspconfig
|
||||
time([[Setup for nvim-lspconfig]], true)
|
||||
try_loadstring("\27LJ\2\nU\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0006if &ft == \"packer\" | echo \"\" | else | silent! e %\bcmd\bvimx\1\0\4\0\a\0\f6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\0016\0\4\0009\0\5\0003\2\6\0)\3\0\0B\0\3\1K\0\1\0\0\rdefer_fn\bvim\19nvim-lspconfig\21packer_lazy_load\15core.utils\frequire\0", "setup", "nvim-lspconfig")
|
||||
time([[Setup for nvim-lspconfig]], false)
|
||||
-- Setup for: dashboard-nvim
|
||||
time([[Setup for dashboard-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14dashboard\18core.mappings\frequire\0", "setup", "dashboard-nvim")
|
||||
time([[Setup for dashboard-nvim]], false)
|
||||
time([[packadd for dashboard-nvim]], true)
|
||||
vim.cmd [[packadd dashboard-nvim]]
|
||||
time([[packadd for dashboard-nvim]], false)
|
||||
-- Setup for: vim-matchup
|
||||
time([[Setup for vim-matchup]], true)
|
||||
try_loadstring("\27LJ\2\nS\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\16vim-matchup\21packer_lazy_load\15core.utils\frequire\0", "setup", "vim-matchup")
|
||||
time([[Setup for vim-matchup]], false)
|
||||
-- Setup for: nvim-tree.lua
|
||||
time([[Setup for nvim-tree.lua]], true)
|
||||
try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rnvimtree\18core.mappings\frequire\0", "setup", "nvim-tree.lua")
|
||||
time([[Setup for nvim-tree.lua]], false)
|
||||
-- Setup for: nvim-comment
|
||||
time([[Setup for nvim-comment]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\fcomment\18core.mappings\frequire\0", "setup", "nvim-comment")
|
||||
time([[Setup for nvim-comment]], false)
|
||||
-- Setup for: bufferline.nvim
|
||||
time([[Setup for bufferline.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\15bufferline\18core.mappings\frequire\0", "setup", "bufferline.nvim")
|
||||
time([[Setup for bufferline.nvim]], false)
|
||||
-- Setup for: gitsigns.nvim
|
||||
time([[Setup for gitsigns.nvim]], true)
|
||||
try_loadstring("\27LJ\2\nU\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\18gitsigns.nvim\21packer_lazy_load\15core.utils\frequire\0", "setup", "gitsigns.nvim")
|
||||
time([[Setup for gitsigns.nvim]], false)
|
||||
-- Config for: lualine.nvim
|
||||
time([[Config for lualine.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27custom.configs.lualine\frequire\0", "config", "lualine.nvim")
|
||||
time([[Config for lualine.nvim]], false)
|
||||
-- Config for: trim.nvim
|
||||
time([[Config for trim.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n3\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\24custom.configs.trim\frequire\0", "config", "trim.nvim")
|
||||
time([[Config for trim.nvim]], false)
|
||||
-- Config for: dashboard-nvim
|
||||
time([[Config for dashboard-nvim]], true)
|
||||
require('plugins.configs.dashboard')
|
||||
time([[Config for dashboard-nvim]], false)
|
||||
-- Config for: which-key.nvim
|
||||
time([[Config for which-key.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n8\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\29custom.configs.which-key\frequire\0", "config", "which-key.nvim")
|
||||
time([[Config for which-key.nvim]], false)
|
||||
-- Load plugins in order defined by `after`
|
||||
time([[Sequenced loading]], true)
|
||||
vim.cmd [[ packadd fzf.vim ]]
|
||||
vim.cmd [[ packadd nvim-cmp ]]
|
||||
-- Config for: nvim-cmp
|
||||
require('plugins.configs.cmp')
|
||||
vim.cmd [[ packadd cmp-buffer ]]
|
||||
vim.cmd [[ packadd cmp-path ]]
|
||||
vim.cmd [[ packadd nvim-autopairs ]]
|
||||
-- Config for: nvim-autopairs
|
||||
require('plugins.configs.others').autopairs()
|
||||
vim.cmd [[ packadd LuaSnip ]]
|
||||
-- Config for: LuaSnip
|
||||
require('plugins.configs.others').luasnip()
|
||||
vim.cmd [[ packadd cmp-cmdline ]]
|
||||
vim.cmd [[ packadd cmp_luasnip ]]
|
||||
vim.cmd [[ packadd cmp-nvim-lsp ]]
|
||||
vim.cmd [[ packadd cmp-nvim-lua ]]
|
||||
time([[Sequenced loading]], false)
|
||||
|
||||
-- Command lazy-loads
|
||||
time([[Defining lazy-load commands]], true)
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeFocus lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
time([[Defining lazy-load commands]], false)
|
||||
|
||||
vim.cmd [[augroup packer_load_aucmds]]
|
||||
vim.cmd [[au!]]
|
||||
-- Event lazy-loads
|
||||
time([[Defining lazy-load event autocommands]], true)
|
||||
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'packer.nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'better-escape.nvim', 'friendly-snippets'}, { event = "InsertEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'nvim-treesitter', 'indent-blankline.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load event autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user