wozers
This commit is contained in:
@ -1,18 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
|
||||
--- select a program to execute
|
||||
---@return thread coroutine containing the picker
|
||||
local function select_program()
|
||||
return coroutine.create(function(coro)
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
local entries = vim.fn.readdir(".", [[v:val !~ '^\.']])
|
||||
vim.ui.select(entries, { prompt = "Select the executable to run:" },
|
||||
function(choice)
|
||||
coroutine.resume(coro, choice)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
local map = core.misc.map
|
||||
|
||||
local keymap_restore = {}
|
||||
--- make the default hover binding work for nvim-dap instead of lsp
|
||||
@ -66,7 +52,9 @@ return { "mfussenegger/nvim-dap",
|
||||
name = "Launch file",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = select_program,
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd()..'/', 'file')
|
||||
end,
|
||||
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false
|
||||
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
return { "lewis6991/gitsigns.nvim",
|
||||
disable = not vim.fn.has("nvim-0.9.0"),
|
||||
|
@ -1,5 +1,7 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
-- TODO: might end up writing my own because I like harpoon, but I hate that it
|
||||
-- doesn't work properly without being pinned to a specific commit
|
||||
|
||||
local map = core.misc.map
|
||||
|
||||
return { "ThePrimeagen/harpoon",
|
||||
disable = not vim.fn.has("nvim-0.8.0"),
|
||||
@ -14,7 +16,7 @@ return { "ThePrimeagen/harpoon",
|
||||
map("n", "<leader>a", function()
|
||||
harpoon:list():add()
|
||||
vim.notify("added "..vim.fn.expand("%:t").." to quickmarks",
|
||||
vim.log.levels.INFO, { title = misc.appid })
|
||||
vim.log.levels.INFO, { title = core.misc.appid })
|
||||
end, { desc = "add current file to quickmarks" })
|
||||
|
||||
map("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
@ -1,5 +0,0 @@
|
||||
return { "mawkler/hml.nvim",
|
||||
function()
|
||||
require("hml").setup {}
|
||||
end
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
return { "kawre/leetcode.nvim",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
config = function()
|
||||
-- because we"re using treesitter make sure to install the html parser
|
||||
vim.cmd("TSUpdate html")
|
||||
end,
|
||||
function()
|
||||
require("leetcode").setup {
|
||||
lang = "java"
|
||||
}
|
||||
end
|
||||
}
|
@ -5,7 +5,7 @@ return { "neovim/nvim-lspconfig",
|
||||
"mason-org/mason-lspconfig.nvim"
|
||||
},
|
||||
function()
|
||||
require("core.lsp.functions").setup()
|
||||
core.lsp.setup()
|
||||
require("mason-lspconfig").setup {
|
||||
ensure_added = {
|
||||
"clangd",
|
||||
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map, auto = core.misc.map, core.misc.auto
|
||||
|
||||
return { "L3MON4D3/LuaSnip",
|
||||
branch = "v2.4.0",
|
||||
@ -55,14 +54,21 @@ return { "L3MON4D3/LuaSnip",
|
||||
end
|
||||
end)
|
||||
|
||||
-- load all snippets from snippet directory
|
||||
-- collect all snippets and add them when in the correct file type
|
||||
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
|
||||
true)) do
|
||||
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
|
||||
local ret = misc.include("snippets."..fn)
|
||||
if type(ret) ~= "boolean" then
|
||||
luasnip.add_snippets(fn, ret, { key = fn })
|
||||
end
|
||||
|
||||
auto("FileType", {
|
||||
pattern = fn,
|
||||
once = true,
|
||||
callback = function()
|
||||
local ret = require("snippets."..fn)
|
||||
if type(ret) ~= "boolean" then
|
||||
luasnip.add_snippets(fn, ret, { key = fn })
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
return { "danymat/neogen",
|
||||
requires = {
|
||||
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
-- helper function to parse output
|
||||
local function parse_output(proc)
|
||||
|
9
lua/conf/plugins/refactoring.lua
Normal file
9
lua/conf/plugins/refactoring.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return { "ThePrimeagen/refactoring.nvim",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
function()
|
||||
require('refactoring').setup {}
|
||||
end
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
--- get the root directory for telescope to search
|
||||
---@return string the root directory
|
||||
|
@ -1,3 +1,6 @@
|
||||
-- TODO: gotta rewrite this cause it's actual dogshit, and I don't want to deal
|
||||
-- with nerd fonts or folke anymore also add support for TODO(name):
|
||||
|
||||
return { "folke/todo-comments.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
disable = not vim.fn.has("nvim-0.8.0"),
|
||||
|
10
lua/conf/plugins/treesitter-context.lua
Normal file
10
lua/conf/plugins/treesitter-context.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return { "nvim-treesitter/nvim-treesitter-context",
|
||||
requires = "nvim-treesitter/nvim-treesitter",
|
||||
function()
|
||||
require("treesitter-context").setup {
|
||||
max_lines = 2,
|
||||
line_numbers = true,
|
||||
trim_scope = 'inner'
|
||||
}
|
||||
end
|
||||
}
|
@ -1,12 +1,3 @@
|
||||
table.contains = function(self, string)
|
||||
for _, v in pairs(self) do
|
||||
if v == string then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return { "nvim-treesitter/nvim-treesitter",
|
||||
disable = not vim.fn.has("nvim-0.10.0"),
|
||||
config = function()
|
||||
@ -47,8 +38,7 @@ return { "nvim-treesitter/nvim-treesitter",
|
||||
end
|
||||
|
||||
-- disable in big files
|
||||
-- TODO: update before nvim 1.0 when vim.loop is removed
|
||||
local ok, stats = pcall(vim.loop.fs_stat,
|
||||
local ok, stats = pcall(vim.uv.fs_stat,
|
||||
vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then
|
||||
return true
|
||||
|
@ -1,12 +1,11 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
return { "Wansmer/treesj",
|
||||
disable = not vim.fn.has("nvim-0.9.0"),
|
||||
requires = "nvim-treesitter/nvim-treesitter",
|
||||
function()
|
||||
require("treesj").setup {
|
||||
use_default_keymaps = false,
|
||||
use_default_keymaps = false
|
||||
}
|
||||
|
||||
map("n", "<leader>j", require("treesj").toggle, { desc = "fold code" })
|
||||
|
@ -1,5 +1,4 @@
|
||||
local misc = require("core.misc")
|
||||
local map = misc.map
|
||||
local map = core.misc.map
|
||||
|
||||
return { "mbbill/undotree",
|
||||
function()
|
||||
|
Reference in New Issue
Block a user