nvim lazy plugin management part 1
This commit is contained in:
@ -1,33 +0,0 @@
|
||||
-- Setup nvim-cmp.
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
npairs.setup {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
@ -1,7 +0,0 @@
|
||||
require("ibl").setup({
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
},
|
||||
})
|
||||
@ -1,37 +0,0 @@
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
mode = "tabs",
|
||||
offsets = {
|
||||
{ filetype = "NvimTree", text = "", padding = 1 },
|
||||
{ filetype = "neo-tree", text = "", padding = 1 },
|
||||
},
|
||||
style_preset = bufferline.style_preset.minimal,
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
max_name_length = 14,
|
||||
max_prefix_length = 13,
|
||||
tab_size = 20,
|
||||
separator_style = { "", "" },
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
reveal = { 'close' }
|
||||
}
|
||||
|
||||
-- indicator = {
|
||||
-- style = "underline"
|
||||
-- },
|
||||
-- highlights = {
|
||||
-- tab_separator_selected = {
|
||||
-- underline = "0xc8c093",
|
||||
-- },
|
||||
-- }
|
||||
},
|
||||
})
|
||||
@ -1,6 +0,0 @@
|
||||
local null_ls_status_ok, breadcrumbs = pcall(require, "breadcrumbs")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
breadcrumbs.setup()
|
||||
@ -1,39 +0,0 @@
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "┆" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
}
|
||||
})
|
||||
@ -1,40 +0,0 @@
|
||||
local null_ls_status_ok, harpoon = pcall(require, "harpoon")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<leader>hm", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-1>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-2>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-3>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-4>", function() harpoon:list():select(4) end)
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end)
|
||||
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end)
|
||||
|
||||
local conf = require("telescope.config").values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require("telescope.pickers").new({}, {
|
||||
prompt_title = "Harpoon",
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer({}),
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = "Open harpoon window" })
|
||||
@ -1,14 +1,11 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local term_opts = { silent = true }
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
keymap("", "<Space>", "<Nop>", opts)
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
--window navigation
|
||||
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||
|
||||
81
.config/nvim/lua/user/lazy.lua
Normal file
81
.config/nvim/lua/user/lazy.lua
Normal file
@ -0,0 +1,81 @@
|
||||
local fn = vim.fn
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local status_ok, lazy = pcall(require, "lazy")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
lazy.setup(
|
||||
{
|
||||
spec = {
|
||||
{ import = "user.plugins" },
|
||||
|
||||
{ "hrsh7th/nvim-cmp", event = "VeryLazy" }, -- The completion plugin
|
||||
{ "hrsh7th/cmp-buffer", event = "VeryLazy" }, -- buffer completions
|
||||
{ "hrsh7th/cmp-path", event = "VeryLazy" }, -- path completions
|
||||
{ "hrsh7th/cmp-cmdline", event = "VeryLazy" }, -- cmdline completions
|
||||
{ "saadparwaiz1/cmp_luasnip", event = "VeryLazy" }, -- snippet completions
|
||||
{ "hrsh7th/cmp-nvim-lsp", event = "VeryLazy" },
|
||||
|
||||
-- snippets
|
||||
|
||||
-- LSP
|
||||
{ "williamboman/mason.nvim", event = "VeryLazy" }, -- simple to use language server installer
|
||||
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
|
||||
{ "neovim/nvim-lspconfig", event = "VeryLazy" }, -- enable LSP
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
backdrop = 1
|
||||
}
|
||||
},
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
{ "lukas-reineke/lsp-format.nvim", event = "VeryLazy" },
|
||||
|
||||
--comment out
|
||||
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||
{ "windwp/nvim-ts-autotag", event = "VeryLazy" },
|
||||
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
|
||||
--debugging
|
||||
{ "mfussenegger/nvim-dap", event = "VeryLazy" },
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio"
|
||||
},
|
||||
event = { "VeryLazy" }
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
)
|
||||
@ -1,46 +0,0 @@
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'kanagawa',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
-- use_mode_colors = false
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'branch'},
|
||||
-- lualine_b = {'diff', 'diagnostics'},
|
||||
lualine_b = {'diagnostics'},
|
||||
lualine_c = {},
|
||||
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_x = {'encoding', 'fileformat'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {callback=require('lualine').refresh})
|
||||
vim.api.nvim_create_autocmd('ModeChanged', {callback=require('lualine').refresh})
|
||||
@ -1,26 +0,0 @@
|
||||
require("neoscroll").setup({
|
||||
-- All these keys will be mapped to their corresponding default scrolling animation
|
||||
mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "<C-e>", "zt", "zz", "zb" },
|
||||
hide_cursor = true, -- Hide cursor while scrolling
|
||||
stop_eof = true, -- Stop at <EOF> when scrolling downwards
|
||||
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
|
||||
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
|
||||
easing_function = nil, -- Default easing function
|
||||
pre_hook = nil, -- Function to run before the scrolling animation starts
|
||||
post_hook = nil,
|
||||
performance_mode = false,
|
||||
})
|
||||
|
||||
-- local t = {}
|
||||
-- -- Syntax: t[keys] = {function, {function arguments}}
|
||||
-- t['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '250' } }
|
||||
-- t['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '250' } }
|
||||
-- t['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '450' } }
|
||||
-- t['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450' } }
|
||||
-- t['<C-y>'] = { 'scroll', { '-0.10', 'false', '100' } }
|
||||
-- t['<C-e>'] = { 'scroll', { '0.10', 'false', '100' } }
|
||||
-- t['zt'] = { 'zt', { '250' } }
|
||||
-- t['zz'] = { 'zz', { '250' } }
|
||||
-- t['zb'] = { 'zb', { '250' } }
|
||||
|
||||
-- require('neoscroll.config').set_mappings(t)
|
||||
@ -1,82 +0,0 @@
|
||||
require("neo-tree").setup({
|
||||
enable_diagnostics = false,
|
||||
enable_git_status = true,
|
||||
default_component_configs = {
|
||||
icon = {
|
||||
folder_empty = "",
|
||||
folder_empty_open = "",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
document_symbols = {
|
||||
kinds = {
|
||||
File = { icon = "", hl = "Tag" },
|
||||
Namespace = { icon = "", hl = "Include" },
|
||||
Package = { icon = "", hl = "Label" },
|
||||
Class = { icon = "", hl = "Include" },
|
||||
Property = { icon = "", hl = "@property" },
|
||||
Enum = { icon = "", hl = "@number" },
|
||||
Function = { icon = "", hl = "Function" },
|
||||
String = { icon = "", hl = "String" },
|
||||
Number = { icon = "", hl = "Number" },
|
||||
Array = { icon = "", hl = "Type" },
|
||||
Object = { icon = "", hl = "Type" },
|
||||
Key = { icon = "", hl = "" },
|
||||
Struct = { icon = "", hl = "Type" },
|
||||
Operator = { icon = "", hl = "Operator" },
|
||||
TypeParameter = { icon = "", hl = "Type" },
|
||||
StaticMethod = { icon = " ", hl = "Function" },
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
-- Add this section only if you've configured source selector.
|
||||
source_selector = {
|
||||
sources = {
|
||||
{ source = "filesystem", display_name = " Files " },
|
||||
{ source = "git_status", display_name = " Git " },
|
||||
},
|
||||
},
|
||||
|
||||
event_handlers = {
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function(arg)
|
||||
vim.opt.relativenumber = true
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = "file_open_requested",
|
||||
handler = function()
|
||||
require("neo-tree.command").execute({ action = "close" })
|
||||
end
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,13 +0,0 @@
|
||||
local nvim_navic_status_ok, nvim_navic = pcall(require, "nvim-navic")
|
||||
if not nvim_navic_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
nvim_navic.setup({
|
||||
lsp = {
|
||||
auto_attach = true,
|
||||
preference = {"pyright", "pylsp"}
|
||||
}
|
||||
})
|
||||
|
||||
-- vim.o.winbar = "%t %{%v:lua.require'nvim-navic'.get_location()%}"
|
||||
@ -1,6 +0,0 @@
|
||||
local null_ls_status_ok, null_ls = pcall(require, "scrollbar")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
null_ls.setup()
|
||||
@ -1,24 +0,0 @@
|
||||
-- examples for your init.lua
|
||||
|
||||
-- empty setup using defaults
|
||||
|
||||
-- OR setup with some options
|
||||
require("nvim-tree").setup({
|
||||
sort_by = "case_sensitive",
|
||||
view = {
|
||||
adaptive_size = false,
|
||||
width = 22,
|
||||
height = 22,
|
||||
mappings = {
|
||||
list = {
|
||||
{ key = "u", action = "dir_up" },
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
})
|
||||
@ -1,113 +0,0 @@
|
||||
local oil_status_ok, oil = pcall(require, "scrollbar")
|
||||
if not oil_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
oil.setup({
|
||||
default_file_explorer = false,
|
||||
columns = {
|
||||
"icon",
|
||||
},
|
||||
-- Buffer-local options to use for oil buffers
|
||||
buf_options = {
|
||||
buflisted = false,
|
||||
bufhidden = "hide",
|
||||
},
|
||||
-- Window-local options to use for oil buffers
|
||||
win_options = {
|
||||
wrap = false,
|
||||
signcolumn = "no",
|
||||
cursorcolumn = false,
|
||||
foldcolumn = "0",
|
||||
spell = false,
|
||||
list = false,
|
||||
conceallevel = 3,
|
||||
concealcursor = "nvic",
|
||||
},
|
||||
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
|
||||
delete_to_trash = false,
|
||||
-- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
|
||||
skip_confirm_for_simple_edits = false,
|
||||
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
|
||||
-- (:help prompt_save_on_select_new_entry)
|
||||
prompt_save_on_select_new_entry = true,
|
||||
-- Oil will automatically delete hidden buffers after this delay
|
||||
-- You can set the delay to false to disable cleanup entirely
|
||||
-- Note that the cleanup process only starts when none of the oil buffers are currently displayed
|
||||
cleanup_delay_ms = 2000,
|
||||
lsp_file_methods = {
|
||||
-- Time to wait for LSP file operations to complete before skipping
|
||||
timeout_ms = 1000,
|
||||
-- Set to true to autosave buffers that are updated with LSP willRenameFiles
|
||||
-- Set to "unmodified" to only save unmodified buffers
|
||||
autosave_changes = false,
|
||||
},
|
||||
-- Constrain the cursor to the editable parts of the oil buffer
|
||||
-- Set to `false` to disable, or "name" to keep it on the file names
|
||||
constrain_cursor = "editable",
|
||||
-- Set to true to watch the filesystem for changes and reload oil
|
||||
experimental_watch_for_changes = false,
|
||||
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
|
||||
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
|
||||
-- Additionally, if it is a string that matches "actions.<name>",
|
||||
-- it will use the mapping at require("oil.actions").<name>
|
||||
-- Set to `false` to remove a keymap
|
||||
-- See :help oil-actions for a list of all available actions
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
|
||||
["<C-h>"] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" },
|
||||
["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" },
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
-- Set to false to disable all of the above keymaps
|
||||
use_default_keymaps = true,
|
||||
view_options = {
|
||||
-- Show files and directories that start with "."
|
||||
show_hidden = false,
|
||||
-- This function defines what is considered a "hidden" file
|
||||
is_hidden_file = function(name, bufnr)
|
||||
return vim.startswith(name, ".")
|
||||
end,
|
||||
-- This function defines what will never be shown, even when `show_hidden` is set
|
||||
is_always_hidden = function(name, bufnr)
|
||||
return false
|
||||
end,
|
||||
-- Sort file names in a more intuitive order for humans. Is less performant,
|
||||
-- so you may want to set to false if you work with large directories.
|
||||
natural_order = true,
|
||||
sort = {
|
||||
-- sort order can be "asc" or "desc"
|
||||
-- see :help oil-columns to see which columns are sortable
|
||||
{ "type", "asc" },
|
||||
{ "name", "asc" },
|
||||
},
|
||||
},
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
-- Padding around the floating window
|
||||
padding = 2,
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
override = function(conf)
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
})
|
||||
@ -1,166 +0,0 @@
|
||||
local fn = vim.fn
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local status_ok, lazy = pcall(require, "lazy")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
lazy.setup({
|
||||
|
||||
-- "nvim-lua/popup.nvim", -- An implementation of the Popup API from vim in Neovim
|
||||
{ "windwp/nvim-autopairs", event = "VeryLazy" },
|
||||
|
||||
{ "hrsh7th/nvim-cmp", event = "VeryLazy" }, -- The completion plugin
|
||||
{ "hrsh7th/cmp-buffer", event = "VeryLazy" }, -- buffer completions
|
||||
{ "hrsh7th/cmp-path", event = "VeryLazy" }, -- path completions
|
||||
{ "hrsh7th/cmp-cmdline", event = "VeryLazy" }, -- cmdline completions
|
||||
{ "saadparwaiz1/cmp_luasnip", event = "VeryLazy" }, -- snippet completions
|
||||
{ "hrsh7th/cmp-nvim-lsp", event = "VeryLazy" },
|
||||
|
||||
-- snippets
|
||||
{ "L3MON4D3/LuaSnip", event = "VeryLazy" }, --snippet engine
|
||||
{ "rafamadriz/friendly-snippets", event = "VeryLazy" }, -- a bunch of snippets to use
|
||||
{
|
||||
"dsznajder/vscode-es7-javascript-react-snippets",
|
||||
run = "yarn install --frozen-lockfile && yarn compile",
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
-- LSP
|
||||
{ "williamboman/mason.nvim", event = "VeryLazy" }, -- simple to use language server installer
|
||||
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
|
||||
{ "neovim/nvim-lspconfig", event = "VeryLazy" }, -- enable LSP
|
||||
-- { "nvim-treesitter/nvim-treesitter-refactor", event = "VeryLazy" },
|
||||
|
||||
-- file explorer
|
||||
-- {
|
||||
-- 'stevearc/oil.nvim',
|
||||
-- opts = {},
|
||||
-- -- Optional dependencies
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
-- init = function()
|
||||
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
event = "VeryLazy"
|
||||
}
|
||||
,
|
||||
-- {
|
||||
-- "akinsho/bufferline.nvim",
|
||||
-- version = "*",
|
||||
-- dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||
-- },
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
backdrop = 1
|
||||
}
|
||||
},
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
{ "lukas-reineke/lsp-format.nvim", event = "VeryLazy" },
|
||||
-- "Vimjas/vim-python-pep8-indent",
|
||||
|
||||
--telescope
|
||||
{ "nvim-telescope/telescope.nvim", event = "VeryLazy" },
|
||||
{ "nvim-telescope/telescope-media-files.nvim", event = "VeryLazy" },
|
||||
|
||||
--comment out
|
||||
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||
{ "lukas-reineke/indent-blankline.nvim", event = "VeryLazy" },
|
||||
{ "windwp/nvim-ts-autotag", event = "VeryLazy" },
|
||||
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
--scrollbar
|
||||
{ "petertriho/nvim-scrollbar", event = "VeryLazy" },
|
||||
|
||||
--heirline statusbar
|
||||
-- "rebelot/heirline.nvim",
|
||||
|
||||
--gitsigns
|
||||
{ "lewis6991/gitsigns.nvim", event = "VeryLazy" },
|
||||
|
||||
--debugging
|
||||
{ "mfussenegger/nvim-dap", event = "VeryLazy" },
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio"
|
||||
},
|
||||
event = { "VeryLazy" }
|
||||
},
|
||||
|
||||
-- "nvim-lualine/lualine.nvim",
|
||||
|
||||
-- "folke/neodev.nvim",
|
||||
-- "MunifTanjim/nui.nvim",
|
||||
-- "b0o/schemastore.nvim",
|
||||
-- {
|
||||
-- 'Bekaboo/dropbar.nvim',
|
||||
-- -- optional, but required for fuzzy finder support
|
||||
-- dependencies = {
|
||||
-- 'nvim-telescope/telescope-fzf-native.nvim'
|
||||
-- }
|
||||
-- },
|
||||
-- {
|
||||
-- "LunarVim/breadcrumbs.nvim",
|
||||
-- dependencies = {
|
||||
-- { "SmiteshP/nvim-navic" },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- "karb94/neoscroll.nvim",
|
||||
-- },
|
||||
})
|
||||
34
.config/nvim/lua/user/plugins/autopairs.lua
Normal file
34
.config/nvim/lua/user/plugins/autopairs.lua
Normal file
@ -0,0 +1,34 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
},
|
||||
config = function ()
|
||||
require("nvim-autopairs").setup()
|
||||
-- require ("nvim-autopairs.completion.cmp")
|
||||
-- local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
-- if not cmp_status_ok then
|
||||
-- return
|
||||
-- end
|
||||
-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
end
|
||||
}
|
||||
|
||||
14
.config/nvim/lua/user/plugins/blank_indent_highlight.lua
Normal file
14
.config/nvim/lua/user/plugins/blank_indent_highlight.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
},
|
||||
},
|
||||
config = function (_, _opts)
|
||||
require("ibl").setup(_opts)
|
||||
end
|
||||
}
|
||||
46
.config/nvim/lua/user/plugins/gitsigns.lua
Normal file
46
.config/nvim/lua/user/plugins/gitsigns.lua
Normal file
@ -0,0 +1,46 @@
|
||||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "┆" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
46
.config/nvim/lua/user/plugins/harpoon.lua
Normal file
46
.config/nvim/lua/user/plugins/harpoon.lua
Normal file
@ -0,0 +1,46 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
|
||||
event = "VeryLazy",
|
||||
config = function(_, _opts)
|
||||
local harpoon = require("harpoon")
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<leader>hm", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-1>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-2>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-3>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-4>", function() harpoon:list():select(4) end)
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end)
|
||||
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end)
|
||||
|
||||
local conf = require("telescope.config").values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require("telescope.pickers").new({}, {
|
||||
prompt_title = "Harpoon",
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer({}),
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = "Open harpoon window" })
|
||||
end
|
||||
},
|
||||
}
|
||||
92
.config/nvim/lua/user/plugins/neotree.lua
Normal file
92
.config/nvim/lua/user/plugins/neotree.lua
Normal file
@ -0,0 +1,92 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
enable_diagnostics = false,
|
||||
enable_git_status = true,
|
||||
default_component_configs = {
|
||||
icon = {
|
||||
folder_empty = "",
|
||||
folder_empty_open = "",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
document_symbols = {
|
||||
kinds = {
|
||||
File = { icon = "", hl = "Tag" },
|
||||
Namespace = { icon = "", hl = "Include" },
|
||||
Package = { icon = "", hl = "Label" },
|
||||
Class = { icon = "", hl = "Include" },
|
||||
Property = { icon = "", hl = "@property" },
|
||||
Enum = { icon = "", hl = "@number" },
|
||||
Function = { icon = "", hl = "Function" },
|
||||
String = { icon = "", hl = "String" },
|
||||
Number = { icon = "", hl = "Number" },
|
||||
Array = { icon = "", hl = "Type" },
|
||||
Object = { icon = "", hl = "Type" },
|
||||
Key = { icon = "", hl = "" },
|
||||
Struct = { icon = "", hl = "Type" },
|
||||
Operator = { icon = "", hl = "Operator" },
|
||||
TypeParameter = { icon = "", hl = "Type" },
|
||||
StaticMethod = { icon = " ", hl = "Function" },
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
-- Add this section only if you've configured source selector.
|
||||
source_selector = {
|
||||
sources = {
|
||||
{ source = "filesystem", display_name = " Files " },
|
||||
{ source = "git_status", display_name = " Git " },
|
||||
},
|
||||
},
|
||||
|
||||
event_handlers = {
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function(arg)
|
||||
vim.opt.relativenumber = true
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = "file_open_requested",
|
||||
handler = function()
|
||||
require("neo-tree.command").execute({ action = "close" })
|
||||
end
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
5
.config/nvim/lua/user/plugins/nvim_scrollbar.lua
Normal file
5
.config/nvim/lua/user/plugins/nvim_scrollbar.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
"petertriho/nvim-scrollbar",
|
||||
event = "VeryLazy",
|
||||
config = true
|
||||
}
|
||||
11
.config/nvim/lua/user/plugins/snipptes.lua
Normal file
11
.config/nvim/lua/user/plugins/snipptes.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
|
||||
{ "L3MON4D3/LuaSnip", event = "VeryLazy" }, --snippet engine
|
||||
{ "rafamadriz/friendly-snippets", event = "VeryLazy" }, -- a bunch of snippets to use
|
||||
{
|
||||
"dsznajder/vscode-es7-javascript-react-snippets",
|
||||
run = "yarn install --frozen-lockfile && yarn compile",
|
||||
event = "VeryLazy"
|
||||
},
|
||||
|
||||
}
|
||||
121
.config/nvim/lua/user/plugins/telescope.lua
Normal file
121
.config/nvim/lua/user/plugins/telescope.lua
Normal file
@ -0,0 +1,121 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
telescope.load_extension("media_files")
|
||||
|
||||
local telescope_builtin = require("telescope.builtin")
|
||||
|
||||
local which_key = require("which-key")
|
||||
which_key.add({
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", desc = "Find file" },
|
||||
{ "<leader>fw", "<cmd>lua require'telescope.builtin'.live_grep()<cr>", desc = "Grep file" },
|
||||
{ "<leader>fb", "<cmd>lua require'telescope.builtin'.buffers()<cr>", desc = "Find buffer" },
|
||||
{ "<leader>fh", "<cmd>lua require'telescope.builtin'.resume()<cr>", desc = "Resume last search" },
|
||||
})
|
||||
end,
|
||||
opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
return {
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules", "venv" },
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Default configuration for builtin pickers goes here:
|
||||
-- picker_name = {
|
||||
-- picker_config_key = value,
|
||||
-- ...
|
||||
-- }
|
||||
-- Now the picker_config_key will be applied every time you call this
|
||||
-- builtin picker
|
||||
},
|
||||
extensions = {
|
||||
media_files = {
|
||||
-- filetypes whitelist
|
||||
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
|
||||
filetypes = { "png", "webp", "jpg", "jpeg" },
|
||||
find_cmd = "rg", -- find command (defaults to `fd`)
|
||||
},
|
||||
-- Your extension configuration goes here:
|
||||
-- extension_name = {
|
||||
-- extension_config_key = value,
|
||||
-- }
|
||||
-- please take a look at the readme of the extension you want to configure
|
||||
},
|
||||
}
|
||||
end,
|
||||
event = "VeryLazy"
|
||||
},
|
||||
{ "nvim-telescope/telescope-media-files.nvim", event = "VeryLazy" },
|
||||
}
|
||||
38
.config/nvim/lua/user/plugins/treesitter.lua
Normal file
38
.config/nvim/lua/user/plugins/treesitter.lua
Normal file
@ -0,0 +1,38 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
event = "VeryLazy",
|
||||
-- init = function(plugin)
|
||||
-- require("nvim-treesitter")
|
||||
-- end,
|
||||
opts = {
|
||||
ensure_installed = { "python", "rust", "javascript" }, -- one of "all" or a list of languages
|
||||
ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "css" },
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
refactor = {
|
||||
highlight_definitions = {
|
||||
enable = false,
|
||||
-- Set to false if you have an `updatetime` of ~100.
|
||||
clear_on_cursor_move = true,
|
||||
},
|
||||
smart_rename = {
|
||||
enable = false,
|
||||
keymaps = {
|
||||
smart_rename = "grr",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
142
.config/nvim/lua/user/plugins/which_key.lua
Normal file
142
.config/nvim/lua/user/plugins/which_key.lua
Normal file
@ -0,0 +1,142 @@
|
||||
local toggle_gitsigns_blame = function()
|
||||
local function is_filetype_open(filetype)
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].filetype == filetype then
|
||||
return buf
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- check if gitsigns-blame buffer is open
|
||||
local bufnr = is_filetype_open("gitsigns-blame")
|
||||
|
||||
if bufnr then
|
||||
vim.api.nvim_buf_delete(bufnr, { force = false })
|
||||
else
|
||||
vim.cmd("Gitsigns blame")
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
plugins = {
|
||||
marks = false, -- shows a list of your marks on ' and `
|
||||
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true,
|
||||
suggestions = 20,
|
||||
}, -- use which-key for spelling hints
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ...
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = false, -- default bindings on <c-w>
|
||||
nav = false, -- misc bindings to work with windows
|
||||
z = false, -- bindings for folds, spelling and others prefixed with z
|
||||
g = false, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
preset = "classic",
|
||||
keys = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
win = {
|
||||
-- border = "single", -- none, single, double, shadow
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
wo = {
|
||||
winblend = 0,
|
||||
}
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
filter = function(mapping) -- enable this to hide mappings for which you didn't specify a label
|
||||
return mapping.desc
|
||||
end,
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
show_keys = true, -- show the currently pressed key and its label as a message in the command line
|
||||
triggers = {},
|
||||
-- disable the WhichKey popup for certain buf types and file types.
|
||||
-- Disabled by default for Telescope
|
||||
disable = {
|
||||
buftypes = {},
|
||||
filetypes = { "TelescopePrompt" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local which_key = require("which-key")
|
||||
which_key.add({
|
||||
{ "<leader>", group = "Hotkeys" },
|
||||
{ "<leader>?", ":WhichKey <CR>", desc = "Show keybindings" },
|
||||
{ "<leader>o", ":Oil --float <CR>", desc = "Oil nvim toggle" },
|
||||
{ "<leader>e", ":Neotree toggle position=current <CR>", desc = "File tree toggle" },
|
||||
{ "<leader>F", ":lua vim.lsp.buf.format() <CR>", desc = "Format file" },
|
||||
})
|
||||
|
||||
-- which_key.add({
|
||||
-- { "<leader>f", group = "Find" },
|
||||
-- { "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", desc = "Find file" },
|
||||
-- { "<leader>fw", "<cmd>lua require'telescope.builtin'.live_grep()<cr>", desc = "Grep file" },
|
||||
-- { "<leader>fb", "<cmd>lua require'telescope.builtin'.buffers()<cr>", desc = "Find buffer" },
|
||||
-- { "<leader>fh", "<cmd>lua require'telescope.builtin'.resume()<cr>", desc = "Resume last search" },
|
||||
-- })
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>g", group = "Git" },
|
||||
{ "<leader>gb", toggle_gitsigns_blame, desc = "Toggle git blame view" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>z", "<cmd>:ZenMode<CR>", desc = "Zen mode toggle" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>c", group = "Code actions" },
|
||||
{ "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", desc = "Show code actions" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>l", "<cmd>lua vim.diagnostic.setloclist()<CR>", desc = "Show diagnostic list" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>d", group = "Dap" },
|
||||
{ "<leader>dr", "<cmd>DapContinue<CR>", desc = "Continue" },
|
||||
{ "<leader>dj", "<cmd>DapStepInto<CR>", desc = "Step into" },
|
||||
{ "<leader>dl", "<cmd>DapStepOver<CR>", desc = "Step over" },
|
||||
{ "<leader>dk", "<cmd>DapStepOut<CR>", desc = "Step out" },
|
||||
{ "<leader>db", "<cmd>DapToggleBreakpoint<CR>", desc = "Toggle breakpoint" },
|
||||
{ "<leader>ds", "<cmd>DapTerminate<CR>", desc = "Terminate" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>t", group = "Tabs" },
|
||||
{ "<leader>tn", "<cmd>tabnew<CR>", desc = "New tab" },
|
||||
{ "<leader>tq", "<cmd>tabclose<CR>", desc = "Close tab" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "g", group = "LSP Actions" },
|
||||
{ "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", desc = "Go to declaration" },
|
||||
{ "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", desc = "Go to definition" },
|
||||
{ "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", desc = "Show implementations" },
|
||||
{ "grr", "<cmd>lua vim.lsp.buf.rename()<CR>", desc = "Rename" },
|
||||
{ "gr", "<cmd>lua vim.lsp.buf.references()<CR>", desc = "Show references" },
|
||||
{ "gl", "<cmd>lua vim.diagnostic.open_float({ border = 'rounded' })<CR>", desc = "Show diagnostic at line" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", desc = "Signature help" },
|
||||
{ "K", "<cmd>lua vim.lsp.buf.hover()<CR>", desc = "Signature help" },
|
||||
})
|
||||
end
|
||||
}
|
||||
@ -1,104 +0,0 @@
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension("media_files")
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules", "venv" },
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Default configuration for builtin pickers goes here:
|
||||
-- picker_name = {
|
||||
-- picker_config_key = value,
|
||||
-- ...
|
||||
-- }
|
||||
-- Now the picker_config_key will be applied every time you call this
|
||||
-- builtin picker
|
||||
},
|
||||
extensions = {
|
||||
media_files = {
|
||||
-- filetypes whitelist
|
||||
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
|
||||
filetypes = { "png", "webp", "jpg", "jpeg" },
|
||||
find_cmd = "rg", -- find command (defaults to `fd`)
|
||||
},
|
||||
-- Your extension configuration goes here:
|
||||
-- extension_name = {
|
||||
-- extension_config_key = value,
|
||||
-- }
|
||||
-- please take a look at the readme of the extension you want to configure
|
||||
},
|
||||
})
|
||||
@ -1,33 +0,0 @@
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "python", "rust", "javascript" }, -- one of "all" or a list of languages
|
||||
ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "css" },
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
refactor = {
|
||||
highlight_definitions = {
|
||||
enable = false,
|
||||
-- Set to false if you have an `updatetime` of ~100.
|
||||
clear_on_cursor_move = true,
|
||||
},
|
||||
smart_rename = {
|
||||
enable = false,
|
||||
keymaps = {
|
||||
smart_rename = "grr",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,141 +0,0 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local toggle_gitsigns_blame = function()
|
||||
local function is_filetype_open(filetype)
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].filetype == filetype then
|
||||
return buf
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- check if gitsigns-blame buffer is open
|
||||
local bufnr = is_filetype_open("gitsigns-blame")
|
||||
|
||||
if bufnr then
|
||||
vim.api.nvim_buf_delete(bufnr, { force = false })
|
||||
else
|
||||
vim.cmd("Gitsigns blame")
|
||||
end
|
||||
end
|
||||
|
||||
which_key.setup({
|
||||
plugins = {
|
||||
marks = false, -- shows a list of your marks on ' and `
|
||||
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true,
|
||||
suggestions = 20,
|
||||
}, -- use which-key for spelling hints
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ...
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = false, -- default bindings on <c-w>
|
||||
nav = false, -- misc bindings to work with windows
|
||||
z = false, -- bindings for folds, spelling and others prefixed with z
|
||||
g = false, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
preset = "classic",
|
||||
keys = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
win = {
|
||||
-- border = "single", -- none, single, double, shadow
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
wo = {
|
||||
winblend = 0,
|
||||
}
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
filter = function(mapping) -- enable this to hide mappings for which you didn't specify a label
|
||||
return mapping.desc
|
||||
end,
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
show_keys = true, -- show the currently pressed key and its label as a message in the command line
|
||||
triggers = {},
|
||||
-- disable the WhichKey popup for certain buf types and file types.
|
||||
-- Disabled by default for Telescope
|
||||
disable = {
|
||||
buftypes = {},
|
||||
filetypes = { "TelescopePrompt" },
|
||||
},
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>", group = "Hotkeys" },
|
||||
{ "<leader>?", ":WhichKey <CR>", desc = "Show keybindings" },
|
||||
{ "<leader>o", ":Oil --float <CR>", desc = "Oil nvim toggle" },
|
||||
{ "<leader>e", ":Neotree toggle position=current <CR>", desc = "File tree toggle" },
|
||||
{ "<leader>F", ":lua vim.lsp.buf.format() <CR>", desc = "Format file" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", desc = "Find file" },
|
||||
{ "<leader>fw", "<cmd>lua require'telescope.builtin'.live_grep()<cr>", desc = "Grep file" },
|
||||
{ "<leader>fb", "<cmd>lua require'telescope.builtin'.buffers()<cr>", desc = "Find buffer" },
|
||||
{ "<leader>fh", "<cmd>lua require'telescope.builtin'.resume()<cr>", desc = "Resume last search" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>g", group = "Git" },
|
||||
{ "<leader>gb", toggle_gitsigns_blame, desc = "Toggle git blame view" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>z", "<cmd>:ZenMode<CR>", desc = "Zen mode toggle" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>c", group = "Code actions" },
|
||||
{ "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", desc = "Show code actions" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>l", "<cmd>lua vim.diagnostic.setloclist()<CR>", desc = "Show diagnostic list" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>d", group = "Dap" },
|
||||
{ "<leader>dr", "<cmd>DapContinue<CR>", desc = "Continue" },
|
||||
{ "<leader>dj", "<cmd>DapStepInto<CR>", desc = "Step into" },
|
||||
{ "<leader>dl", "<cmd>DapStepOver<CR>", desc = "Step over" },
|
||||
{ "<leader>dk", "<cmd>DapStepOut<CR>", desc = "Step out" },
|
||||
{ "<leader>db", "<cmd>DapToggleBreakpoint<CR>", desc = "Toggle breakpoint" },
|
||||
{ "<leader>ds", "<cmd>DapTerminate<CR>", desc = "Terminate" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<leader>t", group = "Tabs" },
|
||||
{ "<leader>tn", "<cmd>tabnew<CR>", desc = "New tab" },
|
||||
{ "<leader>tq", "<cmd>tabclose<CR>", desc = "Close tab" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "g", group = "LSP Actions" },
|
||||
{ "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", desc = "Go to declaration" },
|
||||
{ "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", desc = "Go to definition" },
|
||||
{ "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", desc = "Show implementations" },
|
||||
{ "grr", "<cmd>lua vim.lsp.buf.rename()<CR>", desc = "Rename" },
|
||||
{ "gr", "<cmd>lua vim.lsp.buf.references()<CR>", desc = "Show references" },
|
||||
{ "gl", "<cmd>lua vim.diagnostic.open_float({ border = 'rounded' })<CR>", desc = "Show diagnostic at line" },
|
||||
})
|
||||
|
||||
which_key.add({
|
||||
{ "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", desc = "Signature help" },
|
||||
{ "K", "<cmd>lua vim.lsp.buf.hover()<CR>", desc = "Signature help" },
|
||||
})
|
||||
Reference in New Issue
Block a user