getting there
This commit is contained in:
parent
62f9d0c757
commit
4ef2b18c5d
@ -1,2 +1,2 @@
|
||||
--require "lazy" -- my config based on folkes LazyVim starter
|
||||
require("chris") -- my config based on Christian Chiarullis work
|
||||
require "lazyvim" -- my config based on folkes LazyVim starter
|
||||
-- require("chris") -- my config based on Christian Chiarullis work
|
||||
|
||||
@ -8,11 +8,11 @@ if not config_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "chris.icons"
|
||||
local icons = require("chris.icons")
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup {
|
||||
nvim_tree.setup({
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
@ -101,9 +101,9 @@ nvim_tree.setup {
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
|
||||
{ key = "h", cb = tree_cb("close_node") },
|
||||
{ key = "v", cb = tree_cb("vsplit") },
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
@ -112,6 +112,6 @@ nvim_tree.setup {
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- gives nvim access to clipboard
|
||||
cmdheight = 1, -- more space in nvim cmd line
|
||||
completeopt = { "menuone", "noselect" }, -- cmp related
|
||||
conceallevel = 3, -- don't hide `` in md
|
||||
fileencoding = "utf-8",
|
||||
hlsearch = false,
|
||||
ignorecase = true,
|
||||
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
|
||||
pumheight = 10, -- popup menu height
|
||||
showmode = true,
|
||||
smartcase = true,
|
||||
smartindent = true,
|
||||
splitbelow = true,
|
||||
splitright = true,
|
||||
swapfile = false,
|
||||
termguicolors = true,
|
||||
timeoutlen = 500,
|
||||
ttimeoutlen = 10,
|
||||
undofile = true,
|
||||
updatetime = 100,
|
||||
writebackup = false,
|
||||
expandtab = true, -- use spaces instead of tab
|
||||
shiftwidth = 4, -- insert 4 spaces for indentation
|
||||
tabstop = 4, -- insert 4 spaces for tab
|
||||
cursorline = false,
|
||||
number = true,
|
||||
laststatus = 3,
|
||||
showcmd = false,
|
||||
ruler = false,
|
||||
relativenumber = true,
|
||||
numberwidth = 2,
|
||||
signcolumn = "yes",
|
||||
wrap = false,
|
||||
scrolloff = 8,
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17",
|
||||
title = true,
|
||||
spelllang = "en_us",
|
||||
autowrite = true,
|
||||
confirm = true,
|
||||
formatoptions = "jcroqlnt", -- tcqj
|
||||
grepformat = "%f:%l:%c:%m",
|
||||
grepprg = "rg --vimgrep",
|
||||
guifont = "FiraCode Nerd Font:h11",
|
||||
|
||||
}
|
||||
|
||||
vim.opt.fillchars = vim.opt.fillchars + 'eob: '
|
||||
|
||||
vim.opt.shortmess:append "c"
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
||||
vim.cmd "set colorcolumn=80"
|
||||
vim.cmd [[set iskeyword+=-]]
|
||||
|
||||
-- fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
@ -1,33 +0,0 @@
|
||||
local function load(name)
|
||||
local Util = require("lazy.core.util")
|
||||
-- always load lazyvim, then user file
|
||||
for _, mod in ipairs({ "lazy.config." .. name, "config." .. name }) do
|
||||
Util.try(function()
|
||||
require(mod)
|
||||
end, {
|
||||
msg = "Failed loading " .. mod,
|
||||
on_error = function(msg)
|
||||
local modpath = require("lazy.core.cache").find(mod)
|
||||
if modpath then
|
||||
Util.error(msg)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- load options here, before lazy init while sourcing plugin modules
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
load("options")
|
||||
|
||||
-- autocmds and keymaps can wait to load
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
load("autocmds")
|
||||
load("keymaps")
|
||||
end,
|
||||
})
|
||||
|
||||
return {}
|
||||
@ -1,268 +0,0 @@
|
||||
local util = require"lazy.functions"
|
||||
|
||||
return {
|
||||
{
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
config = function()
|
||||
local nvim_tree_config = require"nvim-tree.config"
|
||||
local icons = require "user.icons"
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup {
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
ignore_ft_on_setup = {
|
||||
"alpha",
|
||||
},
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = icons.ui.ArrowOpen,
|
||||
arrow_closed = icons.ui.ArrowClosed,
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Information,
|
||||
warning = icons.diagnostics.Warning,
|
||||
error = icons.diagnostics.Error,
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
keys = {
|
||||
{ "<leader>/", util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
||||
{ "<leader><space>", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
||||
{ "<leader>ff", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", util.telescope("find_files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
{ "<leader>ha", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>hc", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>hf", "<cmd>Telescope filetypes<cr>", desc = "File Types" },
|
||||
{ "<leader>hh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>hk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>hm", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>ho", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>hs", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>ht", "<cmd>Telescope builtin<cr>", desc = "Telescope" },
|
||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>sg", util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{
|
||||
"<leader>ss",
|
||||
util.telescope("lsp_document_symbols", {
|
||||
symbols = {
|
||||
"Class",
|
||||
"Function",
|
||||
"Method",
|
||||
"Constructor",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Struct",
|
||||
"Trait",
|
||||
"Field",
|
||||
"Property",
|
||||
},
|
||||
}),
|
||||
desc = "Goto Symbol",
|
||||
},
|
||||
},
|
||||
config = {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-t>"] = function(...)
|
||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||
end,
|
||||
["<C-i>"] = function()
|
||||
util.telescope("find_files", { no_ignore = true })()
|
||||
end,
|
||||
["<C-h>"] = function()
|
||||
util.telescope("find_files", { hidden = true })()
|
||||
end,
|
||||
["<C-Down>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_next(...)
|
||||
end,
|
||||
["<C-Up>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_prev(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
wk.setup({
|
||||
plugins = { spelling = true },
|
||||
key_labels = { ["<leader>"] = "SPC" },
|
||||
})
|
||||
wk.register({
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>h"] = { name = "+help" },
|
||||
["<leader>n"] = { name = "+noice" },
|
||||
["<leader>o"] = { name = "+open" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>t"] = { name = "+toggle" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
require("illuminate").configure({ delay = 200 })
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", },
|
||||
{ "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
config = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||
event = "BufReadPost",
|
||||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xtt", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xT", "<cmd>TodoTelescope<cr>", desc = "Todo Telescope" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require"Comment".setup({})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
config = {
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
{ "<leader>nl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
{ "<leader>nh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
{ "<leader>na", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true },
|
||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,274 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-lua/popup.nvim",
|
||||
},
|
||||
{
|
||||
"folke/neodev.nvim",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
local icons = require "user.icons"
|
||||
require"notify".setup {
|
||||
-- Animation style (see below for details)
|
||||
stages = "fade_in_slide_out",
|
||||
|
||||
-- Function called when a new window is opened, use for changing win settings/config
|
||||
on_open = nil,
|
||||
|
||||
-- Function called when a window is closed
|
||||
on_close = nil,
|
||||
|
||||
-- Render function for notifications. See notify-render()
|
||||
render = "default",
|
||||
|
||||
-- Default timeout for notifications
|
||||
timeout = 2000,
|
||||
|
||||
-- For stages that change opacity this is treated as the highlight behind the window
|
||||
-- Set this to either a highlight group or an RGB hex value e.g. "#000000"
|
||||
background_colour = "Normal",
|
||||
|
||||
-- Minimum width for notification windows
|
||||
minimum_width = 10,
|
||||
|
||||
-- Icons for the different levels
|
||||
icons = {
|
||||
ERROR = icons.diagnostics.Error,
|
||||
WARN = icons.diagnostics.Warning,
|
||||
INFO = icons.diagnostics.Information,
|
||||
DEBUG = icons.ui.Bug,
|
||||
TRACE = icons.ui.Pencil,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"moll/vim-bbye",
|
||||
},
|
||||
{
|
||||
"lewis6991/impatient.nvim",
|
||||
config = function()
|
||||
require"impatient".enable_profile()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ghillb/cybu.nvim",
|
||||
config = function()
|
||||
require"cybu".setup({
|
||||
position = {
|
||||
relative_to = "win", -- win, editor, cursor
|
||||
anchor = "topright", -- topleft, topcenter, topright,
|
||||
-- centerleft, center, centerright,
|
||||
-- bottomleft, bottomcenter, bottomright
|
||||
-- vertical_offset = 10, -- vertical offset from anchor in lines
|
||||
-- horizontal_offset = 0, -- vertical offset from anchor in columns
|
||||
-- max_win_height = 5, -- height of cybu window in lines
|
||||
-- max_win_width = 0.5, -- integer for absolute in columns
|
||||
-- float for relative to win/editor width
|
||||
},
|
||||
display_time = 1750, -- time the cybu window is displayed
|
||||
style = {
|
||||
separator = " ", -- string used as separator
|
||||
prefix = "…", -- string used as prefix for truncated paths
|
||||
padding = 1, -- left & right padding in number of spaces
|
||||
hide_buffer_id = true,
|
||||
devicons = {
|
||||
enabled = true, -- enable or disable web dev icons
|
||||
colored = true, -- enable color for web dev icons
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mbbill/undotree",
|
||||
},
|
||||
{
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
{
|
||||
"kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"text"
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
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 = false
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
|
||||
require"indent_blankline".setup({
|
||||
show_current_context = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require"nvim-autopairs".setup({
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
ignore_next_char = "[%w%.*]", -- don't place pair when cursor sits in front of any char
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"preservim/vim-markdown",
|
||||
},
|
||||
{
|
||||
"nacro90/numb.nvim",
|
||||
config = function()
|
||||
require"numb".setup({
|
||||
show_numbers = true, -- enable 'number' for the window while peeking
|
||||
show_cursorline = true, -- enable 'cursorline' for window wdile peeking
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"andymass/vim-matchup",
|
||||
},
|
||||
{
|
||||
"junegunn/vim-slash",
|
||||
},
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
config = function()
|
||||
require"zen-mode".setup({
|
||||
window = {
|
||||
backdrop = 1,
|
||||
height = 0.9,
|
||||
width = 80,
|
||||
options = {
|
||||
signcolumn = "no",
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
cursorline = true,
|
||||
cursorcolumn = false, -- disable cursor column
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
gitsigns = { enabled = false },
|
||||
tmux = { enabled = false },
|
||||
twilight = { enabled = false },
|
||||
},
|
||||
on_open = function()
|
||||
vim.g.cmp_active = false
|
||||
vim.cmd [[LspStop]]
|
||||
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
if vim.fn.exists("#" .. "_winbar") == 1 then
|
||||
vim.cmd("au! " .. "_winbar")
|
||||
end
|
||||
end,
|
||||
on_close = function()
|
||||
vim.g.cmp_active = true
|
||||
vim.cmd [[LspStart]]
|
||||
require("user.winbar").create_winbar()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
},
|
||||
{
|
||||
"danymat/neogen",
|
||||
config = function()
|
||||
require"neogen".setup({
|
||||
enabled = true,
|
||||
input_after_comment = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"monaqa/dial.nvim",
|
||||
config = function()
|
||||
local dial_config = require"dial.config"
|
||||
|
||||
local y = "2024/05/29"
|
||||
|
||||
local augend = require "dial.augend"
|
||||
dial_config.augends:register_group {
|
||||
default = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.constant.new { elements = { "let", "const" } },
|
||||
},
|
||||
visual = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
augend.constant.alias.alpha,
|
||||
augend.constant.alias.Alpha,
|
||||
},
|
||||
mygroup = {
|
||||
augend.constant.new {
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "True", "False" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "public", "private" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "&&", "||" },
|
||||
word = false,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.)
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.semver.alias.semver
|
||||
},
|
||||
}
|
||||
|
||||
local map = require "dial.map"
|
||||
|
||||
-- change augends in VISUAL mode
|
||||
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal "visual", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal "visual", { noremap = true })
|
||||
|
||||
vim.cmd [[
|
||||
" enable only for specific FileType
|
||||
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
|
||||
]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
},
|
||||
}
|
||||
@ -2,6 +2,8 @@ local opts = { noremap = true, silent = true }
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
map("n", "<Space>", "", opts)
|
||||
|
||||
-- NORMAL
|
||||
-- Move text up and down
|
||||
map("n", "<C-k>", "<ESC>:m .-2<CR>==", opts)
|
||||
64
.config/nvim/lua/lazyvim/config/options.lua
Normal file
64
.config/nvim/lua/lazyvim/config/options.lua
Normal file
@ -0,0 +1,64 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- gives nvim access to clipboard
|
||||
cmdheight = 1, -- more space in nvim cmd line
|
||||
completeopt = { "menuone", "noselect" }, -- cmp related
|
||||
conceallevel = 3, -- don't hide `` in md
|
||||
fileencoding = "utf-8",
|
||||
hlsearch = false,
|
||||
ignorecase = true,
|
||||
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
|
||||
pumheight = 10, -- popup menu height
|
||||
showmode = true,
|
||||
smartcase = true,
|
||||
smartindent = true,
|
||||
splitbelow = true,
|
||||
splitright = true,
|
||||
swapfile = false,
|
||||
termguicolors = true,
|
||||
timeoutlen = 500,
|
||||
ttimeoutlen = 10,
|
||||
undofile = true,
|
||||
updatetime = 100,
|
||||
writebackup = false,
|
||||
expandtab = true, -- use spaces instead of tab
|
||||
shiftwidth = 4, -- insert 4 spaces for indentation
|
||||
tabstop = 4, -- insert 4 spaces for tab
|
||||
cursorline = false,
|
||||
number = true,
|
||||
laststatus = 3,
|
||||
showcmd = false,
|
||||
ruler = false,
|
||||
relativenumber = true,
|
||||
numberwidth = 2,
|
||||
signcolumn = "yes",
|
||||
wrap = false,
|
||||
scrolloff = 8,
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17",
|
||||
title = true,
|
||||
spelllang = "en_us",
|
||||
autowrite = true,
|
||||
confirm = true,
|
||||
formatoptions = "jcroqlnt", -- tcqj
|
||||
grepformat = "%f:%l:%c:%m",
|
||||
grepprg = "rg --vimgrep",
|
||||
}
|
||||
|
||||
vim.opt.fillchars = vim.opt.fillchars + "eob: "
|
||||
|
||||
vim.opt.shortmess:append("c")
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd("set whichwrap+=<,>,[,],h,l")
|
||||
vim.cmd("set colorcolumn=80")
|
||||
vim.cmd([[set iskeyword+=-]])
|
||||
|
||||
-- fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
@ -14,7 +14,7 @@ end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = "lazy.plugins",
|
||||
spec = "lazyvim.plugins",
|
||||
defaults = { lazy = true, version = "*" },
|
||||
checker = { enabled = true },
|
||||
performance = {
|
||||
@ -35,4 +35,10 @@ require("lazy").setup({
|
||||
|
||||
vim.keymap.set("n", "<leader>l", "<cmd>:Lazy<cr>")
|
||||
|
||||
vim.cmd("colorscheme base16-gruvbox-dark-medium")
|
||||
local colorscheme = "base16-gruvbox-dark-medium"
|
||||
|
||||
local okay, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
|
||||
if not okay then
|
||||
vim.notify("Colorscheme " .. colorscheme .. " not found!")
|
||||
end
|
||||
@ -36,9 +36,9 @@ return {
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
local icons = require("lazy.config.icons").kinds
|
||||
local icons = require("lazyvim.config.icons").kind
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
item.kind = icons[item.kind] .. " " .. item.kind
|
||||
end
|
||||
return item
|
||||
end,
|
||||
33
.config/nvim/lua/lazyvim/plugins/config.lua
Normal file
33
.config/nvim/lua/lazyvim/plugins/config.lua
Normal file
@ -0,0 +1,33 @@
|
||||
local function load(name)
|
||||
local Util = require("lazy.core.util")
|
||||
-- always load lazyvim, then user file
|
||||
for _, mod in ipairs({ "lazyvim.config." .. name, "config." .. name }) do
|
||||
Util.try(function()
|
||||
require(mod)
|
||||
end, {
|
||||
msg = "Failed loading " .. mod,
|
||||
on_error = function(msg)
|
||||
local modpath = require("lazy.core.cache").find(mod)
|
||||
if modpath then
|
||||
Util.error(msg)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- load options here, before lazy init while sourcing plugin modules
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
load("options")
|
||||
|
||||
-- autocmds and keymaps can wait to load
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
load("autocmds")
|
||||
load("keymaps")
|
||||
end,
|
||||
})
|
||||
|
||||
return {}
|
||||
5
.config/nvim/lua/lazyvim/plugins/core.lua
Normal file
5
.config/nvim/lua/lazyvim/plugins/core.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
{
|
||||
"folke/lazy.nvim"
|
||||
},
|
||||
}
|
||||
228
.config/nvim/lua/lazyvim/plugins/editor.lua
Normal file
228
.config/nvim/lua/lazyvim/plugins/editor.lua
Normal file
@ -0,0 +1,228 @@
|
||||
local util = require("lazyvim.functions")
|
||||
|
||||
return {
|
||||
{
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
cmd = "NvimTreeToggle",
|
||||
config = function()
|
||||
local nvim_tree = require("nvim-tree")
|
||||
local nvim_tree_config = require("nvim-tree.config")
|
||||
local icons = require("lazyvim.config.icons")
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup({
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
ignore_ft_on_setup = {
|
||||
"alpha",
|
||||
},
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = icons.ui.ArrowOpen,
|
||||
arrow_closed = icons.ui.ArrowClosed,
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Information,
|
||||
warning = icons.diagnostics.Warning,
|
||||
error = icons.diagnostics.Error,
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
|
||||
{ key = "h", cb = tree_cb("close_node") },
|
||||
{ key = "v", cb = tree_cb("vsplit") },
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
keys = {
|
||||
{ "<leader>/", util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
||||
{ "<leader><space>", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
||||
{ "<leader>ff", util.telescope("find_files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", util.telescope("find_files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
{ "<leader>ha", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>hc", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>hf", "<cmd>Telescope filetypes<cr>", desc = "File Types" },
|
||||
{ "<leader>hh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>hk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>hm", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>ho", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>hs", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>ht", "<cmd>Telescope builtin<cr>", desc = "Telescope" },
|
||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>sg", util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{
|
||||
"<leader>ss",
|
||||
util.telescope("lsp_document_symbols", {
|
||||
symbols = {
|
||||
"Class",
|
||||
"Function",
|
||||
"Method",
|
||||
"Constructor",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Struct",
|
||||
"Trait",
|
||||
"Field",
|
||||
"Property",
|
||||
},
|
||||
}),
|
||||
desc = "Goto Symbol",
|
||||
},
|
||||
},
|
||||
config = {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-t>"] = function(...)
|
||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||
end,
|
||||
["<C-i>"] = function()
|
||||
util.telescope("find_files", { no_ignore = true })()
|
||||
end,
|
||||
["<C-h>"] = function()
|
||||
util.telescope("find_files", { hidden = true })()
|
||||
end,
|
||||
["<C-Down>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_next(...)
|
||||
end,
|
||||
["<C-Up>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_prev(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
config = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||
event = "BufReadPost",
|
||||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xtt", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xT", "<cmd>TodoTelescope<cr>", desc = "Todo Telescope" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require("Comment").setup({})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@ -36,13 +36,13 @@ return {
|
||||
|
||||
config = function(plugin)
|
||||
-- setup formatting and keymaps
|
||||
require("lazy.functions").on_attach(function(client, buffer)
|
||||
require("lazy.plugins.lsp.format").on_attach(client, buffer)
|
||||
require("lazy.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
require("lazyvim.functions").on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
end)
|
||||
|
||||
-- diagnostics
|
||||
for name, icon in pairs(require("lazy.config.icons").diagnostics) do
|
||||
for name, icon in pairs(require("lazyvim.config.icons").diagnostics) do
|
||||
name = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
@ -21,7 +21,7 @@ function M.on_attach(client, buffer)
|
||||
self:map("[w", M.diagnostic_goto(false, "WARNING"), { desc = "Prev Warning" })
|
||||
self:map("<leader>ca", vim.lsp.buf.code_action, { desc = "Code Action", mode = { "n", "v" }, has = "codeAction" })
|
||||
|
||||
local format = require("lazy.plugins.lsp.format").format
|
||||
local format = require("lazyvim.plugins.lsp.format").format
|
||||
self:map("<leader>cf", format, { desc = "Format Document", has = "documentFormatting" })
|
||||
self:map("<leader>cf", format, { desc = "Format Range", mode = "v", has = "documentRangeFormatting" })
|
||||
self:map("<leader>cr", M.rename, { expr = true, desc = "Rename", has = "rename" })
|
||||
28
.config/nvim/lua/lazyvim/plugins/noice.lua
Normal file
28
.config/nvim/lua/lazyvim/plugins/noice.lua
Normal file
@ -0,0 +1,28 @@
|
||||
return {
|
||||
{
|
||||
-- "folke/noice.nvim",
|
||||
-- event = "VeryLazy",
|
||||
-- config = {
|
||||
-- lsp = {
|
||||
-- override = {
|
||||
-- ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
-- ["vim.lsp.util.stylize_markdown"] = true,
|
||||
-- },
|
||||
-- },
|
||||
-- presets = {
|
||||
-- bottom_search = true,
|
||||
-- command_palette = true,
|
||||
-- long_message_to_split = true,
|
||||
-- },
|
||||
-- },
|
||||
-- -- stylua: ignore
|
||||
-- keys = {
|
||||
-- { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
-- { "<leader>nl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
-- { "<leader>nh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
-- { "<leader>na", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
-- { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true },
|
||||
-- { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
287
.config/nvim/lua/lazyvim/plugins/utility.lua
Normal file
287
.config/nvim/lua/lazyvim/plugins/utility.lua
Normal file
@ -0,0 +1,287 @@
|
||||
return {
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
require("illuminate").configure({ delay = 200 })
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", },
|
||||
{ "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lua/popup.nvim",
|
||||
},
|
||||
{
|
||||
"folke/neodev.nvim",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
local icons = require("lazyvim.config.icons")
|
||||
require("notify").setup({
|
||||
-- Animation style (see below for details)
|
||||
stages = "fade_in_slide_out",
|
||||
|
||||
-- Function called when a new window is opened, use for changing win settings/config
|
||||
on_open = nil,
|
||||
|
||||
-- Function called when a window is closed
|
||||
on_close = nil,
|
||||
|
||||
-- Render function for notifications. See notify-render()
|
||||
render = "default",
|
||||
|
||||
-- Default timeout for notifications
|
||||
timeout = 2000,
|
||||
|
||||
-- For stages that change opacity this is treated as the highlight behind the window
|
||||
-- Set this to either a highlight group or an RGB hex value e.g. "#000000"
|
||||
background_colour = "Normal",
|
||||
|
||||
-- Minimum width for notification windows
|
||||
minimum_width = 10,
|
||||
|
||||
-- Icons for the different levels
|
||||
icons = {
|
||||
ERROR = icons.diagnostics.Error,
|
||||
WARN = icons.diagnostics.Warning,
|
||||
INFO = icons.diagnostics.Information,
|
||||
DEBUG = icons.ui.Bug,
|
||||
TRACE = icons.ui.Pencil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"moll/vim-bbye",
|
||||
},
|
||||
{
|
||||
"lewis6991/impatient.nvim",
|
||||
config = function()
|
||||
require("impatient").enable_profile()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ghillb/cybu.nvim",
|
||||
cmd = { "CybuNext", "CybuPrev" },
|
||||
config = function()
|
||||
require("cybu").setup({
|
||||
position = {
|
||||
relative_to = "win", -- win, editor, cursor
|
||||
anchor = "topright", -- topleft, topcenter, topright,
|
||||
-- centerleft, center, centerright,
|
||||
-- bottomleft, bottomcenter, bottomright
|
||||
-- vertical_offset = 10, -- vertical offset from anchor in lines
|
||||
-- horizontal_offset = 0, -- vertical offset from anchor in columns
|
||||
-- max_win_height = 5, -- height of cybu window in lines
|
||||
-- max_win_width = 0.5, -- integer for absolute in columns
|
||||
-- float for relative to win/editor width
|
||||
},
|
||||
display_time = 1750, -- time the cybu window is displayed
|
||||
style = {
|
||||
separator = " ", -- string used as separator
|
||||
prefix = "…", -- string used as prefix for truncated paths
|
||||
padding = 1, -- left & right padding in number of spaces
|
||||
hide_buffer_id = true,
|
||||
devicons = {
|
||||
enabled = true, -- enable or disable web dev icons
|
||||
colored = true, -- enable color for web dev icons
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mbbill/undotree",
|
||||
},
|
||||
{
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
{
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"text",
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
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 = false
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
|
||||
require("indent_blankline").setup({
|
||||
show_current_context = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
ignore_next_char = "[%w%.*]", -- don't place pair when cursor sits in front of any char
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"preservim/vim-markdown",
|
||||
},
|
||||
{
|
||||
"nacro90/numb.nvim",
|
||||
config = function()
|
||||
require("numb").setup({
|
||||
show_numbers = true, -- enable 'number' for the window while peeking
|
||||
show_cursorline = true, -- enable 'cursorline' for window wdile peeking
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"andymass/vim-matchup",
|
||||
},
|
||||
{
|
||||
"junegunn/vim-slash",
|
||||
},
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
config = function()
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
backdrop = 1,
|
||||
height = 0.9,
|
||||
width = 80,
|
||||
options = {
|
||||
signcolumn = "no",
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
cursorline = true,
|
||||
cursorcolumn = false, -- disable cursor column
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
gitsigns = { enabled = false },
|
||||
tmux = { enabled = false },
|
||||
twilight = { enabled = false },
|
||||
},
|
||||
on_open = function()
|
||||
vim.g.cmp_active = false
|
||||
vim.cmd([[LspStop]])
|
||||
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
if vim.fn.exists("#" .. "_winbar") == 1 then
|
||||
vim.cmd("au! " .. "_winbar")
|
||||
end
|
||||
end,
|
||||
on_close = function()
|
||||
vim.g.cmp_active = true
|
||||
vim.cmd([[LspStart]])
|
||||
require("winbar").create_winbar()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
},
|
||||
{
|
||||
"danymat/neogen",
|
||||
config = function()
|
||||
require("neogen").setup({
|
||||
enabled = true,
|
||||
input_after_comment = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"monaqa/dial.nvim",
|
||||
config = function()
|
||||
local dial_config = require("dial.config")
|
||||
|
||||
local y = "2024/05/29"
|
||||
|
||||
local augend = require("dial.augend")
|
||||
dial_config.augends:register_group({
|
||||
default = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
},
|
||||
visual = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
augend.constant.alias.alpha,
|
||||
augend.constant.alias.Alpha,
|
||||
},
|
||||
mygroup = {
|
||||
augend.constant.new({
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
}),
|
||||
augend.constant.new({
|
||||
elements = { "True", "False" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
}),
|
||||
augend.constant.new({
|
||||
elements = { "public", "private" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
}),
|
||||
augend.constant.new({
|
||||
elements = { "&&", "||" },
|
||||
word = false,
|
||||
cyclic = true,
|
||||
}),
|
||||
augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.)
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.semver.alias.semver,
|
||||
},
|
||||
})
|
||||
|
||||
local map = require("dial.map")
|
||||
|
||||
-- change augends in VISUAL mode
|
||||
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal("mygroup"), { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal("mygroup"), { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal("visual"), { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal("visual"), { noremap = true })
|
||||
|
||||
vim.cmd([[
|
||||
" enable only for specific FileType
|
||||
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
|
||||
]])
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
},
|
||||
}
|
||||
128
.config/nvim/lua/lazyvim/plugins/whichkey.lua
Normal file
128
.config/nvim/lua/lazyvim/plugins/whichkey.lua
Normal file
@ -0,0 +1,128 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
local whichkey = require("which-key")
|
||||
whichkey.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 = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
["<leader>"] = "SPC",
|
||||
},
|
||||
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 = "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 opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
buffer = nil, -- Global mappings
|
||||
prefix = "",
|
||||
silent = true, -- use 'silent'
|
||||
noremap = true, -- use 'noremap'
|
||||
nowait = true, -- use 'nowait'
|
||||
}
|
||||
|
||||
local leader_opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
buffer = nil, -- Global mappings
|
||||
prefix = "<leader>",
|
||||
silent = true, -- use 'silent'
|
||||
noremap = true, -- use 'noremap'
|
||||
nowait = true, -- use 'nowait'
|
||||
}
|
||||
|
||||
local m_opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
buffer = nil, -- Global mappings
|
||||
prefix = "m",
|
||||
silent = true, -- use 'silent'
|
||||
noremap = true, -- use 'noremap'
|
||||
nowait = true, -- use 'nowait'
|
||||
}
|
||||
|
||||
local m_mappings = {
|
||||
m = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
|
||||
l = { '<cmd>lua require("harpoon.ui").nav_next()<cr>', "Harpoon Next" },
|
||||
h = { '<cmd>lua require("harpoon.ui").nav_prev()<cr>', "Harpoon Prev" },
|
||||
s = { "<cmd>Telescope harpoon marks<cr>", "Search Files" },
|
||||
u = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
|
||||
|
||||
["1"] = { '<cmd> lua require("harpoon.ui").nav_file(1)<cr>', "Goto 1" },
|
||||
["2"] = { '<cmd> lua require("harpoon.ui").nav_file(2)<cr>', "Goto 2" },
|
||||
["3"] = { '<cmd> lua require("harpoon.ui").nav_file(3)<cr>', "Goto 3" },
|
||||
["4"] = { '<cmd> lua require("harpoon.ui").nav_file(4)<cr>', "Goto 4" },
|
||||
}
|
||||
|
||||
whichkey.register(m_mappings, m_opts)
|
||||
|
||||
whichkey.register({
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>h"] = { name = "+help" },
|
||||
["<leader>n"] = { name = "+noice" },
|
||||
["<leader>o"] = { name = "+open" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>t"] = { name = "+toggle" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user