chore: stylua formatting update (#261)
* addded stylua config file * chore: formatted with stylua
This commit is contained in:
parent
4abf43aa99
commit
86903ab982
36 changed files with 1955 additions and 1987 deletions
|
|
@ -2,13 +2,11 @@ local present1, autopairs = pcall(require, "nvim-autopairs")
|
|||
local present2, autopairs_completion = pcall(require, "nvim-autopairs.completion.compe")
|
||||
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
autopairs.setup()
|
||||
autopairs_completion.setup(
|
||||
{
|
||||
map_cr = true,
|
||||
map_complete = true -- insert () func completion
|
||||
}
|
||||
)
|
||||
autopairs_completion.setup {
|
||||
map_cr = true,
|
||||
map_complete = true, -- insert () func completion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,19 @@
|
|||
-- autosave.nvim plugin disabled by default
|
||||
local present, autosave = pcall(require, "autosave")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
autosave.setup(
|
||||
{
|
||||
enabled = vim.g.auto_save, -- takes boolean value from init.lua
|
||||
execution_message = "autosaved at : " .. vim.fn.strftime("%H:%M:%S"),
|
||||
events = {"InsertLeave", "TextChanged"},
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
modifiable = true
|
||||
},
|
||||
write_all_buffers = false,
|
||||
on_off_commands = true,
|
||||
clean_command_line_interval = 2500
|
||||
}
|
||||
)
|
||||
autosave.setup {
|
||||
enabled = vim.g.auto_save, -- takes boolean value from init.lua
|
||||
execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S",
|
||||
events = { "InsertLeave", "TextChanged" },
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
modifiable = true,
|
||||
},
|
||||
write_all_buffers = false,
|
||||
on_off_commands = true,
|
||||
clean_command_line_interval = 2500,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,103 +3,103 @@ local colors = require(global_theme)
|
|||
|
||||
local present, bufferline = pcall(require, "bufferline")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
offsets = {{filetype = "NvimTree", text = "", padding = 1}},
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
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,
|
||||
separator_style = "thin",
|
||||
mappings = true,
|
||||
always_show_bufferline = true
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2
|
||||
},
|
||||
background = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2
|
||||
},
|
||||
-- buffers
|
||||
buffer_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2
|
||||
},
|
||||
buffer_selected = {
|
||||
guifg = colors.white,
|
||||
guibg = colors.black,
|
||||
gui = "bold"
|
||||
},
|
||||
-- tabs
|
||||
tab = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.one_bg3
|
||||
},
|
||||
tab_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.nord_blue
|
||||
},
|
||||
tab_close = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black
|
||||
},
|
||||
indicator_selected = {
|
||||
guifg = colors.black,
|
||||
guibg = colors.black
|
||||
},
|
||||
-- separators
|
||||
separator = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2
|
||||
},
|
||||
separator_visible = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2
|
||||
},
|
||||
-- modified
|
||||
modified = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2
|
||||
},
|
||||
modified_visible = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2
|
||||
},
|
||||
modified_selected = {
|
||||
guifg = colors.green,
|
||||
guibg = colors.black
|
||||
},
|
||||
-- close buttons
|
||||
options = {
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
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,
|
||||
separator_style = "thin",
|
||||
mappings = true,
|
||||
always_show_bufferline = true,
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
background = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
-- buffers
|
||||
buffer_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
buffer_selected = {
|
||||
guifg = colors.white,
|
||||
guibg = colors.black,
|
||||
gui = "bold",
|
||||
},
|
||||
-- tabs
|
||||
tab = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.one_bg3,
|
||||
},
|
||||
tab_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.nord_blue,
|
||||
},
|
||||
tab_close = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black,
|
||||
},
|
||||
indicator_selected = {
|
||||
guifg = colors.black,
|
||||
guibg = colors.black,
|
||||
},
|
||||
-- separators
|
||||
separator = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
separator_visible = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
-- modified
|
||||
modified = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
modified_visible = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
modified_selected = {
|
||||
guifg = colors.green,
|
||||
guibg = colors.black,
|
||||
},
|
||||
-- close buttons
|
||||
|
||||
close_button = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2
|
||||
},
|
||||
close_button_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2
|
||||
},
|
||||
close_button_selected = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black
|
||||
}
|
||||
}
|
||||
close_button = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
close_button_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
close_button_selected = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
local present, compe = pcall(require, "compe")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
compe.setup {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = "enable",
|
||||
throttle_time = 80,
|
||||
source_timeout = 200,
|
||||
incomplete_delay = 400,
|
||||
max_abbr_width = 100,
|
||||
max_kind_width = 100,
|
||||
max_menu_width = 100,
|
||||
documentation = true,
|
||||
source = {
|
||||
buffer = {kind = "", true},
|
||||
luasnip = {kind = "", true},
|
||||
nvim_lsp = true,
|
||||
nvim_lua = true
|
||||
}
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = "enable",
|
||||
throttle_time = 80,
|
||||
source_timeout = 200,
|
||||
incomplete_delay = 400,
|
||||
max_abbr_width = 100,
|
||||
max_kind_width = 100,
|
||||
max_menu_width = 100,
|
||||
documentation = true,
|
||||
source = {
|
||||
buffer = { kind = "", true },
|
||||
luasnip = { kind = "", true },
|
||||
nvim_lsp = true,
|
||||
nvim_lua = true,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,34 +7,34 @@ g.dashboard_disable_at_vimenter = 1 -- dashboard is disabled by default
|
|||
g.dashboard_disable_statusline = 1
|
||||
g.dashboard_default_executive = "telescope"
|
||||
g.dashboard_custom_header = {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
|
||||
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
|
||||
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
|
||||
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
|
||||
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
|
||||
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
|
||||
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
|
||||
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
|
||||
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
|
||||
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
|
||||
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
|
||||
" "
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
|
||||
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
|
||||
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
|
||||
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
|
||||
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
|
||||
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
|
||||
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
|
||||
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
|
||||
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
|
||||
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
|
||||
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
g.dashboard_custom_section = {
|
||||
a = {description = {" Find File SPC f f"}, command = "Telescope find_files"},
|
||||
b = {description = {" Recents SPC f o"}, command = "Telescope oldfiles"},
|
||||
c = {description = {" Find Word SPC f w"}, command = "Telescope live_grep"},
|
||||
d = {description = {"洛 New File SPC f n"}, command = "DashboardNewFile"},
|
||||
e = {description = {" Bookmarks SPC b m"}, command = "Telescope marks"},
|
||||
f = {description = {" Load Last Session SPC s l"}, command = "SessionLoad"}
|
||||
a = { description = { " Find File SPC f f" }, command = "Telescope find_files" },
|
||||
b = { description = { " Recents SPC f o" }, command = "Telescope oldfiles" },
|
||||
c = { description = { " Find Word SPC f w" }, command = "Telescope live_grep" },
|
||||
d = { description = { "洛 New File SPC f n" }, command = "DashboardNewFile" },
|
||||
e = { description = { " Bookmarks SPC b m" }, command = "Telescope marks" },
|
||||
f = { description = { " Load Last Session SPC s l" }, command = "SessionLoad" },
|
||||
}
|
||||
|
||||
g.dashboard_custom_footer = {
|
||||
" ",
|
||||
-- "NvChad Loaded " .. plugins_count .. " plugins",
|
||||
"NvChad v0.5"
|
||||
" ",
|
||||
-- "NvChad Loaded " .. plugins_count .. " plugins",
|
||||
"NvChad v0.5",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
local present, gitsigns = pcall(require, "gitsigns")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
signs = {
|
||||
add = {hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr"},
|
||||
change = {hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr"},
|
||||
delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"},
|
||||
topdelete = {hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr"},
|
||||
changedelete = {hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr"}
|
||||
},
|
||||
numhl = false,
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
buffer = 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>'
|
||||
},
|
||||
watch_index = {
|
||||
interval = 100
|
||||
},
|
||||
sign_priority = 5,
|
||||
status_formatter = nil -- Use default
|
||||
signs = {
|
||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||
delete = { hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
||||
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||
changedelete = { hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr" },
|
||||
},
|
||||
numhl = false,
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
buffer = 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>',
|
||||
},
|
||||
watch_index = {
|
||||
interval = 100,
|
||||
},
|
||||
sign_priority = 5,
|
||||
status_formatter = nil, -- Use default
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,122 +1,122 @@
|
|||
local present, icons = pcall(require, "nvim-web-devicons")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local global_theme = "themes/" .. vim.g.nvchad_theme
|
||||
local colors = require(global_theme)
|
||||
|
||||
icons.setup {
|
||||
override = {
|
||||
html = {
|
||||
icon = "",
|
||||
color = colors.baby_pink,
|
||||
name = "html"
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "css"
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "js"
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
color = colors.teal,
|
||||
name = "ts"
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "kt"
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "png"
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpg"
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpeg"
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp3"
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp4"
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "out"
|
||||
},
|
||||
Dockerfile = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "Dockerfile"
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
color = colors.pink,
|
||||
name = "rb"
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
color = colors.vibrant_green,
|
||||
name = "vue"
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "py"
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "toml"
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
color = colors.red,
|
||||
name = "lock"
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "zip"
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "xz"
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "deb"
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "rpm"
|
||||
},
|
||||
lua = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "lua"
|
||||
}
|
||||
}
|
||||
override = {
|
||||
html = {
|
||||
icon = "",
|
||||
color = colors.baby_pink,
|
||||
name = "html",
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "css",
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "js",
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
color = colors.teal,
|
||||
name = "ts",
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "kt",
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "png",
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpg",
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpeg",
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp3",
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp4",
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "out",
|
||||
},
|
||||
Dockerfile = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "Dockerfile",
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
color = colors.pink,
|
||||
name = "rb",
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
color = colors.vibrant_green,
|
||||
name = "vue",
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "py",
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "toml",
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
color = colors.red,
|
||||
name = "lock",
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "zip",
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "xz",
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "deb",
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "rpm",
|
||||
},
|
||||
lua = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "lua",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
local present1, lspconfig = pcall(require, "lspconfig")
|
||||
local present2, lspinstall = pcall(require, "lspinstall")
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
local opts = {noremap = true, silent = true}
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
-- Mappings.
|
||||
|
||||
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", "<C-k>", "<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", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<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", "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", "<C-k>", "<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", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<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)
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
elseif client.resolved_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
|
||||
end
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
elseif client.resolved_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
|
||||
end
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
|
@ -45,53 +45,53 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|||
-- lspInstall + lspconfig stuff
|
||||
|
||||
local function setup_servers()
|
||||
lspinstall.setup()
|
||||
local servers = lspinstall.installed_servers()
|
||||
lspinstall.setup()
|
||||
local servers = lspinstall.installed_servers()
|
||||
|
||||
for _, lang in pairs(servers) do
|
||||
if lang ~= "lua" then
|
||||
lspconfig[lang].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = vim.loop.cwd
|
||||
}
|
||||
elseif lang == "lua" then
|
||||
lspconfig[lang].setup {
|
||||
root_dir = vim.loop.cwd,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = {"vim"}
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
|
||||
},
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000
|
||||
},
|
||||
telemetry = {
|
||||
enable = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
for _, lang in pairs(servers) do
|
||||
if lang ~= "lua" then
|
||||
lspconfig[lang].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = vim.loop.cwd,
|
||||
}
|
||||
elseif lang == "lua" then
|
||||
lspconfig[lang].setup {
|
||||
root_dir = vim.loop.cwd,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
|
||||
},
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
setup_servers()
|
||||
|
||||
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
|
||||
lspinstall.post_install_hook = function()
|
||||
setup_servers() -- reload installed servers
|
||||
vim.cmd("bufdo e") -- triggers FileType autocmd that starts the server
|
||||
setup_servers() -- reload installed servers
|
||||
vim.cmd "bufdo e"
|
||||
end
|
||||
|
||||
-- replace the default lsp diagnostic symbols
|
||||
function lspSymbol(name, icon)
|
||||
vim.fn.sign_define("LspDiagnosticsSign" .. name, {text = icon, numhl = "LspDiagnosticsDefaul" .. name})
|
||||
vim.fn.sign_define("LspDiagnosticsSign" .. name, { text = icon, numhl = "LspDiagnosticsDefaul" .. name })
|
||||
end
|
||||
|
||||
lspSymbol("Error", "")
|
||||
|
|
@ -99,29 +99,25 @@ lspSymbol("Warning", "")
|
|||
lspSymbol("Information", "")
|
||||
lspSymbol("Hint", "")
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
||||
vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics,
|
||||
{
|
||||
virtual_text = {
|
||||
prefix = "",
|
||||
spacing = 0
|
||||
},
|
||||
signs = true,
|
||||
underline = true,
|
||||
-- set this to true if you want diagnostics to show in insert mode
|
||||
update_in_insert = false
|
||||
}
|
||||
)
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = {
|
||||
prefix = "",
|
||||
spacing = 0,
|
||||
},
|
||||
signs = true,
|
||||
underline = true,
|
||||
-- set this to true if you want diagnostics to show in insert mode
|
||||
update_in_insert = false,
|
||||
})
|
||||
|
||||
-- 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
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,72 +1,66 @@
|
|||
local present, luasnip = pcall(require, "luasnip")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col(".") - 1
|
||||
if col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
local col = vim.fn.col "." - 1
|
||||
if col == 0 or vim.fn.getline("."):sub(col, col):match "%s" then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
_G.tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-n>"
|
||||
elseif luasnip and luasnip.expand_or_jumpable() then
|
||||
return t "<Plug>luasnip-expand-or-jump"
|
||||
elseif check_back_space() then
|
||||
return t "<Tab>"
|
||||
else
|
||||
return vim.fn["compe#complete"]()
|
||||
end
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-n>"
|
||||
elseif luasnip and luasnip.expand_or_jumpable() then
|
||||
return t "<Plug>luasnip-expand-or-jump"
|
||||
elseif check_back_space() then
|
||||
return t "<Tab>"
|
||||
else
|
||||
return vim.fn["compe#complete"]()
|
||||
end
|
||||
end
|
||||
_G.s_tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-p>"
|
||||
elseif luasnip and luasnip.jumpable(-1) then
|
||||
return t "<Plug>luasnip-jump-prev"
|
||||
else
|
||||
return t "<S-Tab>"
|
||||
end
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-p>"
|
||||
elseif luasnip and luasnip.jumpable(-1) then
|
||||
return t "<Plug>luasnip-jump-prev"
|
||||
else
|
||||
return t "<S-Tab>"
|
||||
end
|
||||
end
|
||||
|
||||
_G.completions = function()
|
||||
local npairs
|
||||
if
|
||||
not pcall(
|
||||
function()
|
||||
npairs = require "nvim-autopairs"
|
||||
end
|
||||
)
|
||||
then
|
||||
return
|
||||
end
|
||||
local npairs
|
||||
if not pcall(function()
|
||||
npairs = require "nvim-autopairs"
|
||||
end) then
|
||||
return
|
||||
end
|
||||
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
return vim.fn["compe#confirm"]("<CR>")
|
||||
end
|
||||
end
|
||||
return npairs.check_break_line_char()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
return vim.fn["compe#confirm"] "<CR>"
|
||||
end
|
||||
end
|
||||
return npairs.check_break_line_char()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<CR>", "v:lua.completions()", {expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("i", "<CR>", "v:lua.completions()", { expr = true })
|
||||
|
||||
luasnip.config.set_config(
|
||||
{
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI"
|
||||
}
|
||||
)
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
}
|
||||
require("luasnip/loaders/from_vscode").load()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
local present, tree_c = pcall(require, "nvim-tree.config")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local tree_cb = tree_c.nvim_tree_callback
|
||||
|
|
@ -10,9 +10,9 @@ vim.o.termguicolors = true
|
|||
|
||||
g.nvim_tree_side = "left"
|
||||
g.nvim_tree_width = 25
|
||||
g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
||||
g.nvim_tree_ignore = { ".git", "node_modules", ".cache" }
|
||||
g.nvim_tree_gitignore = 1
|
||||
g.nvim_tree_auto_ignore_ft = {"dashboard"} -- don't open tree on specific fiypes.
|
||||
g.nvim_tree_auto_ignore_ft = { "dashboard" } -- don't open tree on specific fiypes.
|
||||
g.nvim_tree_auto_open = 0
|
||||
g.nvim_tree_auto_close = 0 -- closes tree when it's the last window
|
||||
g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened
|
||||
|
|
@ -21,7 +21,7 @@ g.nvim_tree_indent_markers = 1
|
|||
g.nvim_tree_hide_dotfiles = 1
|
||||
g.nvim_tree_git_hl = 1
|
||||
g.nvim_tree_highlight_opened_files = 0
|
||||
g.nvim_tree_root_folder_modifier = table.concat {":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??"}
|
||||
g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" }
|
||||
g.nvim_tree_tab_open = 0
|
||||
g.nvim_tree_allow_resize = 1
|
||||
g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names
|
||||
|
|
@ -30,66 +30,66 @@ g.nvim_tree_hijack_netrw = 0
|
|||
g.nvim_tree_update_cwd = 1
|
||||
|
||||
g.nvim_tree_show_icons = {
|
||||
git = 1,
|
||||
folders = 1,
|
||||
files = 1
|
||||
-- folder_arrows= 1
|
||||
git = 1,
|
||||
folders = 1,
|
||||
files = 1,
|
||||
-- folder_arrows= 1
|
||||
}
|
||||
g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌"
|
||||
},
|
||||
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 = "",
|
||||
open = "",
|
||||
empty = "", --
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = ""
|
||||
}
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
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 = "",
|
||||
open = "",
|
||||
empty = "", --
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
}
|
||||
|
||||
g.nvim_tree_bindings = {
|
||||
{key = {"<CR>", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")},
|
||||
{key = {"<2-RightMouse>", "<C-]>"}, cb = tree_cb("cd")},
|
||||
{key = "<C-v>", cb = tree_cb("vsplit")},
|
||||
{key = "<C-x>", cb = tree_cb("split")},
|
||||
{key = "<C-t>", cb = tree_cb("tabnew")},
|
||||
{key = "<", cb = tree_cb("prev_sibling")},
|
||||
{key = ">", cb = tree_cb("next_sibling")},
|
||||
{key = "P", cb = tree_cb("parent_node")},
|
||||
{key = "<BS>", cb = tree_cb("close_node")},
|
||||
{key = "<S-CR>", cb = tree_cb("close_node")},
|
||||
{key = "<Tab>", cb = tree_cb("preview")},
|
||||
{key = "K", cb = tree_cb("first_sibling")},
|
||||
{key = "J", cb = tree_cb("last_sibling")},
|
||||
{key = "I", cb = tree_cb("toggle_ignored")},
|
||||
{key = "H", cb = tree_cb("toggle_dotfiles")},
|
||||
{key = "R", cb = tree_cb("refresh")},
|
||||
{key = "a", cb = tree_cb("create")},
|
||||
{key = "d", cb = tree_cb("remove")},
|
||||
{key = "r", cb = tree_cb("rename")},
|
||||
{key = "<C->", cb = tree_cb("full_rename")},
|
||||
{key = "x", cb = tree_cb("cut")},
|
||||
{key = "c", cb = tree_cb("copy")},
|
||||
{key = "p", cb = tree_cb("paste")},
|
||||
{key = "y", cb = tree_cb("copy_name")},
|
||||
{key = "Y", cb = tree_cb("copy_path")},
|
||||
{key = "gy", cb = tree_cb("copy_absolute_path")},
|
||||
{key = "[c", cb = tree_cb("prev_git_item")},
|
||||
{key = "}c", cb = tree_cb("next_git_item")},
|
||||
{key = "-", cb = tree_cb("dir_up")},
|
||||
{key = "q", cb = tree_cb("close")},
|
||||
{key = "g?", cb = tree_cb("toggle_help")}
|
||||
{ key = { "<CR>", "o", "<2-LeftMouse>" }, cb = tree_cb "edit" },
|
||||
{ key = { "<2-RightMouse>", "<C-]>" }, cb = tree_cb "cd" },
|
||||
{ key = "<C-v>", cb = tree_cb "vsplit" },
|
||||
{ key = "<C-x>", cb = tree_cb "split" },
|
||||
{ key = "<C-t>", cb = tree_cb "tabnew" },
|
||||
{ key = "<", cb = tree_cb "prev_sibling" },
|
||||
{ key = ">", cb = tree_cb "next_sibling" },
|
||||
{ key = "P", cb = tree_cb "parent_node" },
|
||||
{ key = "<BS>", cb = tree_cb "close_node" },
|
||||
{ key = "<S-CR>", cb = tree_cb "close_node" },
|
||||
{ key = "<Tab>", cb = tree_cb "preview" },
|
||||
{ key = "K", cb = tree_cb "first_sibling" },
|
||||
{ key = "J", cb = tree_cb "last_sibling" },
|
||||
{ key = "I", cb = tree_cb "toggle_ignored" },
|
||||
{ key = "H", cb = tree_cb "toggle_dotfiles" },
|
||||
{ key = "R", cb = tree_cb "refresh" },
|
||||
{ key = "a", cb = tree_cb "create" },
|
||||
{ key = "d", cb = tree_cb "remove" },
|
||||
{ key = "r", cb = tree_cb "rename" },
|
||||
{ key = "<C->", cb = tree_cb "full_rename" },
|
||||
{ key = "x", cb = tree_cb "cut" },
|
||||
{ key = "c", cb = tree_cb "copy" },
|
||||
{ key = "p", cb = tree_cb "paste" },
|
||||
{ key = "y", cb = tree_cb "copy_name" },
|
||||
{ key = "Y", cb = tree_cb "copy_path" },
|
||||
{ key = "gy", cb = tree_cb "copy_absolute_path" },
|
||||
{ key = "[c", cb = tree_cb "prev_git_item" },
|
||||
{ key = "}c", cb = tree_cb "next_git_item" },
|
||||
{ key = "-", cb = tree_cb "dir_up" },
|
||||
{ key = "q", cb = tree_cb "close" },
|
||||
{ key = "g?", cb = tree_cb "toggle_help" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +1,71 @@
|
|||
local M = {}
|
||||
|
||||
M.colorizer = function()
|
||||
local present, colorizer = pcall(require, "colorizer")
|
||||
if present then
|
||||
colorizer.setup()
|
||||
vim.cmd("ColorizerReloadAllBuffers")
|
||||
end
|
||||
local present, colorizer = pcall(require, "colorizer")
|
||||
if present then
|
||||
colorizer.setup()
|
||||
vim.cmd "ColorizerReloadAllBuffers"
|
||||
end
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
local present, nvim_comment = pcall(require, "nvim_comment")
|
||||
if present then
|
||||
nvim_comment.setup()
|
||||
end
|
||||
local present, nvim_comment = pcall(require, "nvim_comment")
|
||||
if present then
|
||||
nvim_comment.setup()
|
||||
end
|
||||
end
|
||||
|
||||
M.escape = function()
|
||||
vim.g.better_escape_interval = 300
|
||||
vim.g.better_escape_shortcut = {"jk"}
|
||||
vim.g.better_escape_interval = 300
|
||||
vim.g.better_escape_shortcut = { "jk" }
|
||||
end
|
||||
|
||||
M.lspkind = function()
|
||||
local present, lspkind = pcall(require, "lspkind")
|
||||
if present then
|
||||
lspkind.init()
|
||||
end
|
||||
local present, lspkind = pcall(require, "lspkind")
|
||||
if present then
|
||||
lspkind.init()
|
||||
end
|
||||
end
|
||||
|
||||
M.neoscroll = function()
|
||||
pcall(
|
||||
function()
|
||||
require("neoscroll").setup()
|
||||
end
|
||||
)
|
||||
pcall(function()
|
||||
require("neoscroll").setup()
|
||||
end)
|
||||
end
|
||||
|
||||
M.blankline = function()
|
||||
vim.g.indentLine_enabled = 1
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
vim.g.indentLine_enabled = 1
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
|
||||
vim.g.indent_blankline_filetype_exclude = {"help", "terminal", "dashboard", "packer"}
|
||||
vim.g.indent_blankline_buftype_exclude = {"terminal"}
|
||||
vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard", "packer" }
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal" }
|
||||
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = false
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = false
|
||||
end
|
||||
|
||||
M.signature = function()
|
||||
local present, lspsignature = pcall(require, "lsp_signature")
|
||||
if present then
|
||||
lspsignature.setup(
|
||||
{
|
||||
bind = true,
|
||||
doc_lines = 2,
|
||||
floating_window = true,
|
||||
fix_pos = true,
|
||||
hint_enable = true,
|
||||
hint_prefix = " ",
|
||||
hint_scheme = "String",
|
||||
use_lspsaga = false,
|
||||
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
|
||||
local present, lspsignature = pcall(require, "lsp_signature")
|
||||
if present then
|
||||
lspsignature.setup {
|
||||
bind = true,
|
||||
doc_lines = 2,
|
||||
floating_window = true,
|
||||
fix_pos = true,
|
||||
hint_enable = true,
|
||||
hint_prefix = " ",
|
||||
hint_scheme = "String",
|
||||
use_lspsaga = false,
|
||||
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,12 +1,12 @@
|
|||
local present1, gl = pcall(require, "galaxyline")
|
||||
local present2, condition = pcall(require, "galaxyline.condition")
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local gls = gl.section
|
||||
|
||||
gl.short_line_list = {" "}
|
||||
gl.short_line_list = { " " }
|
||||
|
||||
local left_separator = "" -- or " "
|
||||
local right_separator = " " -- or ""
|
||||
|
|
@ -15,224 +15,224 @@ local global_theme = "themes/" .. vim.g.nvchad_theme
|
|||
local colors = require(global_theme)
|
||||
|
||||
gls.left[1] = {
|
||||
FirstElement = {
|
||||
provider = function()
|
||||
return "▋"
|
||||
end,
|
||||
highlight = {colors.nord_blue, colors.nord_blue}
|
||||
}
|
||||
FirstElement = {
|
||||
provider = function()
|
||||
return "▋"
|
||||
end,
|
||||
highlight = { colors.nord_blue, colors.nord_blue },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[2] = {
|
||||
statusIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
highlight = {colors.statusline_bg, colors.nord_blue},
|
||||
separator = right_separator .. " ",
|
||||
separator_highlight = {colors.nord_blue, colors.lightbg}
|
||||
}
|
||||
statusIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
highlight = { colors.statusline_bg, colors.nord_blue },
|
||||
separator = right_separator .. " ",
|
||||
separator_highlight = { colors.nord_blue, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[3] = {
|
||||
FileIcon = {
|
||||
provider = "FileIcon",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = {colors.white, colors.lightbg}
|
||||
}
|
||||
FileIcon = {
|
||||
provider = "FileIcon",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = { colors.white, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[4] = {
|
||||
FileName = {
|
||||
provider = function()
|
||||
local fileinfo = require('galaxyline.provider_fileinfo')
|
||||
return fileinfo.get_current_file_name("", "")
|
||||
end,
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = {colors.white, colors.lightbg},
|
||||
separator = right_separator,
|
||||
separator_highlight = {colors.lightbg, colors.lightbg2}
|
||||
}
|
||||
FileName = {
|
||||
provider = function()
|
||||
local fileinfo = require "galaxyline.provider_fileinfo"
|
||||
return fileinfo.get_current_file_name("", "")
|
||||
end,
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = { colors.white, colors.lightbg },
|
||||
separator = right_separator,
|
||||
separator_highlight = { colors.lightbg, colors.lightbg2 },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[5] = {
|
||||
current_dir = {
|
||||
provider = function()
|
||||
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
return " " .. dir_name .. " "
|
||||
end,
|
||||
highlight = {colors.grey_fg2, colors.lightbg2},
|
||||
separator = right_separator,
|
||||
separator_highlight = {colors.lightbg2, colors.statusline_bg}
|
||||
}
|
||||
current_dir = {
|
||||
provider = function()
|
||||
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
return " " .. dir_name .. " "
|
||||
end,
|
||||
highlight = { colors.grey_fg2, colors.lightbg2 },
|
||||
separator = right_separator,
|
||||
separator_highlight = { colors.lightbg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
local checkwidth = function()
|
||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||
if squeeze_width > 30 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||
if squeeze_width > 30 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
gls.left[6] = {
|
||||
DiffAdd = {
|
||||
provider = "DiffAdd",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = {colors.white, colors.statusline_bg}
|
||||
}
|
||||
DiffAdd = {
|
||||
provider = "DiffAdd",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.white, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[7] = {
|
||||
DiffModified = {
|
||||
provider = "DiffModified",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = {colors.grey_fg2, colors.statusline_bg}
|
||||
}
|
||||
DiffModified = {
|
||||
provider = "DiffModified",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[8] = {
|
||||
DiffRemove = {
|
||||
provider = "DiffRemove",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = {colors.grey_fg2, colors.statusline_bg}
|
||||
}
|
||||
DiffRemove = {
|
||||
provider = "DiffRemove",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[9] = {
|
||||
DiagnosticError = {
|
||||
provider = "DiagnosticError",
|
||||
icon = " ",
|
||||
highlight = {colors.red, colors.statusline_bg}
|
||||
}
|
||||
DiagnosticError = {
|
||||
provider = "DiagnosticError",
|
||||
icon = " ",
|
||||
highlight = { colors.red, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[10] = {
|
||||
DiagnosticWarn = {
|
||||
provider = "DiagnosticWarn",
|
||||
icon = " ",
|
||||
highlight = {colors.yellow, colors.statusline_bg}
|
||||
}
|
||||
DiagnosticWarn = {
|
||||
provider = "DiagnosticWarn",
|
||||
icon = " ",
|
||||
highlight = { colors.yellow, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[1] = {
|
||||
lsp_status = {
|
||||
provider = function()
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) ~= nil then
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return " " .. " " .. " LSP"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
else
|
||||
return ""
|
||||
lsp_status = {
|
||||
provider = function()
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) ~= nil then
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return " " .. " " .. " LSP"
|
||||
end
|
||||
end
|
||||
end,
|
||||
highlight = {colors.grey_fg2, colors.statusline_bg}
|
||||
}
|
||||
return ""
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[2] = {
|
||||
GitIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = {colors.grey_fg2, colors.statusline_bg},
|
||||
separator = " ",
|
||||
separator_highlight = {colors.statusline_bg, colors.statusline_bg}
|
||||
}
|
||||
GitIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
separator = " ",
|
||||
separator_highlight = { colors.statusline_bg, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[3] = {
|
||||
GitBranch = {
|
||||
provider = "GitBranch",
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = {colors.grey_fg2, colors.statusline_bg}
|
||||
}
|
||||
GitBranch = {
|
||||
provider = "GitBranch",
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
local mode_colors = {
|
||||
[110] = {"NORMAL", colors.red},
|
||||
[105] = {"INSERT", colors.dark_purple},
|
||||
[99] = {"COMMAND", colors.pink},
|
||||
[116] = {"TERMINAL", colors.green},
|
||||
[118] = {"VISUAL", colors.cyan},
|
||||
[22] = {"V-BLOCK", colors.cyan},
|
||||
[86] = {"V_LINE", colors.cyan},
|
||||
[82] = {"REPLACE", colors.orange},
|
||||
[115] = {"SELECT", colors.nord_blue},
|
||||
[83] = {"S-LINE", colors.nord_blue}
|
||||
[110] = { "NORMAL", colors.red },
|
||||
[105] = { "INSERT", colors.dark_purple },
|
||||
[99] = { "COMMAND", colors.pink },
|
||||
[116] = { "TERMINAL", colors.green },
|
||||
[118] = { "VISUAL", colors.cyan },
|
||||
[22] = { "V-BLOCK", colors.cyan },
|
||||
[86] = { "V_LINE", colors.cyan },
|
||||
[82] = { "REPLACE", colors.orange },
|
||||
[115] = { "SELECT", colors.nord_blue },
|
||||
[83] = { "S-LINE", colors.nord_blue },
|
||||
}
|
||||
|
||||
local mode = function(n)
|
||||
return mode_colors[vim.fn.mode():byte()][n]
|
||||
return mode_colors[vim.fn.mode():byte()][n]
|
||||
end
|
||||
|
||||
gls.right[4] = {
|
||||
left_round = {
|
||||
provider = function()
|
||||
vim.cmd("hi Galaxyleft_round guifg=" .. mode(2))
|
||||
return left_separator
|
||||
end,
|
||||
separator = " ",
|
||||
separator_highlight = {colors.statusline_bg, colors.statusline_bg},
|
||||
highlight = {"GalaxyViMode", colors.statusline_bg}
|
||||
}
|
||||
left_round = {
|
||||
provider = function()
|
||||
vim.cmd("hi Galaxyleft_round guifg=" .. mode(2))
|
||||
return left_separator
|
||||
end,
|
||||
separator = " ",
|
||||
separator_highlight = { colors.statusline_bg, colors.statusline_bg },
|
||||
highlight = { "GalaxyViMode", colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[5] = {
|
||||
viMode_icon = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2))
|
||||
return " "
|
||||
end,
|
||||
highlight = {colors.statusline_bg, colors.red}
|
||||
}
|
||||
viMode_icon = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2))
|
||||
return " "
|
||||
end,
|
||||
highlight = { colors.statusline_bg, colors.red },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[6] = {
|
||||
ViMode = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyViMode guifg=" .. mode(2))
|
||||
return " " .. mode(1) .. " "
|
||||
end,
|
||||
highlight = {"GalaxyViMode", colors.lightbg}
|
||||
}
|
||||
ViMode = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyViMode guifg=" .. mode(2))
|
||||
return " " .. mode(1) .. " "
|
||||
end,
|
||||
highlight = { "GalaxyViMode", colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[7] = {
|
||||
some_RoundIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
separator = left_separator,
|
||||
separator_highlight = {colors.green, colors.lightbg},
|
||||
highlight = {colors.lightbg, colors.green}
|
||||
}
|
||||
some_RoundIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
separator = left_separator,
|
||||
separator_highlight = { colors.green, colors.lightbg },
|
||||
highlight = { colors.lightbg, colors.green },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[8] = {
|
||||
line_percentage = {
|
||||
provider = function()
|
||||
local current_line = vim.fn.line(".")
|
||||
local total_line = vim.fn.line("$")
|
||||
line_percentage = {
|
||||
provider = function()
|
||||
local current_line = vim.fn.line "."
|
||||
local total_line = vim.fn.line "$"
|
||||
|
||||
if current_line == 1 then
|
||||
return " Top "
|
||||
elseif current_line == vim.fn.line("$") then
|
||||
return " Bot "
|
||||
end
|
||||
local result, _ = math.modf((current_line / total_line) * 100)
|
||||
return " " .. result .. "% "
|
||||
end,
|
||||
highlight = {colors.green, colors.lightbg}
|
||||
}
|
||||
if current_line == 1 then
|
||||
return " Top "
|
||||
elseif current_line == vim.fn.line "$" then
|
||||
return " Bot "
|
||||
end
|
||||
local result, _ = math.modf((current_line / total_line) * 100)
|
||||
return " " .. result .. "% "
|
||||
end,
|
||||
highlight = { colors.green, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,88 +1,82 @@
|
|||
local present, telescope = pcall(require, "telescope")
|
||||
if not present then
|
||||
return
|
||||
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 = "descending",
|
||||
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 = {},
|
||||
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`)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
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 = "descending",
|
||||
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 = {},
|
||||
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`)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- load the theme_switcher extension
|
||||
require("telescope").load_extension("themes")
|
||||
require("telescope").load_extension "themes"
|
||||
|
||||
if
|
||||
not pcall(
|
||||
function()
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("media_files")
|
||||
end
|
||||
)
|
||||
then
|
||||
-- This should only trigger when in need of PackerSync, so better do it
|
||||
print("After completion of PackerCompile, restart neovim.")
|
||||
-- Trigger packer compile on PackerComplete, so it properly waits for PackerSync
|
||||
vim.cmd 'autocmd User PackerComplete ++once lua print "Waiting for PackerCompile.." require("packer").compile()'
|
||||
vim.cmd 'autocmd User PackerCompileDone ++once echo "Packer Compile done, restart neovim."'
|
||||
require "pluginList"
|
||||
require("packer").update("telescope-fzf-native.nvim", "telescope-media-files.nvim")
|
||||
if not pcall(function()
|
||||
telescope.load_extension "fzf"
|
||||
telescope.load_extension "media_files"
|
||||
end) then
|
||||
-- This should only trigger when in need of PackerSync, so better do it
|
||||
print "After completion of PackerCompile, restart neovim."
|
||||
-- Trigger packer compile on PackerComplete, so it properly waits for PackerSync
|
||||
vim.cmd 'autocmd User PackerComplete ++once lua print "Waiting for PackerCompile.." require("packer").compile()'
|
||||
vim.cmd 'autocmd User PackerCompileDone ++once echo "Packer Compile done, restart neovim."'
|
||||
require "pluginList"
|
||||
require("packer").update("telescope-fzf-native.nvim", "telescope-media-files.nvim")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,47 +1,47 @@
|
|||
local present, toggleterm = pcall(require, "toggleterm")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup {
|
||||
-- size can be a number or function which is passed the current terminal
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
-- open_mapping = [[<C-\>]], -- mapping set in mappings.lua
|
||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||
shade_terminals = false,
|
||||
start_in_insert = true,
|
||||
-- insert_mappings = true, -- see 'open_mapping', not set on purpose
|
||||
-- whether or not the open mapping applies in insert mode
|
||||
persist_size = true,
|
||||
direction = 'vertical',
|
||||
close_on_exit = true, -- close the terminal window when the process exits
|
||||
-- This field is only relevant if direction is set to 'float'
|
||||
float_opts = {
|
||||
border = 'single',
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
}
|
||||
}
|
||||
-- size can be a number or function which is passed the current terminal
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
-- open_mapping = [[<C-\>]], -- mapping set in mappings.lua
|
||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||
shade_terminals = false,
|
||||
start_in_insert = true,
|
||||
-- insert_mappings = true, -- see 'open_mapping', not set on purpose
|
||||
-- whether or not the open mapping applies in insert mode
|
||||
persist_size = true,
|
||||
direction = "vertical",
|
||||
close_on_exit = true, -- close the terminal window when the process exits
|
||||
-- This field is only relevant if direction is set to 'float'
|
||||
float_opts = {
|
||||
border = "single",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
|
||||
_G.termW = Terminal:new {
|
||||
direction = "window",
|
||||
direction = "window",
|
||||
}
|
||||
|
||||
_G.termV = Terminal:new {
|
||||
direction = "vertical",
|
||||
direction = "vertical",
|
||||
}
|
||||
|
||||
_G.termH = Terminal:new {
|
||||
direction = "horizontal",
|
||||
direction = "horizontal",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
local present, ts_config = pcall(require, "nvim-treesitter.configs")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
ts_config.setup {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"lua"
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true
|
||||
}
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"lua",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,70 +1,68 @@
|
|||
local present, true_zen = pcall(require, "true-zen")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
true_zen.setup(
|
||||
{
|
||||
ui = {
|
||||
bottom = {
|
||||
laststatus = 0,
|
||||
ruler = false,
|
||||
showmode = false,
|
||||
showcmd = false,
|
||||
cmdheight = 1
|
||||
},
|
||||
top = {
|
||||
showtabline = 0
|
||||
},
|
||||
left = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "no"
|
||||
}
|
||||
},
|
||||
modes = {
|
||||
ataraxis = {
|
||||
left_padding = 32,
|
||||
right_padding = 32,
|
||||
top_padding = 1,
|
||||
bottom_padding = 1,
|
||||
ideal_writing_area_width = {0},
|
||||
auto_padding = true,
|
||||
keep_default_fold_fillchars = true,
|
||||
custome_bg = "",
|
||||
bg_configuration = true,
|
||||
affected_higroups = {
|
||||
NonText = {},
|
||||
FoldColumn = {},
|
||||
ColorColumn = {},
|
||||
VertSplit = {},
|
||||
StatusLine = {},
|
||||
StatusLineNC = {},
|
||||
SignColumn = {}
|
||||
}
|
||||
},
|
||||
focus = {
|
||||
margin_of_error = 5,
|
||||
focus_method = "experimental"
|
||||
}
|
||||
},
|
||||
integrations = {
|
||||
vim_gitgutter = false,
|
||||
galaxyline = true,
|
||||
tmux = false,
|
||||
gitsigns = false,
|
||||
nvim_bufferline = true,
|
||||
limelight = false,
|
||||
vim_airline = false,
|
||||
vim_powerline = false,
|
||||
vim_signify = false,
|
||||
express_line = false,
|
||||
lualine = false
|
||||
},
|
||||
misc = {
|
||||
on_off_commands = false,
|
||||
ui_elements_commands = false,
|
||||
cursor_by_mode = false
|
||||
}
|
||||
}
|
||||
)
|
||||
true_zen.setup {
|
||||
ui = {
|
||||
bottom = {
|
||||
laststatus = 0,
|
||||
ruler = false,
|
||||
showmode = false,
|
||||
showcmd = false,
|
||||
cmdheight = 1,
|
||||
},
|
||||
top = {
|
||||
showtabline = 0,
|
||||
},
|
||||
left = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "no",
|
||||
},
|
||||
},
|
||||
modes = {
|
||||
ataraxis = {
|
||||
left_padding = 32,
|
||||
right_padding = 32,
|
||||
top_padding = 1,
|
||||
bottom_padding = 1,
|
||||
ideal_writing_area_width = { 0 },
|
||||
auto_padding = true,
|
||||
keep_default_fold_fillchars = true,
|
||||
custome_bg = "",
|
||||
bg_configuration = true,
|
||||
affected_higroups = {
|
||||
NonText = {},
|
||||
FoldColumn = {},
|
||||
ColorColumn = {},
|
||||
VertSplit = {},
|
||||
StatusLine = {},
|
||||
StatusLineNC = {},
|
||||
SignColumn = {},
|
||||
},
|
||||
},
|
||||
focus = {
|
||||
margin_of_error = 5,
|
||||
focus_method = "experimental",
|
||||
},
|
||||
},
|
||||
integrations = {
|
||||
vim_gitgutter = false,
|
||||
galaxyline = true,
|
||||
tmux = false,
|
||||
gitsigns = false,
|
||||
nvim_bufferline = true,
|
||||
limelight = false,
|
||||
vim_airline = false,
|
||||
vim_powerline = false,
|
||||
vim_signify = false,
|
||||
express_line = false,
|
||||
lualine = false,
|
||||
},
|
||||
misc = {
|
||||
on_off_commands = false,
|
||||
ui_elements_commands = false,
|
||||
cursor_by_mode = false,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue