mirror of
https://git.aramjonghu.nl/AramJonghu/nvim.git
synced 2026-03-22 01:39:54 +01:00
formatted
This commit is contained in:
@@ -6,10 +6,7 @@ vim.cmd("source ~/.config/nvim/suda.vim")
|
|||||||
local time = tonumber(os.date "%H")
|
local time = tonumber(os.date "%H")
|
||||||
|
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
pattern = {
|
pattern = {[".*/hypr/.*%.conf"] = "hyprlang", [".*/uwsm/env.*"] = "zsh"}
|
||||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
|
||||||
[".*/uwsm/env.*"] = "zsh",
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd [[colorscheme catppuccin-macchiato]]
|
vim.cmd [[colorscheme catppuccin-macchiato]]
|
||||||
|
|||||||
+2
-4
@@ -2,9 +2,7 @@ local autocmd = vim.api.nvim_create_autocmd
|
|||||||
|
|
||||||
autocmd("BufWritePre", {
|
autocmd("BufWritePre", {
|
||||||
callback = function()
|
callback = function()
|
||||||
local ok = pcall(function()
|
local ok = pcall(function() vim.cmd "undojoin" end)
|
||||||
vim.cmd "undojoin"
|
|
||||||
end)
|
|
||||||
vim.cmd "Neoformat"
|
vim.cmd "Neoformat"
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,18 +21,17 @@ require("auto-session").setup ({
|
|||||||
log_level = "error",
|
log_level = "error",
|
||||||
session_lens = {
|
session_lens = {
|
||||||
load_on_setup = true,
|
load_on_setup = true,
|
||||||
theme_conf = {
|
theme_conf = {},
|
||||||
},
|
|
||||||
previewer = false,
|
previewer = false,
|
||||||
mappings = {
|
mappings = {
|
||||||
delete_session = {"i", "<C-D>"},
|
delete_session = {"i", "<C-D>"},
|
||||||
alternate_session = {"i", "<C-S>"},
|
alternate_session = {"i", "<C-S>"},
|
||||||
copy_session = { "i", "<C-Y>" },
|
copy_session = {"i", "<C-Y>"}
|
||||||
},
|
},
|
||||||
session_control = {
|
session_control = {
|
||||||
control_dir = vim.fn.stdpath "data" .. "/auto_session/",
|
control_dir = vim.fn.stdpath "data" .. "/auto_session/",
|
||||||
control_filename = "session_control.json",
|
control_filename = "session_control.json"
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
+9
-16
@@ -4,29 +4,22 @@ require("bufferline").setup ({
|
|||||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
local s = " "
|
local s = " "
|
||||||
for e, n in pairs(diagnostics_dict) do
|
for e, n in pairs(diagnostics_dict) do
|
||||||
local sym = e == "error" and " "
|
local sym = e == "error" and " " or
|
||||||
or (e == "warning" and " " or " ")
|
(e == "warning" and " " or " ")
|
||||||
s = s .. n .. sym
|
s = s .. n .. sym
|
||||||
end
|
end
|
||||||
return s
|
return s
|
||||||
end,
|
end,
|
||||||
always_show_bufferline = true,
|
always_show_bufferline = true,
|
||||||
offsets = {
|
offsets = {
|
||||||
|
{filetype = "NvimTree", text = "Explorer", text_align = "center"},
|
||||||
|
{filetype = "snacks_layout_box"}
|
||||||
|
},
|
||||||
|
vim.api.nvim_create_autocmd({"BufAdd", "BufDelete"},
|
||||||
{
|
{
|
||||||
filetype = "NvimTree",
|
|
||||||
text = "Explorer",
|
|
||||||
text_align = "center",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filetype = "snacks_layout_box",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.schedule(function()
|
vim.schedule(function() pcall(nvim_bufferline) end)
|
||||||
pcall(nvim_bufferline)
|
end
|
||||||
end)
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require("colorizer").setup({
|
|||||||
css = true,
|
css = true,
|
||||||
tailwind = true,
|
tailwind = true,
|
||||||
sass = {enable = true, parsers = {"css"}},
|
sass = {enable = true, parsers = {"css"}},
|
||||||
virtualtext_inline = 'before',
|
virtualtext_inline = 'before'
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
require("copilot").setup({
|
|
||||||
panel = {
|
|
||||||
enabled = true,
|
|
||||||
auto_refresh = true,
|
|
||||||
keymap = {
|
|
||||||
jump_prev = "[[",
|
|
||||||
jump_next = "]]",
|
|
||||||
accept = "<CR>",
|
|
||||||
refresh = "gr",
|
|
||||||
open = "<M-CR>"
|
|
||||||
},
|
|
||||||
layout = {
|
|
||||||
position = "bottom", -- | top | left | right | horizontal | vertical
|
|
||||||
ratio = 0.4
|
|
||||||
},
|
|
||||||
},
|
|
||||||
suggestion = {
|
|
||||||
enabled = true,
|
|
||||||
auto_trigger = true,
|
|
||||||
hide_during_completion = true,
|
|
||||||
debounce = 75,
|
|
||||||
keymap = {
|
|
||||||
accept = "<A-tab>",
|
|
||||||
accept_word = false,
|
|
||||||
accept_line = false,
|
|
||||||
next = "<M-]>",
|
|
||||||
prev = "<M-[>",
|
|
||||||
dismiss = "<C-]>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = {
|
|
||||||
-- yaml = false,
|
|
||||||
-- markdown = false,
|
|
||||||
-- help = false,
|
|
||||||
-- gitcommit = false,
|
|
||||||
-- gitrebase = false,
|
|
||||||
-- hgcommit = false,
|
|
||||||
-- svn = false,
|
|
||||||
-- cvs = false,
|
|
||||||
-- python = false,
|
|
||||||
-- html = false,
|
|
||||||
-- css = false,
|
|
||||||
-- sh = false,
|
|
||||||
-- tex = false,
|
|
||||||
-- typescript = false,
|
|
||||||
-- java = false,
|
|
||||||
-- swift = false,
|
|
||||||
-- cpp = false,
|
|
||||||
-- hypr = false,
|
|
||||||
-- ["."] = false,
|
|
||||||
},
|
|
||||||
copilot_node_command = 'node', -- Node.js version must be > 18.x
|
|
||||||
server_opts_overrides = {},
|
|
||||||
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
|
|
||||||
callback = function()
|
|
||||||
vim.cmd( "CopilotChatSave AutoSave" )
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
vim.api.nvim_create_autocmd( "VimEnter", {
|
|
||||||
callback = function()
|
|
||||||
vim.cmd( "CopilotChatLoad AutoSave" )
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
+21
-25
@@ -7,20 +7,17 @@ dap.adapters.python = function(cb, config)
|
|||||||
local host = (config.connect or config).host or '127.0.0.1'
|
local host = (config.connect or config).host or '127.0.0.1'
|
||||||
cb({
|
cb({
|
||||||
type = 'server',
|
type = 'server',
|
||||||
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
|
port = assert(port,
|
||||||
|
'`connect.port` is required for a python `attach` configuration'),
|
||||||
host = host,
|
host = host,
|
||||||
options = {
|
options = {source_filetype = 'python'}
|
||||||
source_filetype = 'python',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
cb({
|
cb({
|
||||||
type = 'executable',
|
type = 'executable',
|
||||||
command = 'path/to/virtualenvs/debugpy/bin/python',
|
command = 'path/to/virtualenvs/debugpy/bin/python',
|
||||||
args = {'-m', 'debugpy.adapter'},
|
args = {'-m', 'debugpy.adapter'},
|
||||||
options = {
|
options = {source_filetype = 'python'}
|
||||||
source_filetype = 'python',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -28,13 +25,13 @@ end
|
|||||||
dap.configurations.python = {
|
dap.configurations.python = {
|
||||||
{
|
{
|
||||||
-- The first three options are required by nvim-dap
|
-- The first three options are required by nvim-dap
|
||||||
type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
|
type = 'python', -- the type here established the link to the adapter definition: `dap.adapters.python`
|
||||||
request = 'launch';
|
request = 'launch',
|
||||||
name = "Launch file";
|
name = "Launch file",
|
||||||
|
|
||||||
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
||||||
|
|
||||||
program = "${file}"; -- This configuration will launch the current file if used.
|
program = "${file}", -- This configuration will launch the current file if used.
|
||||||
pythonPath = function()
|
pythonPath = function()
|
||||||
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
||||||
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
||||||
@@ -47,8 +44,8 @@ dap.configurations.python = {
|
|||||||
else
|
else
|
||||||
return '/home/zach/miniconda3/bin/python'
|
return '/home/zach/miniconda3/bin/python'
|
||||||
end
|
end
|
||||||
end;
|
end
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.adapters.lldb = {
|
dap.adapters.lldb = {
|
||||||
@@ -63,11 +60,12 @@ dap.configurations.cpp = {
|
|||||||
type = 'lldb',
|
type = 'lldb',
|
||||||
request = 'launch',
|
request = 'launch',
|
||||||
program = function()
|
program = function()
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/',
|
||||||
|
'file')
|
||||||
end,
|
end,
|
||||||
cwd = '${workspaceFolder}',
|
cwd = '${workspaceFolder}',
|
||||||
stopOnEntry = false,
|
stopOnEntry = false,
|
||||||
args = {},
|
args = {}
|
||||||
|
|
||||||
-- 💀
|
-- 💀
|
||||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||||
@@ -81,7 +79,7 @@ dap.configurations.cpp = {
|
|||||||
-- But you should be aware of the implications:
|
-- But you should be aware of the implications:
|
||||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||||
-- runInTerminal = false,
|
-- runInTerminal = false,
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.adapters["pwa-node"] = {
|
dap.adapters["pwa-node"] = {
|
||||||
@@ -91,7 +89,10 @@ dap.adapters["pwa-node"] = {
|
|||||||
executable = {
|
executable = {
|
||||||
command = "node",
|
command = "node",
|
||||||
-- 💀 Make sure to update this path to point to your installation
|
-- 💀 Make sure to update this path to point to your installation
|
||||||
args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"},
|
args = {
|
||||||
|
"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
|
||||||
|
"${port}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,15 +102,10 @@ dap.configurations.javascript = {
|
|||||||
request = "launch",
|
request = "launch",
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
program = "${file}",
|
program = "${file}",
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}"
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.java = {
|
dap.configurations.java = {
|
||||||
{
|
{type = "java", name = "Debug", request = "launch", program = "${file}"}
|
||||||
type = "java",
|
|
||||||
name = "Debug",
|
|
||||||
request = "launch",
|
|
||||||
program = "${file}",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
local highlight = {
|
local highlight = {
|
||||||
"RainbowRed",
|
"RainbowRed", "RainbowYellow", "RainbowBlue", "RainbowOrange",
|
||||||
"RainbowYellow",
|
"RainbowGreen", "RainbowViolet", "RainbowCyan"
|
||||||
"RainbowBlue",
|
|
||||||
"RainbowOrange",
|
|
||||||
"RainbowGreen",
|
|
||||||
"RainbowViolet",
|
|
||||||
"RainbowCyan",
|
|
||||||
}
|
}
|
||||||
local hooks = require "ibl.hooks"
|
local hooks = require "ibl.hooks"
|
||||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||||
@@ -21,9 +16,7 @@ hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
vim.g.rainbow_delimiters = {highlight = highlight}
|
vim.g.rainbow_delimiters = {highlight = highlight}
|
||||||
require("ibl").setup {
|
require("ibl").setup {indent = {char = "▏"}, scope = {highlight = highlight}}
|
||||||
indent = { char = "▏" },
|
|
||||||
scope = { highlight = highlight }
|
|
||||||
}
|
|
||||||
|
|
||||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
hooks.register(hooks.type.SCOPE_HIGHLIGHT,
|
||||||
|
hooks.builtin.scope_highlight_from_extmark)
|
||||||
|
|||||||
+8
-6
@@ -2,12 +2,14 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({
|
||||||
|
"git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo,
|
||||||
|
lazypath
|
||||||
|
})
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{"Failed to clone lazy.nvim:\n", "ErrorMsg"}, {out, "WarningMsg"},
|
||||||
{ out, "WarningMsg" },
|
{"\nPress any key to exit..."}
|
||||||
{ "\nPress any key to exit..." },
|
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
@@ -25,11 +27,11 @@ vim.g.maplocalleader = "\\"
|
|||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
-- import your plugins
|
-- import your plugins
|
||||||
{ import = "plugins" },
|
{import = "plugins"}
|
||||||
},
|
},
|
||||||
-- Configure any other settings here. See the documentation for more details.
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
-- colorscheme that will be used when installing plugins.
|
-- colorscheme that will be used when installing plugins.
|
||||||
install = {colorscheme = {"habamax"}},
|
install = {colorscheme = {"habamax"}},
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = {enabled = true}
|
||||||
})
|
})
|
||||||
|
|||||||
+32
-47
@@ -1,11 +1,8 @@
|
|||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local cmp_lsp = require("cmp_nvim_lsp")
|
local cmp_lsp = require("cmp_nvim_lsp")
|
||||||
local capabilities = vim.tbl_deep_extend(
|
local capabilities = vim.tbl_deep_extend("force", {}, vim.lsp.protocol
|
||||||
"force",
|
.make_client_capabilities(),
|
||||||
{},
|
cmp_lsp.default_capabilities())
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
cmp_lsp.default_capabilities()
|
|
||||||
)
|
|
||||||
|
|
||||||
local cmp_kinds = { -- change later
|
local cmp_kinds = { -- change later
|
||||||
Text = ' ',
|
Text = ' ',
|
||||||
@@ -32,7 +29,7 @@ local cmp_kinds = { --change later
|
|||||||
Struct = ' ',
|
Struct = ' ',
|
||||||
Event = ' ',
|
Event = ' ',
|
||||||
Operator = ' ',
|
Operator = ' ',
|
||||||
TypeParameter = ' ',
|
TypeParameter = ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
require("fidget").setup({})
|
require("fidget").setup({})
|
||||||
@@ -40,21 +37,13 @@ require("mason").setup()
|
|||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
automatic_enable = true,
|
automatic_enable = true,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls", "rust_analyzer", "jdtls", "yamlls", "ts_ls", "tailwindcss",
|
||||||
"rust_analyzer",
|
"html", "cssls"
|
||||||
"jdtls",
|
|
||||||
"prettier",
|
|
||||||
"yamlls",
|
|
||||||
"ts_ls",
|
|
||||||
"tailwindcss",
|
|
||||||
"html",
|
|
||||||
"cssls",
|
|
||||||
"shfmt",
|
|
||||||
},
|
},
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name) -- default handler (optional)
|
function(server_name) -- default handler (optional)
|
||||||
require("lspconfig")[server_name].setup {
|
require("lspconfig")[server_name].setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -62,14 +51,15 @@ require("mason-lspconfig").setup({
|
|||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
lspconfig.zls.setup({
|
lspconfig.zls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
root_dir = lspconfig.util.root_pattern(".git", "build.zig",
|
||||||
|
"zls.json"),
|
||||||
settings = {
|
settings = {
|
||||||
zls = {
|
zls = {
|
||||||
enable_inlay_hints = true,
|
enable_inlay_hints = true,
|
||||||
enable_snippets = true,
|
enable_snippets = true,
|
||||||
warn_style = true,
|
warn_style = true
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
vim.g.zig_fmt_parse_errors = 0
|
vim.g.zig_fmt_parse_errors = 0
|
||||||
vim.g.zig_fmt_autosave = 0
|
vim.g.zig_fmt_autosave = 0
|
||||||
@@ -83,12 +73,15 @@ require("mason-lspconfig").setup({
|
|||||||
Lua = {
|
Lua = {
|
||||||
runtime = {version = "Lua 5.1"},
|
runtime = {version = "Lua 5.1"},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
globals = {
|
||||||
|
"bit", "vim", "it", "describe", "before_each",
|
||||||
|
"after_each"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end,
|
}
|
||||||
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -101,13 +94,11 @@ cmp.setup {
|
|||||||
vim_item.menu = entry.completion_item.detail
|
vim_item.menu = entry.completion_item.detail
|
||||||
end
|
end
|
||||||
return vim_item
|
return vim_item
|
||||||
end,
|
end
|
||||||
},
|
},
|
||||||
completion = {completeopt = "menu,menuone"},
|
completion = {completeopt = "menu,menuone"},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args) require("luasnip").lsp_expand(args.body) end
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
mapping = { -- change later zach is ????
|
mapping = { -- change later zach is ????
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
@@ -116,7 +107,7 @@ cmp.setup {
|
|||||||
["<C-e>"] = cmp.mapping.close(),
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
["<CR>"] = cmp.mapping.confirm {
|
["<CR>"] = cmp.mapping.confirm {
|
||||||
behavior = cmp.ConfirmBehavior.Insert,
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
select = true,
|
select = true
|
||||||
},
|
},
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
@@ -135,16 +126,13 @@ cmp.setup {
|
|||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, {"i", "s"})
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "path" },
|
{name = "path"}, {name = "nvim_lsp"}, {name = "luasnip"}, -- snip snip
|
||||||
{ name = "nvim_lsp" },
|
{name = "buffer"}, {name = "nvim_lua"}
|
||||||
{ name = "luasnip" }, -- snip snip
|
})
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "nvim_lua" },
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
@@ -156,21 +144,18 @@ vim.diagnostic.config({
|
|||||||
border = "rounded",
|
border = "rounded",
|
||||||
source = "always",
|
source = "always",
|
||||||
header = "",
|
header = "",
|
||||||
prefix = "",
|
prefix = ""
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>",
|
||||||
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", { noremap = true, silent = true })
|
{noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>",
|
||||||
|
{noremap = true, silent = true})
|
||||||
|
|
||||||
local lspconfig = require "lspconfig"
|
local lspconfig = require "lspconfig"
|
||||||
|
|
||||||
-- EXAMPLE
|
-- EXAMPLE
|
||||||
local servers = {
|
local servers = {}
|
||||||
|
|
||||||
}
|
for _, server in ipairs(servers) do lspconfig[server].setup {} end
|
||||||
|
|
||||||
for _, server in ipairs(servers) do
|
|
||||||
lspconfig[server].setup {
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|||||||
+30
-69
@@ -1,7 +1,8 @@
|
|||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
|
|
||||||
local function get_coc_lsp_client()
|
local function get_coc_lsp_client()
|
||||||
local clients = vim.g.coc_service_initialized and vim.fn['CocAction']('services') or {}
|
local clients = vim.g.coc_service_initialized and
|
||||||
|
vim.fn['CocAction']('services') or {}
|
||||||
for _, client in pairs(clients) do
|
for _, client in pairs(clients) do
|
||||||
if client['state'] == 'running' then
|
if client['state'] == 'running' then
|
||||||
local client_name = client['id']
|
local client_name = client['id']
|
||||||
@@ -14,9 +15,7 @@ local function get_coc_lsp_client()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function spell()
|
local function spell()
|
||||||
if vim.o.spell then
|
if vim.o.spell then return string.format("[SPELL]") end
|
||||||
return string.format("[SPELL]")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
@@ -24,11 +23,10 @@ end
|
|||||||
--- show indicator for Chinese IME
|
--- show indicator for Chinese IME
|
||||||
local function ime_state()
|
local function ime_state()
|
||||||
if vim.g.is_mac then
|
if vim.g.is_mac then
|
||||||
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout",
|
||||||
|
"")
|
||||||
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
||||||
if res ~= -1 then
|
if res ~= -1 then return "[CN]" end
|
||||||
return "[CN]"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
@@ -36,9 +34,7 @@ end
|
|||||||
|
|
||||||
local diff = function()
|
local diff = function()
|
||||||
local git_status = vim.b.gitsigns_status_dict
|
local git_status = vim.b.gitsigns_status_dict
|
||||||
if git_status == nil then
|
if git_status == nil then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local modify_num = git_status.changed
|
local modify_num = git_status.changed
|
||||||
local remove_num = git_status.removed
|
local remove_num = git_status.removed
|
||||||
@@ -51,9 +47,7 @@ end
|
|||||||
|
|
||||||
local virtual_env = function()
|
local virtual_env = function()
|
||||||
-- only show virtual env for Python
|
-- only show virtual env for Python
|
||||||
if vim.bo.filetype ~= "python" then
|
if vim.bo.filetype ~= "python" then return "" end
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
|
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
|
||||||
local venv_path = os.getenv("VIRTUAL_ENV")
|
local venv_path = os.getenv("VIRTUAL_ENV")
|
||||||
@@ -78,14 +72,10 @@ require("lualine").setup {
|
|||||||
component_separators = '',
|
component_separators = '',
|
||||||
section_separators = {left = '', right = ''},
|
section_separators = {left = '', right = ''},
|
||||||
disabled_filetypes = {},
|
disabled_filetypes = {},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {
|
lualine_a = {{"mode"}},
|
||||||
{
|
|
||||||
"mode",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
{
|
{
|
||||||
"branch",
|
"branch",
|
||||||
@@ -94,63 +84,34 @@ require("lualine").setup {
|
|||||||
return string.sub(name, 1, 20)
|
return string.sub(name, 1, 20)
|
||||||
end,
|
end,
|
||||||
color = {gui = "italic,bold"},
|
color = {gui = "italic,bold"},
|
||||||
separator = { right = "" },
|
separator = {right = ""}
|
||||||
},
|
}, {virtual_env, color = {fg = "black", bg = "#F1CA81"}}
|
||||||
{
|
|
||||||
virtual_env,
|
|
||||||
color = { fg = "black", bg = "#F1CA81" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{"filename", symbols = {readonly = "[🔒]"}},
|
||||||
"filename",
|
{"diff", source = diff},
|
||||||
symbols = {
|
{"%S", color = {gui = "bold", fg = "cyan"}},
|
||||||
readonly = "[🔒]",
|
{spell, color = {fg = "black", bg = "#a7c080"}}
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"diff",
|
|
||||||
source = diff,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"%S",
|
|
||||||
color = { gui = "bold", fg = "cyan" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
spell,
|
|
||||||
color = { fg = "black", bg = "#a7c080" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
{
|
{ime_state, color = {fg = "black", bg = "#f46868"}},
|
||||||
ime_state,
|
{get_coc_lsp_client, icon = " LSP:"}, {
|
||||||
color = { fg = "black", bg = "#f46868" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
get_coc_lsp_client,
|
|
||||||
icon = " LSP:",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = {"nvim_diagnostic"},
|
sources = {"nvim_diagnostic"},
|
||||||
symbols = { error = "🆇 ", warn = "⚠️ ", info = "ℹ️ ", hint = " " },
|
symbols = {
|
||||||
},
|
error = "🆇 ",
|
||||||
|
warn = "⚠️ ",
|
||||||
|
info = "ℹ️ ",
|
||||||
|
hint = " "
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
{"encoding", fmt = string.upper},
|
{"encoding", fmt = string.upper},
|
||||||
{
|
{"fileformat", symbols = {unix = "", dos = "", mac = ""}},
|
||||||
"fileformat",
|
"filetype"
|
||||||
symbols = {
|
|
||||||
unix = "",
|
|
||||||
dos = "",
|
|
||||||
mac = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"filetype",
|
|
||||||
},
|
|
||||||
lualine_z = {
|
|
||||||
"progress",
|
|
||||||
},
|
},
|
||||||
|
lualine_z = {"progress"}
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
@@ -158,8 +119,8 @@ require("lualine").setup {
|
|||||||
lualine_c = {"filename"},
|
lualine_c = {"filename"},
|
||||||
lualine_x = {"location"},
|
lualine_x = {"location"},
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {},
|
lualine_z = {}
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
extensions = { "quickfix", "fugitive", "nvim-tree" },
|
extensions = {"quickfix", "fugitive", "nvim-tree"}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-35
@@ -13,12 +13,12 @@ require('notify').setup({
|
|||||||
WARN = "",
|
WARN = "",
|
||||||
INFO = "",
|
INFO = "",
|
||||||
DEBUG = "",
|
DEBUG = "",
|
||||||
TRACE = "✎",
|
TRACE = "✎"
|
||||||
},
|
},
|
||||||
on_open = function(win)
|
on_open = function(win)
|
||||||
-- vim.api.nvim_win_set_option(win, 'wrap', true)
|
-- vim.api.nvim_win_set_option(win, 'wrap', true)
|
||||||
vim.api.nvim_win_set_option(win, 'breakat', ' ')
|
vim.api.nvim_win_set_option(win, 'breakat', ' ')
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Utility functions shared between progress reports for LSP and DAP
|
-- Utility functions shared between progress reports for LSP and DAP
|
||||||
@@ -26,9 +26,7 @@ require('notify').setup({
|
|||||||
local client_notifs = {}
|
local client_notifs = {}
|
||||||
|
|
||||||
local function get_notif_data(client_id, token)
|
local function get_notif_data(client_id, token)
|
||||||
if not client_notifs[client_id] then
|
if not client_notifs[client_id] then client_notifs[client_id] = {} end
|
||||||
client_notifs[client_id] = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
if not client_notifs[client_id][token] then
|
if not client_notifs[client_id][token] then
|
||||||
client_notifs[client_id][token] = {}
|
client_notifs[client_id][token] = {}
|
||||||
@@ -37,7 +35,6 @@ local function get_notif_data(client_id, token)
|
|||||||
return client_notifs[client_id][token]
|
return client_notifs[client_id][token]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local spinner_frames = {"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
|
local spinner_frames = {"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
|
||||||
|
|
||||||
local function update_spinner(client_id, token)
|
local function update_spinner(client_id, token)
|
||||||
@@ -50,12 +47,10 @@ local function update_spinner(client_id, token)
|
|||||||
notif_data.notification = vim.notify(nil, nil, {
|
notif_data.notification = vim.notify(nil, nil, {
|
||||||
hide_from_history = true,
|
hide_from_history = true,
|
||||||
icon = spinner_frames[new_spinner],
|
icon = spinner_frames[new_spinner],
|
||||||
replace = notif_data.notification,
|
replace = notif_data.notification
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function() update_spinner(client_id, token) end, 100)
|
||||||
update_spinner(client_id, token)
|
|
||||||
end, 100)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -75,9 +70,7 @@ vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
|||||||
|
|
||||||
local val = result.value
|
local val = result.value
|
||||||
|
|
||||||
if not val.kind then
|
if not val.kind then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local notif_data = get_notif_data(client_id, result.token)
|
local notif_data = get_notif_data(client_id, result.token)
|
||||||
|
|
||||||
@@ -85,25 +78,29 @@ vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
|||||||
local message = format_message(val.message, val.percentage)
|
local message = format_message(val.message, val.percentage)
|
||||||
|
|
||||||
notif_data.notification = vim.notify(message, "info", {
|
notif_data.notification = vim.notify(message, "info", {
|
||||||
title = format_title(val.title, vim.lsp.get_client_by_id(client_id).name),
|
title = format_title(val.title,
|
||||||
|
vim.lsp.get_client_by_id(client_id).name),
|
||||||
icon = spinner_frames[1],
|
icon = spinner_frames[1],
|
||||||
timeout = false,
|
timeout = false,
|
||||||
hide_from_history = false,
|
hide_from_history = false
|
||||||
})
|
})
|
||||||
|
|
||||||
notif_data.spinner = 1
|
notif_data.spinner = 1
|
||||||
update_spinner(client_id, result.token)
|
update_spinner(client_id, result.token)
|
||||||
elseif val.kind == "report" and notif_data then
|
elseif val.kind == "report" and notif_data then
|
||||||
notif_data.notification = vim.notify(format_message(val.message, val.percentage), "info", {
|
notif_data.notification = vim.notify(
|
||||||
|
format_message(val.message, val.percentage),
|
||||||
|
"info", {
|
||||||
replace = notif_data.notification,
|
replace = notif_data.notification,
|
||||||
hide_from_history = false,
|
hide_from_history = false
|
||||||
})
|
})
|
||||||
elseif val.kind == "end" and notif_data then
|
elseif val.kind == "end" and notif_data then
|
||||||
notif_data.notification =
|
notif_data.notification = vim.notify(val.message and
|
||||||
vim.notify(val.message and format_message(val.message) or "Complete", "info", {
|
format_message(val.message) or
|
||||||
|
"Complete", "info", {
|
||||||
icon = "",
|
icon = "",
|
||||||
replace = notif_data.notification,
|
replace = notif_data.notification,
|
||||||
timeout = 6000,
|
timeout = 6000
|
||||||
})
|
})
|
||||||
|
|
||||||
notif_data.spinner = nil
|
notif_data.spinner = nil
|
||||||
@@ -111,20 +108,18 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- table from lsp severity to vim severity.
|
-- table from lsp severity to vim severity.
|
||||||
local severity = {
|
local severity = {"error", "warn", "info"}
|
||||||
"error",
|
|
||||||
"warn",
|
|
||||||
"info",
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
|
vim.lsp.handlers["window/showMessage"] =
|
||||||
|
function(err, method, params, client_id)
|
||||||
vim.notify(method.message, severity[params.type])
|
vim.notify(method.message, severity[params.type])
|
||||||
end
|
end
|
||||||
|
|
||||||
-- DAP integration
|
-- DAP integration
|
||||||
-- Make sure to also have the snippet with the common helper functions in your config!
|
-- Make sure to also have the snippet with the common helper functions in your config!
|
||||||
|
|
||||||
dap.listeners.before['event_progressStart']['progress-notifications'] = function(session, body)
|
dap.listeners.before['event_progressStart']['progress-notifications'] =
|
||||||
|
function(session, body)
|
||||||
local notif_data = get_notif_data("dap", body.progressId)
|
local notif_data = get_notif_data("dap", body.progressId)
|
||||||
|
|
||||||
local message = format_message(body.message, body.percentage)
|
local message = format_message(body.message, body.percentage)
|
||||||
@@ -132,24 +127,30 @@ dap.listeners.before['event_progressStart']['progress-notifications'] = function
|
|||||||
title = format_title(body.title, session.config.type),
|
title = format_title(body.title, session.config.type),
|
||||||
icon = spinner_frames[1],
|
icon = spinner_frames[1],
|
||||||
timeout = false,
|
timeout = false,
|
||||||
hide_from_history = false,
|
hide_from_history = false
|
||||||
})
|
})
|
||||||
|
|
||||||
notif_data.notification.spinner = 1,
|
notif_data.notification.spinner = 1, update_spinner("dap",
|
||||||
update_spinner("dap", body.progressId)
|
body.progressId)
|
||||||
end
|
end
|
||||||
|
|
||||||
dap.listeners.before['event_progressUpdate']['progress-notifications'] = function(session, body)
|
dap.listeners.before['event_progressUpdate']['progress-notifications'] =
|
||||||
|
function(session, body)
|
||||||
local notif_data = get_notif_data("dap", body.progressId)
|
local notif_data = get_notif_data("dap", body.progressId)
|
||||||
notif_data.notification = vim.notify(format_message(body.message, body.percentage), "info", {
|
notif_data.notification = vim.notify(
|
||||||
|
format_message(body.message,
|
||||||
|
body.percentage), "info", {
|
||||||
replace = notif_data.notification,
|
replace = notif_data.notification,
|
||||||
hide_from_history = false,
|
hide_from_history = false
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
dap.listeners.before['event_progressEnd']['progress-notifications'] = function(session, body)
|
dap.listeners.before['event_progressEnd']['progress-notifications'] = function(
|
||||||
|
session, body)
|
||||||
local notif_data = client_notifs["dap"][body.progressId]
|
local notif_data = client_notifs["dap"][body.progressId]
|
||||||
notif_data.notification = vim.notify(body.message and format_message(body.message) or "Complete", "info", {
|
notif_data.notification = vim.notify(body.message and
|
||||||
|
format_message(body.message) or
|
||||||
|
"Complete", "info", {
|
||||||
icon = "",
|
icon = "",
|
||||||
replace = notif_data.notification,
|
replace = notif_data.notification,
|
||||||
timeout = 6000
|
timeout = 6000
|
||||||
|
|||||||
+4
-12
@@ -1,14 +1,6 @@
|
|||||||
require("nvim-tree").setup({
|
require("nvim-tree").setup({
|
||||||
sort = {
|
sort = {sorter = "case_sensitive"},
|
||||||
sorter = "case_sensitive",
|
view = {width = 45},
|
||||||
},
|
renderer = {group_empty = true},
|
||||||
view = {
|
filters = {dotfiles = true}
|
||||||
width = 45,
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
group_empty = true,
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
dotfiles = true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require("gruvbox").setup({
|
|||||||
emphasis = true,
|
emphasis = true,
|
||||||
comments = true,
|
comments = true,
|
||||||
operators = false,
|
operators = false,
|
||||||
folds = true,
|
folds = true
|
||||||
},
|
},
|
||||||
strikethrough = true,
|
strikethrough = true,
|
||||||
invert_selection = false,
|
invert_selection = false,
|
||||||
@@ -21,5 +21,5 @@ require("gruvbox").setup({
|
|||||||
palette_overrides = {},
|
palette_overrides = {},
|
||||||
overrides = {},
|
overrides = {},
|
||||||
dim_inactive = false,
|
dim_inactive = false,
|
||||||
transparent_mode = false,
|
transparent_mode = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,24 +2,8 @@ require'nvim-treesitter.configs'.setup {
|
|||||||
ensure_installed = "all",
|
ensure_installed = "all",
|
||||||
sync_install = true,
|
sync_install = true,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {enable = true, additional_vim_regex_highlighting = false},
|
||||||
enable = true,
|
indent = {enable = true, disable = {}},
|
||||||
additional_vim_regex_highlighting = false,
|
ensure_installed = {"jsx", "toml", "json", "yaml", "css", "html", "lua"},
|
||||||
},
|
autotag = {enable = true}
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
disable = {},
|
|
||||||
},
|
|
||||||
ensure_installed = {
|
|
||||||
"jsx",
|
|
||||||
"toml",
|
|
||||||
"json",
|
|
||||||
"yaml",
|
|
||||||
"css",
|
|
||||||
"html",
|
|
||||||
"lua"
|
|
||||||
},
|
|
||||||
autotag = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ require('undotree').setup({
|
|||||||
float_diff = true,
|
float_diff = true,
|
||||||
layout = "left_bottom",
|
layout = "left_bottom",
|
||||||
position = "left",
|
position = "left",
|
||||||
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
|
ignore_filetype = {
|
||||||
window = {
|
'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel',
|
||||||
winblend = 30,
|
'tsplayground'
|
||||||
},
|
},
|
||||||
|
window = {winblend = 30},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
['j'] = "move_next",
|
['j'] = "move_next",
|
||||||
['k'] = "move_prev",
|
['k'] = "move_prev",
|
||||||
@@ -14,6 +15,6 @@ require('undotree').setup({
|
|||||||
['K'] = "move_change_prev",
|
['K'] = "move_change_prev",
|
||||||
['<cr>'] = "action_enter",
|
['<cr>'] = "action_enter",
|
||||||
['p'] = "enter_diffbuf",
|
['p'] = "enter_diffbuf",
|
||||||
['q'] = "quit",
|
['q'] = "quit"
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
+6
-5
@@ -1,7 +1,9 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
local default_opts = {noremap = true}
|
local default_opts = {noremap = true}
|
||||||
|
|
||||||
map('n', '<leader>ff', "<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!.git' }})<cr>", default_opts)
|
map('n', '<leader>ff',
|
||||||
|
"<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!.git' }})<cr>",
|
||||||
|
default_opts)
|
||||||
|
|
||||||
map({"n", "v"}, "<leader>ap", require("actions-preview").code_actions)
|
map({"n", "v"}, "<leader>ap", require("actions-preview").code_actions)
|
||||||
|
|
||||||
@@ -21,7 +23,8 @@ map("n", "<A-k>", "<C-w>k", { desc = "Move to top split" })
|
|||||||
map("n", "<A-l>", "<C-w>l", {desc = "Move to right split"})
|
map("n", "<A-l>", "<C-w>l", {desc = "Move to right split"})
|
||||||
|
|
||||||
map('n', '<leader>e', vim.cmd.NvimTreeToggle)
|
map('n', '<leader>e', vim.cmd.NvimTreeToggle)
|
||||||
map('n', '<leader>u', require('undotree').toggle, { noremap = true, silent = true })
|
map('n', '<leader>u', require('undotree').toggle,
|
||||||
|
{noremap = true, silent = true})
|
||||||
|
|
||||||
map("n", "<A-->", ":bdelete<CR>")
|
map("n", "<A-->", ":bdelete<CR>")
|
||||||
-- map("n", "<SA-->", ":BufferRestore<CR>")
|
-- map("n", "<SA-->", ":BufferRestore<CR>")
|
||||||
@@ -54,6 +57,4 @@ map("i", "<C-c>", "<Esc>")
|
|||||||
|
|
||||||
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
|
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
|
||||||
|
|
||||||
map("n", "<leader><leader>", function()
|
map("n", "<leader><leader>", function() vim.cmd("so") end)
|
||||||
vim.cmd("so")
|
|
||||||
end)
|
|
||||||
|
|||||||
+4
-2
@@ -20,7 +20,8 @@ vim.opt.updatetime = 50
|
|||||||
vim.opt.textwidth = 0
|
vim.opt.textwidth = 0
|
||||||
vim.opt.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
vim.opt.formatoptions = "rqnj"
|
vim.opt.formatoptions = "rqnj"
|
||||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
vim.o.sessionoptions =
|
||||||
|
"blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||||
vim.o.laststatus = 3
|
vim.o.laststatus = 3
|
||||||
vim.o.clipboard = "unnamedplus"
|
vim.o.clipboard = "unnamedplus"
|
||||||
vim.o.cursorline = true
|
vim.o.cursorline = true
|
||||||
@@ -45,4 +46,5 @@ vim.g.loaded_ruby_provider = 0
|
|||||||
local is_windows = vim.fn.has "win32" ~= 0
|
local is_windows = vim.fn.has "win32" ~= 0
|
||||||
local sep = is_windows and "\\" or "/"
|
local sep = is_windows and "\\" or "/"
|
||||||
local delim = is_windows and ";" or ":"
|
local delim = is_windows and ";" or ":"
|
||||||
vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH
|
vim.env.PATH = table.concat({vim.fn.stdpath "data", "mason", "bin"}, sep) ..
|
||||||
|
delim .. vim.env.PATH
|
||||||
|
|||||||
+44
-128
@@ -1,51 +1,36 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"aznhe21/actions-preview.nvim",
|
"aznhe21/actions-preview.nvim",
|
||||||
config = function()
|
config = function() require("actions-preview") end
|
||||||
require("actions-preview")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sbdchd/neoformat",
|
"sbdchd/neoformat",
|
||||||
init = function()
|
init = function()
|
||||||
vim.cmd(
|
vim.cmd("source" .. vim.fn.stdpath "config" ..
|
||||||
"source"
|
"/lua/config/neoformat.vim")
|
||||||
.. vim.fn.stdpath "config"
|
end
|
||||||
.. "/lua/config/neoformat.vim"
|
}, {
|
||||||
)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rachartier/tiny-inline-diagnostic.nvim",
|
"rachartier/tiny-inline-diagnostic.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("tiny-inline-diagnostic").setup()
|
require("tiny-inline-diagnostic").setup()
|
||||||
vim.diagnostic.config({virtual_text = false})
|
vim.diagnostic.config({virtual_text = false})
|
||||||
end,
|
end
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"ThePrimeagen/refactoring.nvim",
|
"ThePrimeagen/refactoring.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter"
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function()
|
config = function() require("config.refactoring") end
|
||||||
require("config.refactoring")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-neorg/neorg",
|
"nvim-neorg/neorg",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
version = "*",
|
version = "*",
|
||||||
config = true,
|
config = true,
|
||||||
config = function()
|
config = function() require("config.neorg") end
|
||||||
require("config.neorg")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
@@ -62,122 +47,53 @@ return {
|
|||||||
scope = {enabled = true},
|
scope = {enabled = true},
|
||||||
scroll = {enabled = true},
|
scroll = {enabled = true},
|
||||||
statuscolumn = {enabled = true},
|
statuscolumn = {enabled = true},
|
||||||
words = { enabled = true },
|
words = {enabled = true}
|
||||||
},
|
}
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-cmdline", "hrsh7th/nvim-cmp", "L3MON4D3/LuaSnip",
|
||||||
"hrsh7th/cmp-buffer",
|
"saadparwaiz1/cmp_luasnip", "j-hui/fidget.nvim"
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function() require("config.lspconfig") end
|
||||||
require("config.lspconfig")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'vyfor/cord.nvim',
|
'vyfor/cord.nvim',
|
||||||
build = ':Cord update',
|
build = ':Cord update',
|
||||||
config = function()
|
config = function() require("config.cord") end
|
||||||
require("config.cord")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = function()
|
config = function() require("config.treesitter") end
|
||||||
require("config.treesitter")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rmagatti/auto-session",
|
"rmagatti/auto-session",
|
||||||
config = function()
|
config = function() require("config.autosession") end
|
||||||
require("config.autosession")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = {
|
dependencies = {"nvim-lua/plenary.nvim"},
|
||||||
"nvim-lua/plenary.nvim",
|
config = function() require("config.telescope") end
|
||||||
},
|
}, {"lambdalisue/vim-suda"}, {"nvim-tree/nvim-web-devicons"}, {
|
||||||
config = function()
|
|
||||||
require("config.telescope")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lambdalisue/vim-suda",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
cmd = {"NvimTreeToggle", "NvimTreeFocus"},
|
cmd = {"NvimTreeToggle", "NvimTreeFocus"},
|
||||||
config = function()
|
config = function() require("config.nvimtree") end
|
||||||
require("config.nvimtree")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function() require("config.barbar") end
|
||||||
require("config.barbar")
|
}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function ()
|
config = function() require("config.lualine") end
|
||||||
require("config.lualine")
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{"jiaoshijie/undotree", config = function() require("config.undotree") end},
|
||||||
"jiaoshijie/undotree",
|
{"hiphish/rainbow-delimiters.nvim"}, {
|
||||||
config = function()
|
|
||||||
require("config.undotree")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hiphish/rainbow-delimiters.nvim",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function() require("config.autopairs") end
|
||||||
require("config.autopairs")
|
}, {"tpope/vim-fugitive"}, {
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tpope/vim-fugitive",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"catgoose/nvim-colorizer.lua",
|
"catgoose/nvim-colorizer.lua",
|
||||||
config = function()
|
config = function() require("config.colorizer") end
|
||||||
require("config.colorizer")
|
}, {"catppuccin/nvim", name = "catppuccin", priority = 1000},
|
||||||
end,
|
{"ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ...},
|
||||||
},
|
{"mfussenegger/nvim-dap", config = function() require("config.dap") end}
|
||||||
{
|
|
||||||
"catppuccin/nvim",
|
|
||||||
name = "catppuccin",
|
|
||||||
priority = 1000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ellisonleao/gruvbox.nvim",
|
|
||||||
priority = 1000 ,
|
|
||||||
config = true,
|
|
||||||
opts = ...
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
config = function()
|
|
||||||
require("config.dap")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user