Compare commits
2 Commits
3812064349
...
386d50d7ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 386d50d7ce | |||
| 0d1b98f65e |
@ -1,21 +1,4 @@
|
|||||||
require("user.plugins")
|
|
||||||
|
|
||||||
require("user.themes.kanagawa")
|
|
||||||
|
|
||||||
require("user.options")
|
|
||||||
require("user.keymaps")
|
require("user.keymaps")
|
||||||
|
require("user.options")
|
||||||
|
|
||||||
require("user.cmp")
|
require("user.lazy")
|
||||||
require("user.lsp")
|
|
||||||
require("user.lsp_format")
|
|
||||||
require("user.treesitter")
|
|
||||||
require("user.blank_indent_highlight")
|
|
||||||
require("user.autopairs")
|
|
||||||
require("user.telescope")
|
|
||||||
require("user.nvim_scrollbar")
|
|
||||||
require("user.gitsigns")
|
|
||||||
require("user.dap.dapui")
|
|
||||||
require("user.dap.dap")
|
|
||||||
require("user.neotree")
|
|
||||||
require("user.which_key")
|
|
||||||
require("user.harpoon")
|
|
||||||
|
|||||||
@ -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,128 +0,0 @@
|
|||||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
|
||||||
if not cmp_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
|
||||||
if not snip_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
require("luasnip/loaders/from_vscode").lazy_load()
|
|
||||||
|
|
||||||
local check_backspace = function()
|
|
||||||
local col = vim.fn.col "." - 1
|
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
|
||||||
end
|
|
||||||
|
|
||||||
local cmp_kinds = {
|
|
||||||
Text = ' ',
|
|
||||||
Method = ' ',
|
|
||||||
Function = ' ',
|
|
||||||
Constructor = ' ',
|
|
||||||
Field = ' ',
|
|
||||||
Variable = ' ',
|
|
||||||
Class = ' ',
|
|
||||||
Interface = ' ',
|
|
||||||
Module = ' ',
|
|
||||||
Property = ' ',
|
|
||||||
Unit = ' ',
|
|
||||||
Value = ' ',
|
|
||||||
Enum = ' ',
|
|
||||||
Keyword = ' ',
|
|
||||||
Snippet = ' ',
|
|
||||||
Color = ' ',
|
|
||||||
File = ' ',
|
|
||||||
Reference = ' ',
|
|
||||||
Folder = ' ',
|
|
||||||
EnumMember = ' ',
|
|
||||||
Constant = ' ',
|
|
||||||
Struct = ' ',
|
|
||||||
Event = ' ',
|
|
||||||
Operator = ' ',
|
|
||||||
TypeParameter = ' ',
|
|
||||||
}
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
|
||||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
|
||||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
|
||||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
|
||||||
["<C-e>"] = cmp.mapping {
|
|
||||||
i = cmp.mapping.abort(),
|
|
||||||
c = cmp.mapping.close(),
|
|
||||||
},
|
|
||||||
-- Accept currently selected item. If none selected, `select` first item.
|
|
||||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<CR>"] = cmp.mapping.confirm { select = false },
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expandable() then
|
|
||||||
luasnip.expand()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif check_backspace() then
|
|
||||||
fallback()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, {
|
|
||||||
"i",
|
|
||||||
"s",
|
|
||||||
}),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, {
|
|
||||||
"i",
|
|
||||||
"s",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
fields = { "kind", "abbr", "menu" },
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
-- Kind icons
|
|
||||||
vim_item.kind = string.format("%s", cmp_kinds[vim_item.kind])
|
|
||||||
vim_item.menu = ({
|
|
||||||
nvim_lsp = "[LSP]",
|
|
||||||
luasnip = "[Snippet]",
|
|
||||||
buffer = "[Buffer]",
|
|
||||||
path = "[Path]",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
|
||||||
},
|
|
||||||
confirm_opts = {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = false,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
documentation = {
|
|
||||||
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = false,
|
|
||||||
native_menu = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
local dap_status_ok, dap = pcall(require, "dap")
|
|
||||||
if not dap_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local dapui_status_ok, dapui = pcall(require, "dapui")
|
|
||||||
if not dapui_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
dap.adapters.coreclr = {
|
|
||||||
type = 'executable',
|
|
||||||
command = '/home/nikita/.local/share/nvim/mason/bin/netcoredbg',
|
|
||||||
args = { '--interpreter=vscode' }
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.g.dotnet_build_project = function()
|
|
||||||
local default_path = vim.fn.getcwd() .. '/'
|
|
||||||
if vim.g['dotnet_last_proj_path'] ~= nil then
|
|
||||||
default_path = vim.g['dotnet_last_proj_path']
|
|
||||||
end
|
|
||||||
local path = vim.fn.input('Path to your *proj file', default_path, 'file')
|
|
||||||
vim.g['dotnet_last_proj_path'] = path
|
|
||||||
local cmd = 'dotnet build -c Debug ' .. path .. ' > /dev/null'
|
|
||||||
print('')
|
|
||||||
print('Cmd to execute: ' .. cmd)
|
|
||||||
local f = os.execute(cmd)
|
|
||||||
if f == 0 then
|
|
||||||
print('\nBuild: ✔️ ')
|
|
||||||
else
|
|
||||||
print('\nBuild: ❌ (code: ' .. f .. ')')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.dotnet_get_dll_path = function()
|
|
||||||
local request = function()
|
|
||||||
return vim.fn.input('Path to dll', vim.fn.getcwd(), 'file')
|
|
||||||
end
|
|
||||||
|
|
||||||
if vim.g['dotnet_last_dll_path'] == nil then
|
|
||||||
vim.g['dotnet_last_dll_path'] = request()
|
|
||||||
else
|
|
||||||
if vim.fn.confirm('Do you want to change the path to dll?\n' .. vim.g['dotnet_last_dll_path'], '&yes\n&no', 2) == 1 then
|
|
||||||
vim.g['dotnet_last_dll_path'] = request()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return vim.g['dotnet_last_dll_path']
|
|
||||||
end
|
|
||||||
|
|
||||||
local config = {
|
|
||||||
{
|
|
||||||
type = "coreclr",
|
|
||||||
name = "launch - netcoredbg",
|
|
||||||
request = "launch",
|
|
||||||
-- console = "integratedTerminal",
|
|
||||||
cwd = "${workspaceFolder}/src/ClientService.AspNet",
|
|
||||||
launchSettingsFilePath = "${workspaceFolder}/src/ClientService.AspNet/Properties/launchSettings.json",
|
|
||||||
launchSettingsProfile = "ClientService.AspNet",
|
|
||||||
program = function()
|
|
||||||
if vim.fn.confirm('Should I recompile first?', '&yes\n&no', 2) == 1 then
|
|
||||||
vim.g.dotnet_build_project()
|
|
||||||
end
|
|
||||||
return vim.g.dotnet_get_dll_path()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.cs = config
|
|
||||||
|
|
||||||
--Autostart ui when debugging
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
-- dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
||||||
-- dapui.close()
|
|
||||||
-- end
|
|
||||||
-- dap.listeners.before.event_exited["dapui_config"] = function()
|
|
||||||
-- dapui.close()
|
|
||||||
-- end
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
local dapui_status_ok, dapui = pcall(require, "dapui")
|
|
||||||
if not dapui_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
dapui.setup()
|
|
||||||
@ -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 opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
local term_opts = { silent = true }
|
|
||||||
|
|
||||||
local keymap = vim.api.nvim_set_keymap
|
local keymap = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
keymap("", "<Space>", "<Nop>", opts)
|
keymap("", "<Space>", "<Nop>", opts)
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
--window navigation
|
--window navigation
|
||||||
keymap("n", "<C-h>", "<C-w>h", opts)
|
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||||
keymap("n", "<C-j>", "<C-w>j", opts)
|
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||||
|
|||||||
29
.config/nvim/lua/user/lazy.lua
Normal file
29
.config/nvim/lua/user/lazy.lua
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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(
|
||||||
|
{
|
||||||
|
change_detection = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
spec = {
|
||||||
|
{ import = "user.plugins" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
@ -1,12 +0,0 @@
|
|||||||
local status_ok, mason = pcall(require, "mason")
|
|
||||||
if not status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
mason.setup()
|
|
||||||
|
|
||||||
require("user.lsp.mason_lsp_config")
|
|
||||||
require("user.lsp.diagnostics_config").setup()
|
|
||||||
-- require("user.lsp.none_ls")
|
|
||||||
|
|
||||||
vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]])
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
require("lsp-format").setup {}
|
|
||||||
|
|
||||||
local on_attach = function(client)
|
|
||||||
require "lsp-format".on_attach(client)
|
|
||||||
end
|
|
||||||
|
|
||||||
require "lspconfig".gopls.setup { on_attach = on_attach }
|
|
||||||
@ -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
|
||||||
|
}
|
||||||
133
.config/nvim/lua/user/plugins/cmp.lua
Normal file
133
.config/nvim/lua/user/plugins/cmp.lua
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local cmp = require "cmp"
|
||||||
|
local luasnip = require "luasnip"
|
||||||
|
require("luasnip/loaders/from_vscode").lazy_load()
|
||||||
|
|
||||||
|
local check_backspace = function()
|
||||||
|
local col = vim.fn.col "." - 1
|
||||||
|
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||||
|
end
|
||||||
|
|
||||||
|
local cmp_kinds = {
|
||||||
|
Text = ' ',
|
||||||
|
Method = ' ',
|
||||||
|
Function = ' ',
|
||||||
|
Constructor = ' ',
|
||||||
|
Field = ' ',
|
||||||
|
Variable = ' ',
|
||||||
|
Class = ' ',
|
||||||
|
Interface = ' ',
|
||||||
|
Module = ' ',
|
||||||
|
Property = ' ',
|
||||||
|
Unit = ' ',
|
||||||
|
Value = ' ',
|
||||||
|
Enum = ' ',
|
||||||
|
Keyword = ' ',
|
||||||
|
Snippet = ' ',
|
||||||
|
Color = ' ',
|
||||||
|
File = ' ',
|
||||||
|
Reference = ' ',
|
||||||
|
Folder = ' ',
|
||||||
|
EnumMember = ' ',
|
||||||
|
Constant = ' ',
|
||||||
|
Struct = ' ',
|
||||||
|
Event = ' ',
|
||||||
|
Operator = ' ',
|
||||||
|
TypeParameter = ' ',
|
||||||
|
}
|
||||||
|
|
||||||
|
cmp.setup {
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||||
|
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||||
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||||
|
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
|
["<C-e>"] = cmp.mapping {
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
},
|
||||||
|
-- Accept currently selected item. If none selected, `select` first item.
|
||||||
|
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<CR>"] = cmp.mapping.confirm { select = false },
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expandable() then
|
||||||
|
luasnip.expand()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif check_backspace() then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
-- Kind icons
|
||||||
|
vim_item.kind = string.format("%s", cmp_kinds[vim_item.kind])
|
||||||
|
vim_item.menu = ({
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[Snippet]",
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
path = "[Path]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
confirm_opts = {
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = false,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
documentation = {
|
||||||
|
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = false,
|
||||||
|
native_menu = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}, -- 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" },
|
||||||
|
}
|
||||||
85
.config/nvim/lua/user/plugins/dap/init.lua
Normal file
85
.config/nvim/lua/user/plugins/dap/init.lua
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local dap = require "dap"
|
||||||
|
|
||||||
|
local dapui = require "dapui"
|
||||||
|
|
||||||
|
dap.adapters.coreclr = {
|
||||||
|
type = 'executable',
|
||||||
|
command = '/home/nikita/.local/share/nvim/mason/bin/netcoredbg',
|
||||||
|
args = { '--interpreter=vscode' }
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.g.dotnet_build_project = function()
|
||||||
|
local default_path = vim.fn.getcwd() .. '/'
|
||||||
|
if vim.g['dotnet_last_proj_path'] ~= nil then
|
||||||
|
default_path = vim.g['dotnet_last_proj_path']
|
||||||
|
end
|
||||||
|
local path = vim.fn.input('Path to your *proj file', default_path, 'file')
|
||||||
|
vim.g['dotnet_last_proj_path'] = path
|
||||||
|
local cmd = 'dotnet build -c Debug ' .. path .. ' > /dev/null'
|
||||||
|
print('')
|
||||||
|
print('Cmd to execute: ' .. cmd)
|
||||||
|
local f = os.execute(cmd)
|
||||||
|
if f == 0 then
|
||||||
|
print('\nBuild: ✔️ ')
|
||||||
|
else
|
||||||
|
print('\nBuild: ❌ (code: ' .. f .. ')')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.dotnet_get_dll_path = function()
|
||||||
|
local request = function()
|
||||||
|
return vim.fn.input('Path to dll', vim.fn.getcwd(), 'file')
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.g['dotnet_last_dll_path'] == nil then
|
||||||
|
vim.g['dotnet_last_dll_path'] = request()
|
||||||
|
else
|
||||||
|
if vim.fn.confirm('Do you want to change the path to dll?\n' .. vim.g['dotnet_last_dll_path'], '&yes\n&no', 2) == 1 then
|
||||||
|
vim.g['dotnet_last_dll_path'] = request()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim.g['dotnet_last_dll_path']
|
||||||
|
end
|
||||||
|
|
||||||
|
local config = {
|
||||||
|
{
|
||||||
|
type = "coreclr",
|
||||||
|
name = "launch - netcoredbg",
|
||||||
|
request = "launch",
|
||||||
|
-- console = "integratedTerminal",
|
||||||
|
cwd = "${workspaceFolder}/src/ClientService.AspNet",
|
||||||
|
launchSettingsFilePath = "${workspaceFolder}/src/ClientService.AspNet/Properties/launchSettings.json",
|
||||||
|
launchSettingsProfile = "ClientService.AspNet",
|
||||||
|
program = function()
|
||||||
|
if vim.fn.confirm('Should I recompile first?', '&yes\n&no', 2) == 1 then
|
||||||
|
vim.g.dotnet_build_project()
|
||||||
|
end
|
||||||
|
return vim.g.dotnet_get_dll_path()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.cs = config
|
||||||
|
|
||||||
|
--Autostart ui when debugging
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
dependencies = {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"nvim-neotest/nvim-nio"
|
||||||
|
},
|
||||||
|
event = { "VeryLazy" },
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
}
|
||||||
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
|
||||||
|
},
|
||||||
|
}
|
||||||
34
.config/nvim/lua/user/plugins/lsp/init.lua
Normal file
34
.config/nvim/lua/user/plugins/lsp/init.lua
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = true
|
||||||
|
}, -- simple to use language server installer
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("user.plugins.lsp.mason_lsp_config")
|
||||||
|
require("user.plugins.lsp.diagnostics_config").setup()
|
||||||
|
-- require("user.lsp.none_ls")
|
||||||
|
|
||||||
|
vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]])
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ "neovim/nvim-lspconfig", event = "VeryLazy" }, -- enable LSP
|
||||||
|
{
|
||||||
|
"lukas-reineke/lsp-format.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local on_attach = function(client)
|
||||||
|
require("lsp-format").on_attach(client)
|
||||||
|
end
|
||||||
|
|
||||||
|
require("lspconfig").gopls.setup { on_attach = on_attach }
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
event = "VeryLazy"
|
||||||
|
},
|
||||||
|
}
|
||||||
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
|
||||||
|
}
|
||||||
9
.config/nvim/lua/user/plugins/snipptes.lua
Normal file
9
.config/nvim/lua/user/plugins/snipptes.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
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",
|
||||||
|
dependencies = { "nvim-telescope/telescope-media-files.nvim", "nvim-lua/plenary.nvim" },
|
||||||
|
lazy = false,
|
||||||
|
config = function(_, _opts)
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup(_opts)
|
||||||
|
|
||||||
|
telescope.load_extension("media_files")
|
||||||
|
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
}
|
||||||
39
.config/nvim/lua/user/plugins/theme/init.lua
Normal file
39
.config/nvim/lua/user/plugins/theme/init.lua
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
return {
|
||||||
|
"rebelot/kanagawa.nvim",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
opts = {
|
||||||
|
compile = false, -- enable compiling the colorscheme
|
||||||
|
undercurl = true, -- enable undercurls
|
||||||
|
commentStyle = { italic = true },
|
||||||
|
functionStyle = {},
|
||||||
|
keywordStyle = { italic = true },
|
||||||
|
statementStyle = { bold = true },
|
||||||
|
typeStyle = {},
|
||||||
|
transparent = true, -- do not set background color
|
||||||
|
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
|
||||||
|
terminalColors = true, -- define vim.g.terminal_color_{0,17}
|
||||||
|
colors = {
|
||||||
|
-- add/modify theme and palette colors
|
||||||
|
palette = {},
|
||||||
|
theme = { wave = {}, lotus = {}, dragon = {}, all = { ui = { bg_gutter = "none" } } },
|
||||||
|
},
|
||||||
|
overrides = function(colors) -- add/modify highlights
|
||||||
|
local theme = colors.theme
|
||||||
|
return {
|
||||||
|
CursorLine = { bg = "#272735" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
theme = "wave", -- Load "wave" theme when 'background' option is not set
|
||||||
|
background = { -- map the value of 'background' option to a theme
|
||||||
|
dark = "wave", -- try "dragon" !
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, _opts)
|
||||||
|
require("kanagawa").setup(_opts)
|
||||||
|
|
||||||
|
vim.cmd("colorscheme kanagawa")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
41
.config/nvim/lua/user/plugins/treesitter.lua
Normal file
41
.config/nvim/lua/user/plugins/treesitter.lua
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
lazy = false,
|
||||||
|
-- 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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function (_, opts)
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
136
.config/nvim/lua/user/plugins/which_key.lua
Normal file
136
.config/nvim/lua/user/plugins/which_key.lua
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
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(_, opts)
|
||||||
|
local which_key = require("which-key")
|
||||||
|
which_key.setup(opts)
|
||||||
|
|
||||||
|
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>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
|
||||||
|
}
|
||||||
9
.config/nvim/lua/user/plugins/zen_mode.lua
Normal file
9
.config/nvim/lua/user/plugins/zen_mode.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"folke/zen-mode.nvim",
|
||||||
|
opts = {
|
||||||
|
window = {
|
||||||
|
backdrop = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
event = "VeryLazy"
|
||||||
|
}
|
||||||
@ -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,29 +0,0 @@
|
|||||||
require("kanagawa").setup({
|
|
||||||
compile = false, -- enable compiling the colorscheme
|
|
||||||
undercurl = true, -- enable undercurls
|
|
||||||
commentStyle = { italic = true },
|
|
||||||
functionStyle = {},
|
|
||||||
keywordStyle = { italic = true },
|
|
||||||
statementStyle = { bold = true },
|
|
||||||
typeStyle = {},
|
|
||||||
transparent = true, -- do not set background color
|
|
||||||
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
|
|
||||||
terminalColors = true, -- define vim.g.terminal_color_{0,17}
|
|
||||||
colors = {
|
|
||||||
-- add/modify theme and palette colors
|
|
||||||
palette = {},
|
|
||||||
theme = { wave = {}, lotus = {}, dragon = {}, all = { ui = { bg_gutter = "none" } } },
|
|
||||||
},
|
|
||||||
overrides = function(colors) -- add/modify highlights
|
|
||||||
local theme = colors.theme
|
|
||||||
return {
|
|
||||||
CursorLine = { bg = "#272735" },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
theme = "wave", -- Load "wave" theme when 'background' option is not set
|
|
||||||
background = { -- map the value of 'background' option to a theme
|
|
||||||
dark = "wave", -- try "dragon" !
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.cmd("colorscheme kanagawa")
|
|
||||||
@ -1 +0,0 @@
|
|||||||
vim.g.tokyonight_style = "night"
|
|
||||||
@ -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