my ripoff of LazyVim/ upgrade to lazy.nvim is complete... for now
This commit is contained in:
parent
de19c7bc39
commit
1a984d2e0f
@ -3,10 +3,10 @@ if not status_ok then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local actions = require "telescope.actions"
|
local actions = require("telescope.actions")
|
||||||
local icons = require "chris.icons"
|
local icons = require("chris.icons")
|
||||||
|
|
||||||
telescope.setup {
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
||||||
prompt_prefix = icons.ui.Telescope .. " > ",
|
prompt_prefix = icons.ui.Telescope .. " > ",
|
||||||
@ -125,4 +125,4 @@ telescope.setup {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|||||||
@ -2,8 +2,6 @@ local opts = { noremap = true, silent = true }
|
|||||||
|
|
||||||
local map = vim.api.nvim_set_keymap
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
map("n", "<Space>", "", opts)
|
|
||||||
|
|
||||||
-- better up/down
|
-- better up/down
|
||||||
map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
backup = false, -- creates a backup file
|
backup = false, -- creates a backup file
|
||||||
clipboard = "unnamedplus", -- gives nvim access to clipboard
|
clipboard = "unnamedplus", -- gives nvim access to clipboard
|
||||||
|
|||||||
@ -17,28 +17,23 @@ require("lazy").setup({
|
|||||||
spec = "lazyvim.plugins",
|
spec = "lazyvim.plugins",
|
||||||
defaults = { lazy = true, version = "*" },
|
defaults = { lazy = true, version = "*" },
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
disabled_plugins = {
|
|
||||||
"gzip",
|
|
||||||
"matchit",
|
|
||||||
"matchparen",
|
|
||||||
"netrwPlugin",
|
|
||||||
"tarPlugin",
|
|
||||||
"tohtml",
|
|
||||||
"tutor",
|
|
||||||
"zipPlugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>L", "<cmd>:Lazy<cr>")
|
-- map leader and register keymap for Lazy.
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>L", "<cmd>:Lazy<cr>", { desc = "Lazy GUI" })
|
||||||
|
|
||||||
local colorscheme = "base16-gruvbox-dark-medium"
|
-- This might not be best, but it allows for easy resetting
|
||||||
|
ColorMe = function()
|
||||||
|
local colorscheme = "gruvbox-material"
|
||||||
|
|
||||||
local okay, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
local okay, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||||
|
|
||||||
if not okay then
|
if not okay then
|
||||||
vim.notify("Colorscheme " .. colorscheme .. " not found!")
|
vim.notify("Colorscheme " .. colorscheme .. " not found!")
|
||||||
|
vim.cmd("colorsheme habamax")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
ColorMe()
|
||||||
|
|||||||
@ -29,8 +29,6 @@ return {
|
|||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
else
|
|
||||||
-- fallback()
|
|
||||||
end
|
end
|
||||||
end, {
|
end, {
|
||||||
"i",
|
"i",
|
||||||
@ -39,8 +37,6 @@ return {
|
|||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
else
|
|
||||||
-- fallback()
|
|
||||||
end
|
end
|
||||||
end, {
|
end, {
|
||||||
"i",
|
"i",
|
||||||
|
|||||||
@ -2,7 +2,7 @@ return {
|
|||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opns = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "▎" },
|
add = { text = "▎" },
|
||||||
change = { text = "▎" },
|
change = { text = "▎" },
|
||||||
|
|||||||
@ -17,7 +17,7 @@ return {
|
|||||||
for name, section in pairs(sections) do
|
for name, section in pairs(sections) do
|
||||||
local left = name:sub(9, 10) < "x"
|
local left = name:sub(9, 10) < "x"
|
||||||
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
|
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
|
||||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
table.insert(section, pos * 2, { color = { fg = colors.white, bg = colors.white } })
|
||||||
end
|
end
|
||||||
for id, comp in ipairs(section) do
|
for id, comp in ipairs(section) do
|
||||||
if type(comp) ~= "table" then
|
if type(comp) ~= "table" then
|
||||||
@ -66,13 +66,13 @@ return {
|
|||||||
"diagnostics",
|
"diagnostics",
|
||||||
source = { "nvim" },
|
source = { "nvim" },
|
||||||
sections = { "error" },
|
sections = { "error" },
|
||||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
source = { "nvim" },
|
source = { "nvim" },
|
||||||
sections = { "warn" },
|
sections = { "warn" },
|
||||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||||
},
|
},
|
||||||
{ "filename", file_status = false, path = 1 },
|
{ "filename", file_status = false, path = 1 },
|
||||||
{ modified, color = { bg = colors.red } },
|
{ modified, color = { bg = colors.red } },
|
||||||
@ -106,7 +106,7 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_x = {},
|
lualine_x = {},
|
||||||
-- lualine_y = { search_result, 'filetype' },
|
-- lualine_y = { search_result, "filetype" },
|
||||||
lualine_y = { "filetype " },
|
lualine_y = { "filetype " },
|
||||||
lualine_z = { "%l:%c", "%p%%/%L" },
|
lualine_z = { "%l:%c", "%p%%/%L" },
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -3,7 +3,7 @@ local util = require("lazyvim.functions")
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
cmd = "Telescope",
|
event = "VeryLazy",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>/", util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
{ "<leader>/", util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
||||||
{ "<leader><space>", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
{ "<leader><space>", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
||||||
@ -57,6 +57,12 @@ return {
|
|||||||
selection_caret = " ",
|
selection_caret = " ",
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
|
["<C-j>"] = function(...)
|
||||||
|
return require("telescope.actions").move_selection_next(...)
|
||||||
|
end,
|
||||||
|
["<C-k>"] = function(...)
|
||||||
|
require("telescope.actions").move_selection_previous(...)
|
||||||
|
end,
|
||||||
["<c-t>"] = function(...)
|
["<c-t>"] = function(...)
|
||||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||||
end,
|
end,
|
||||||
|
|||||||
@ -65,8 +65,7 @@ return {
|
|||||||
{ "<leader>bl", "<cmd>CybuNext<cr>", desc = "Next Buffer" },
|
{ "<leader>bl", "<cmd>CybuNext<cr>", desc = "Next Buffer" },
|
||||||
{ "<leader>bh", "<cmd>CybuPrev<cr>", desc = "Prev Buffer" },
|
{ "<leader>bh", "<cmd>CybuPrev<cr>", desc = "Prev Buffer" },
|
||||||
},
|
},
|
||||||
config = function()
|
opts = {
|
||||||
require("cybu").setup({
|
|
||||||
position = {
|
position = {
|
||||||
relative_to = "win", -- win, editor, cursor
|
relative_to = "win", -- win, editor, cursor
|
||||||
anchor = "topright", -- topleft, topcenter, topright,
|
anchor = "topright", -- topleft, topcenter, topright,
|
||||||
@ -89,8 +88,7 @@ return {
|
|||||||
colored = true, -- enable color for web dev icons
|
colored = true, -- enable color for web dev icons
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
|
|||||||
@ -1,28 +1,15 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "BufEnter",
|
event = "VeryLazy",
|
||||||
config = function()
|
opts = {
|
||||||
local whichkey = require("which-key")
|
|
||||||
whichkey.setup({
|
|
||||||
plugins = {
|
plugins = {
|
||||||
marks = true, -- shows a list of your marks on ' and `
|
-- marks = true, -- shows a list of your marks on ' and `
|
||||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
-- registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||||
spelling = {
|
spelling = {
|
||||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
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?
|
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 = true, -- 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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
key_labels = {
|
key_labels = {
|
||||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||||
@ -37,30 +24,23 @@ return {
|
|||||||
scroll_down = "<C-d>", -- binding to scroll down inside the popup
|
scroll_down = "<C-d>", -- binding to scroll down inside the popup
|
||||||
scroll_up = "<C-u>", -- binding to scroll up inside the popup
|
scroll_up = "<C-u>", -- binding to scroll up inside the popup
|
||||||
},
|
},
|
||||||
window = {
|
-- window = {
|
||||||
border = "rounded", -- none, single, double, shadow
|
-- border = "rounded", -- none, single, double, shadow
|
||||||
position = "bottom", -- bottom, top
|
-- position = "bottom", -- bottom, top
|
||||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
-- margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
-- padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||||
winblend = 0,
|
-- 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 = "center", -- align columns left, center or right
|
||||||
|
-- },
|
||||||
},
|
},
|
||||||
layout = {
|
config = function(_, opts)
|
||||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
local whichkey = require("which-key")
|
||||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
whichkey.setup(opts)
|
||||||
spacing = 3, -- spacing between columns
|
|
||||||
align = "center", -- 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 = false, -- show help message on the command line when the popup is visible
|
|
||||||
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 leader_opts = {
|
local leader_opts = {
|
||||||
mode = { "n", "v" }, -- NORMAL/VISUAL mode
|
mode = { "n", "v" }, -- NORMAL/VISUAL mode
|
||||||
@ -75,6 +55,8 @@ return {
|
|||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
["g"] = { name = "+goto" },
|
["g"] = { name = "+goto" },
|
||||||
["m"] = { name = "+harpoon" },
|
["m"] = { name = "+harpoon" },
|
||||||
|
["]"] = { name = "+next" },
|
||||||
|
["["] = { name = "+previous" },
|
||||||
})
|
})
|
||||||
|
|
||||||
local leader_mappings = {
|
local leader_mappings = {
|
||||||
@ -89,8 +71,8 @@ return {
|
|||||||
N = { name = "+noice" },
|
N = { name = "+noice" },
|
||||||
o = { name = "+option" },
|
o = { name = "+option" },
|
||||||
|
|
||||||
H = { "<cmd>split<cr>", "split" },
|
H = { "<cmd>split<cr>", "Split" },
|
||||||
V = { "<cmd>vsplit<cr>", "vsplit" },
|
V = { "<cmd>vsplit<cr>", "V Split" },
|
||||||
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||||
P = { "<cmd>!opout %<cr><cr>", "Preview Document" },
|
P = { "<cmd>!opout %<cr><cr>", "Preview Document" },
|
||||||
q = { '<cmd>lua require("lazyvim.functions").smart_quit()<CR>', "Quit" },
|
q = { '<cmd>lua require("lazyvim.functions").smart_quit()<CR>', "Quit" },
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user