initial commit
This commit is contained in:
16
nvim/lua/chadrc.lua
Normal file
16
nvim/lua/chadrc.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
||||
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "nord",
|
||||
--
|
||||
-- -- hl_override = {
|
||||
-- -- Comment = { italic = true },
|
||||
-- -- ["@comment"] = { italic = true },
|
||||
-- -- },
|
||||
}
|
||||
|
||||
return M
|
||||
19
nvim/lua/configs/cmpconfig.lua
Normal file
19
nvim/lua/configs/cmpconfig.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local cmp = require "cmp"
|
||||
local compare = cmp.config.compare
|
||||
|
||||
cmp.setup {
|
||||
sources = {
|
||||
{ name = "jupynium", priority = 1000 }, -- consider higher priority than LSP
|
||||
{ name = "nvim_lsp", priority = 100 },
|
||||
-- ...
|
||||
},
|
||||
sorting = {
|
||||
priority_weight = 1.0,
|
||||
comparators = {
|
||||
compare.score, -- Jupyter kernel completion shows prior to LSP
|
||||
compare.recently_used,
|
||||
compare.locality,
|
||||
-- ...
|
||||
},
|
||||
},
|
||||
}
|
||||
15
nvim/lua/configs/conform.lua
Normal file
15
nvim/lua/configs/conform.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
return options
|
||||
47
nvim/lua/configs/lazy.lua
Normal file
47
nvim/lua/configs/lazy.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
68
nvim/lua/configs/lspconfig.lua
Normal file
68
nvim/lua/configs/lspconfig.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
-- load defaults i.e lua_lsp
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
-- EXAMPLE
|
||||
local servers = {
|
||||
"arduino_language_server",
|
||||
"ccls", --C/C++
|
||||
-- "csharp_ls",
|
||||
"cssls", --CSS
|
||||
"css_variables",
|
||||
"dartls", --Dart
|
||||
"gopls",
|
||||
"html",
|
||||
"marksman",
|
||||
-- "pylsp",
|
||||
"rust_analyzer",
|
||||
"svelte",
|
||||
"sqlls", --SQL
|
||||
"ts_ls" --TypeScript
|
||||
}
|
||||
|
||||
lspconfig.omnisharp.setup {
|
||||
cmd = { "dotnet", "/home/greg/.local/share/nvim/mason/packages/omnisharp/libexec/OmniSharp.dll"},
|
||||
}
|
||||
|
||||
-- lspconfig.rust_analyzer.setup {
|
||||
-- settings = {
|
||||
-- ['rust-analyzer'] = {
|
||||
-- diagnostics = {
|
||||
-- enabled = false
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
|
||||
lspconfig.pylsp.setup {
|
||||
cmd = { "/home/greg/.venv312/bin/pylsp" },
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
black = { enabled = true },
|
||||
-- pylint = { enabled = true, executable = "pylint", args = { "--jobs=4" } },
|
||||
pycodestyle = { enabled = false },
|
||||
pylsp_mypy = { enabled = true },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.tsserver.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
15
nvim/lua/configs/nvimtree.lua
Normal file
15
nvim/lua/configs/nvimtree.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
require("nvim-tree").setup({
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
gitignore = true,
|
||||
},
|
||||
})
|
||||
1
nvim/lua/configs/snippets.lua
Normal file
1
nvim/lua/configs/snippets.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.g.lua_snippets_path = vim.fn.stdpath "config" .. "/lua/lua_snippets"
|
||||
97
nvim/lua/mappings.lua
Normal file
97
nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,97 @@
|
||||
require "nvchad.mappings"
|
||||
|
||||
local g = vim.g
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
-- Transparency toggler
|
||||
local base46 = require "base46"
|
||||
vim.keymap.set("n", "<leader>tt", base46.toggle_transparency)
|
||||
|
||||
-- Debbuger binds
|
||||
-- local dap = require "dap"
|
||||
-- vim.keymap.set("n", "<space>pb", dap.toggle_breakpoint, { desc = "Dap Toggle breakpoint" })
|
||||
-- vim.keymap.set("n", "<space>gb", dap.run_to_cursor, { desc = "Dap Run to cursor" })
|
||||
-- vim.keymap.set("n", "<F1>", dap.continue)
|
||||
-- vim.keymap.set("n", "<F2>", dap.step_into)
|
||||
-- vim.keymap.set("n", "<F3>", dap.step_over)
|
||||
-- vim.keymap.set("n", "<F4>", dap.step_out)
|
||||
-- vim.keymap.set("n", "<F5>", dap.step_back)
|
||||
-- vim.keymap.set("n", "<F13>", dap.restart)
|
||||
|
||||
local dap = require "dap"
|
||||
vim.keymap.set("n", "<F1>", function()
|
||||
vim.cmd('NvimTreeClose')
|
||||
dap.continue()
|
||||
end)
|
||||
vim.keymap.set("n", "<F2>", dap.step_into, { desc = "Dap Step into" })
|
||||
vim.keymap.set("n", "<F3>", dap.step_over, { desc = "Dap Step over" })
|
||||
vim.keymap.set("n", "<F4>", dap.step_out, { desc = "Dap Step out" })
|
||||
vim.keymap.set("n", "<F5>", dap.step_back, { desc = "Dap Step back" })
|
||||
vim.keymap.set("n", "<F6>", dap.restart, { desc = "Dap Restart" })
|
||||
vim.keymap.set("n", "<space>pb", dap.toggle_breakpoint, { desc = "Dap Toggle breakpoint" })
|
||||
vim.keymap.set("n", "<space>gb", dap.run_to_cursor, { desc = "Dap Run to cursor" })
|
||||
|
||||
|
||||
-- alt+h now conflicts with my hjkl movement keys, so we use alt+b instead
|
||||
local function toggle_terminal()
|
||||
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
|
||||
end
|
||||
map({ "n", "t" }, "<A-b>", toggle_terminal, { desc = "terminal toggleable horizontal term" })
|
||||
map({ "n", "t" }, "<C-`>", toggle_terminal, { desc = "terminal toggleable horizontal term" })
|
||||
|
||||
-- exiting terminal
|
||||
map("t", "<C-Esc>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
|
||||
|
||||
-- hop
|
||||
local hop = require('hop')
|
||||
local directions = require('hop.hint').HintDirection
|
||||
vim.keymap.set('', 'f', function()
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false })
|
||||
end, {remap=true})
|
||||
vim.keymap.set('', 'F', function()
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false })
|
||||
end, {remap=true})
|
||||
-- vim.keymap.set('', 't', function()
|
||||
-- hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false, hint_offset = -1 })
|
||||
-- end, {remap=true})
|
||||
-- vim.keymap.set('', 'T', function()
|
||||
-- hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false, hint_offset = 1 })
|
||||
-- end, {remap=true})
|
||||
|
||||
-- themes
|
||||
vim.keymap.set("n", "<leader>tv", function() require('vscode').load('dark') end)
|
||||
|
||||
-- lsp
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Lsp Rename" })
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Lsp Code Action" })
|
||||
vim.keymap.set("n", "<leader>ci", vim.lsp.buf.implementation, { desc = "Lsp Implementation" })
|
||||
|
||||
-- cdproj
|
||||
vim.keymap.set('n', '<leader>cp', '<cmd>CdProject<cr>', { desc = 'Project Switch directory directory' })
|
||||
|
||||
-- todocomments
|
||||
vim.keymap.set("n", "<leader>ft", '<cmd>TodoTelescope<cr>', { desc = "Telescope Todos" })
|
||||
|
||||
-- nvimtree refresh
|
||||
vim.keymap.set("n", "<leader>tr", '<cmd>NvimTreeRefresh<cr>', { desc = "Nvimtree Refresh" })
|
||||
|
||||
-- nvimtree open file without focusing
|
||||
vim.keymap.set("n", "T",
|
||||
function(node)
|
||||
local nt_api = require("nvim-tree.api")
|
||||
nt_api.node.open.edit(node)
|
||||
nt_api.tree.focus()
|
||||
end,
|
||||
{ desc = "Nvimtree Open without focusing" })
|
||||
|
||||
-- nvchad tabs
|
||||
vim.keymap.set("n", "<leader>tn", '<cmd>tabNext<cr>', { desc = "Tab Next" })
|
||||
vim.keymap.set("n", "<leader>tp", '<cmd>tabprevious<cr>', { desc = "Tab Previous" })
|
||||
vim.keymap.set("n", "<leader>tm", '<cmd>tabnew<cr>', { desc = "Tab More!" })
|
||||
vim.keymap.set("n", "<leader>tc", '<cmd>tabclose<cr>', { desc = "Tab Close" })
|
||||
14
nvim/lua/options.lua
Normal file
14
nvim/lua/options.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
|
||||
-- disable wrap
|
||||
vim.o.wrap = false
|
||||
|
||||
-- disable auto comment
|
||||
vim.opt_local.formatoptions:remove("r")
|
||||
|
||||
vim.g.lua_snippets_path = "~/.config/nvim/lua/lua_snippets"
|
||||
5
nvim/lua/plugins/blamer.lua
Normal file
5
nvim/lua/plugins/blamer.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
{
|
||||
"APZelos/blamer.nvim"
|
||||
}
|
||||
}
|
||||
38
nvim/lua/plugins/cd-project.lua
Normal file
38
nvim/lua/plugins/cd-project.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
-- using lazy.nvim
|
||||
return {
|
||||
"LintaoAmons/cd-project.nvim",
|
||||
-- Don't need call the setup function if you think you are good with the default configuration
|
||||
tag = "v0.6.1", -- Optional, You can also use tag to pin the plugin version for stability
|
||||
init = function() -- use init if you want enable auto_register_project, otherwise config is good
|
||||
require("cd-project").setup({
|
||||
-- this json file is acting like a database to update and read the projects in real time.
|
||||
-- So because it's just a json file, you can edit directly to add more paths you want manually
|
||||
projects_config_filepath = vim.fs.normalize(vim.fn.stdpath("config") .. "/cd-project.nvim.json"),
|
||||
-- this controls the behaviour of `CdProjectAdd` command about how to get the project directory
|
||||
project_dir_pattern = { "__main__.py", "*.csproj", ".git", ".gitignore", "Cargo.toml", "package.json", "go.mod" },
|
||||
choice_format = "both", -- optional, you can switch to "name" or "path"
|
||||
projects_picker = "telescope", -- optional, you can switch to `telescope`
|
||||
auto_register_project = false, -- optional, toggle on/off the auto add project behaviour
|
||||
-- do whatever you like by hooks
|
||||
hooks = {
|
||||
-- Run before cd to project, add a bookmark here, then can use `CdProjectBack` to switch back
|
||||
-- {
|
||||
-- trigger_point = "BEFORE_CD",
|
||||
-- callback = function(_)
|
||||
-- vim.print("before cd project")
|
||||
-- require("bookmarks").api.mark({name = "before cd project"})
|
||||
-- end,
|
||||
-- },
|
||||
-- Run after cd to project, find and open a file in the target project by smart-open
|
||||
-- {
|
||||
-- callback = function(_)
|
||||
-- require("telescope").extensions.smart_open.smart_open({
|
||||
-- cwd_only = true,
|
||||
-- filename_first = false,
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
45
nvim/lua/plugins/codeium.lua
Normal file
45
nvim/lua/plugins/codeium.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
"Exafunction/codeium.vim",
|
||||
event = 'BufEnter',
|
||||
enabled = false,
|
||||
-- Rebind accept completion to shift + enter in edit mode
|
||||
-- config = function()
|
||||
-- require("codeium").setup({
|
||||
-- virtual_text = {
|
||||
-- enabled = true,
|
||||
-- key_bindings = {
|
||||
-- accept = "<S-Enter>",
|
||||
-- accept_word = "<M-Enter>",
|
||||
-- accept_line = "<M-\\>",
|
||||
-- clear = "<M-[>",
|
||||
-- next = "<M-]>"
|
||||
-- }
|
||||
-- },
|
||||
-- })
|
||||
-- end
|
||||
init = function()
|
||||
vim.g.codeium_disable_bindings = 1
|
||||
|
||||
-- Completion
|
||||
vim.keymap.set("i", "<S-Enter>", function()
|
||||
return vim.fn["codeium#Accept"]()
|
||||
end, { expr = true })
|
||||
-- Complete next word
|
||||
vim.keymap.set("i", "<M-Enter>", function()
|
||||
return vim.fn["codeium#AcceptNextWord"]()
|
||||
end, { expr = true })
|
||||
-- Complete line
|
||||
vim.keymap.set("i", "<M-\\>", function()
|
||||
return vim.fn["codeium#AcceptNextLine"]()
|
||||
end, { expr = true })
|
||||
-- Next
|
||||
vim.keymap.set("i", "<M-]>", function()
|
||||
return vim.fn["codeium#CycleCompletions"](1)
|
||||
end, { expr = true })
|
||||
-- Previous
|
||||
vim.keymap.set("i", "<M-[>", function()
|
||||
return vim.fn["codeium#Clear"]()
|
||||
end, { expr = true })
|
||||
end
|
||||
}
|
||||
|
||||
9
nvim/lua/plugins/cyryllic.lua
Normal file
9
nvim/lua/plugins/cyryllic.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {{
|
||||
'nativerv/cyrillic.nvim',
|
||||
event = { 'VeryLazy' },
|
||||
config = function()
|
||||
require('cyrillic').setup({
|
||||
no_cyrillic_abbrev = true,
|
||||
})
|
||||
end,
|
||||
}}
|
||||
177
nvim/lua/plugins/dap.lua
Normal file
177
nvim/lua/plugins/dap.lua
Normal file
@@ -0,0 +1,177 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
"leoluz/nvim-dap-go",
|
||||
"mfussenegger/nvim-dap-python",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
config = function()
|
||||
local dap = require "dap"
|
||||
local ui = require "dapui"
|
||||
|
||||
require("dapui").setup()
|
||||
require("dap-go").setup()
|
||||
require("dap-python").setup()
|
||||
|
||||
vim.fn.sign_define('DapBreakpoint', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
||||
vim.fn.sign_define('DapBreakpointCondition', { text='ﳁ', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
||||
vim.fn.sign_define('DapBreakpointRejected', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl= 'DapBreakpoint' })
|
||||
vim.fn.sign_define('DapLogPoint', { text='', texthl='DapLogPoint', linehl='DapLogPoint', numhl= 'DapLogPoint' })
|
||||
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
|
||||
|
||||
require("nvim-dap-virtual-text").setup {
|
||||
-- This just tries to mitigate the chance that I leak tokens here. Probably won't stop it from happening...
|
||||
display_callback = function(variable)
|
||||
local name = string.lower(variable.name)
|
||||
local value = string.lower(variable.value)
|
||||
if name:match "secret" or name:match "api" or value:match "secret" or value:match "api" then
|
||||
return "*****"
|
||||
end
|
||||
|
||||
if #variable.value > 15 then
|
||||
return " " .. string.sub(variable.value, 1, 15) .. "... "
|
||||
end
|
||||
|
||||
return " " .. variable.value
|
||||
end,
|
||||
}
|
||||
|
||||
-- Handled by nvim-dap-go
|
||||
-- dap.adapters.go = {
|
||||
-- type = "server",
|
||||
-- port = "${port}",
|
||||
-- executable = {
|
||||
-- command = "dlv",
|
||||
-- args = { "dap", "-l", "127.0.0.1:${port}" },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = 'python';
|
||||
request = 'launch';
|
||||
name = "Launch file";
|
||||
console = "integratedTerminal",
|
||||
program = "${file}";
|
||||
pythonPath = function()
|
||||
return 'python'
|
||||
end;
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.coreclr = {
|
||||
type = 'executable',
|
||||
command = '/home/greg/.netcoredbg/netcoredbg',
|
||||
args = {'--interpreter=vscode'}
|
||||
}
|
||||
|
||||
dap.configurations.cs = {
|
||||
{
|
||||
type = "coreclr",
|
||||
name = "launch - netcoredbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
local path = vim.fn.getcwd() .. '/bin/Debug/net9.0/'
|
||||
local dllFiles = vim.fn.glob(path .. '*.dll', false, true)
|
||||
if #dllFiles == 0 then
|
||||
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
|
||||
end
|
||||
-- Sort files by modification time (newest first)
|
||||
table.sort(dllFiles, function(a, b)
|
||||
return vim.fn.getftime(b) < vim.fn.getftime(a)
|
||||
end)
|
||||
return dllFiles[1] -- Return the most recent DLL file
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = "/usr/bin/lldb", -- adjust as needed
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.configurations.rust = {
|
||||
{
|
||||
name = "hello-world",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. "/target/debug/hello-world"
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
},
|
||||
{
|
||||
name = "hello-dap",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. "/target/debug/hello-dap"
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
},
|
||||
}
|
||||
|
||||
local elixir_ls_debugger = vim.fn.exepath "elixir-ls-debugger"
|
||||
if elixir_ls_debugger ~= "" then
|
||||
dap.adapters.mix_task = {
|
||||
type = "executable",
|
||||
command = elixir_ls_debugger,
|
||||
}
|
||||
|
||||
dap.configurations.elixir = {
|
||||
{
|
||||
type = "mix_task",
|
||||
name = "phoenix server",
|
||||
task = "phx.server",
|
||||
request = "launch",
|
||||
projectDir = "${workspaceFolder}",
|
||||
exitAfterTaskReturns = false,
|
||||
debugAutoInterpretAllModules = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<space>pb", dap.toggle_breakpoint)
|
||||
vim.keymap.set("n", "<space>gb", dap.run_to_cursor)
|
||||
|
||||
-- Eval var under cursor
|
||||
vim.keymap.set("n", "<space>?", function()
|
||||
require("dapui").eval(nil, { enter = true })
|
||||
end)
|
||||
|
||||
-- Close nvimtree if it's open and start debugging
|
||||
vim.keymap.set("n", "<F1>", function()
|
||||
vim.cmd('NvimTreeClose')
|
||||
dap.continue()
|
||||
end)
|
||||
vim.keymap.set("n", "<F2>", dap.step_into, { desc = "Dap Step into" })
|
||||
vim.keymap.set("n", "<F3>", dap.step_over, { desc = "Dap Step over" })
|
||||
vim.keymap.set("n", "<F4>", dap.step_out, { desc = "Dap Step out" })
|
||||
vim.keymap.set("n", "<F5>", dap.step_back, { desc = "Dap Step back" })
|
||||
vim.keymap.set("n", "<F6>", dap.restart, { desc = "Dap Restart" })
|
||||
vim.keymap.set("n", "<space>pb", dap.toggle_breakpoint, { desc = "Dap Toggle breakpoint" })
|
||||
vim.keymap.set("n", "<space>gb", dap.run_to_cursor, { desc = "Dap Run to cursor" })
|
||||
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/hardtime.lua
Normal file
8
nvim/lua/plugins/hardtime.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
opts = {}
|
||||
},
|
||||
}
|
||||
|
||||
20
nvim/lua/plugins/hop.lua
Normal file
20
nvim/lua/plugins/hop.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
'smoka7/hop.nvim',
|
||||
version = "*",
|
||||
opts = {
|
||||
multi_windows = true,
|
||||
keys = 'asdfghjklcvnmqp', --'etovxqpdygfblzhckisuran',
|
||||
uppercase_labels = true
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("hop").hint_words()
|
||||
end,
|
||||
mode = {"n", "x", "o", "v"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
nvim/lua/plugins/init.lua
Normal file
25
nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
-- event = 'BufWritePre', -- uncomment for format on save
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- opts = {
|
||||
-- ensure_installed = {
|
||||
-- "vim", "lua", "vimdoc",
|
||||
-- "html", "css"
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
24
nvim/lua/plugins/multiple-cursors.lua
Normal file
24
nvim/lua/plugins/multiple-cursors.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {{
|
||||
"brenton-leighton/multiple-cursors.nvim",
|
||||
version = "*", -- Use the latest tagged version
|
||||
opts = {}, -- This causes the plugin setup function to be called
|
||||
keys = {
|
||||
{"<C-j>", "<Cmd>MultipleCursorsAddDown<CR>", mode = {"n", "x"}, desc = "Multicursor Add cursor and move down"},
|
||||
{"<C-k>", "<Cmd>MultipleCursorsAddUp<CR>", mode = {"n", "x"}, desc = "Multicursor Add cursor and move up"},
|
||||
|
||||
{"<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = {"n", "i", "x"}, desc = "Multicursor Add cursor and move up"},
|
||||
{"<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = {"n", "i", "x"}, desc = "Multicursor Add cursor and move down"},
|
||||
|
||||
{"<C-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = {"n", "i"}, desc = "Multicursor Add or remove cursor"},
|
||||
|
||||
{"<Leader>mm", "<Cmd>MultipleCursorsAddVisualArea<CR>", mode = {"x"}, desc = "Multicursor Add cursors to the lines of the visual area"},
|
||||
|
||||
{"<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = {"n", "x"}, desc = "Add cursors to cword"},
|
||||
--{"<Leader>A", "<Cmd>MultipleCursorsAddMatchesV<CR>", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"},
|
||||
|
||||
--{"<Leader>d", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"},
|
||||
--{"<Leader>D", "<Cmd>MultipleCursorsJumpNextMatch<CR>", mode = {"n", "x"}, desc = "Jump to next cword"},
|
||||
|
||||
{"<Leader>l", "<Cmd>MultipleCursorsLock<CR>", mode = {"n", "x"}, desc = "Multicursor Lock virtual cursors"},
|
||||
},
|
||||
}}
|
||||
15
nvim/lua/plugins/nuget.lua
Normal file
15
nvim/lua/plugins/nuget.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
"d7omdev/nuget.nvim",
|
||||
event = 'BufEnter',
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("nuget").setup({
|
||||
keys = {
|
||||
install = { "n", "<leader>pi" },
|
||||
remove = { "n", "<leader>pr" },
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
36
nvim/lua/plugins/todo-comments.lua
Normal file
36
nvim/lua/plugins/todo-comments.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
return {
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[(--\s*(KEYWORDS):.*$|#\s*(KEYWORDS):.*$|//\s*(KEYWORDS):.*$)]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
}
|
||||
},
|
||||
lazy = false
|
||||
}
|
||||
}
|
||||
|
||||
15
nvim/lua/plugins/url-open.lua
Normal file
15
nvim/lua/plugins/url-open.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
-- lazy.nvim
|
||||
{
|
||||
"sontungexpt/url-open",
|
||||
event = "VeryLazy",
|
||||
cmd = "URLOpenUnderCursor",
|
||||
config = function()
|
||||
local status_ok, url_open = pcall(require, "url-open")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
url_open.setup ({})
|
||||
end,
|
||||
},
|
||||
}
|
||||
43
nvim/lua/plugins/vscode_colors.lua
Normal file
43
nvim/lua/plugins/vscode_colors.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
{
|
||||
'Mofiqul/vscode.nvim',
|
||||
event = 'BufEnter',
|
||||
init = function()
|
||||
require('vscode').load('dark')
|
||||
end,
|
||||
config = function()
|
||||
local c = require('vscode.colors').get_colors()
|
||||
require('vscode').setup({
|
||||
-- Alternatively set style in setup
|
||||
-- style = 'light'
|
||||
|
||||
-- Enable transparent background
|
||||
transparent = false,
|
||||
|
||||
-- Enable italic comment
|
||||
italic_comments = true,
|
||||
|
||||
-- Underline `@markup.link.*` variants
|
||||
underline_links = true,
|
||||
|
||||
-- Disable nvim-tree background color
|
||||
disable_nvimtree_bg = false,
|
||||
|
||||
-- Apply theme colors to terminal
|
||||
terminal_colors = true,
|
||||
|
||||
-- Override colors (see ./lua/vscode/colors.lua)
|
||||
color_overrides = {
|
||||
vscLineNumber = '#FFFFFF',
|
||||
},
|
||||
|
||||
-- Override highlight groups (see ./lua/vscode/theme.lua)
|
||||
group_overrides = {
|
||||
-- this supports the same val table as vim.api.nvim_set_hl
|
||||
-- use colors from this colorscheme by requiring vscode.colors!
|
||||
Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user