mirror of
https://github.com/rodneybbjr/kickstart.nvim.git
synced 2025-12-19 01:57:31 -05:00
add custom init
This commit is contained in:
14
lua/custom/plugins/cmp.toggle.lua
Normal file
14
lua/custom/plugins/cmp.toggle.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
-- ...
|
||||
-- This allows you to enable and disable the autocomplete popup:
|
||||
{
|
||||
'gitaarik/nvim-cmp-toggle',
|
||||
config = function()
|
||||
vim.api.nvim_set_keymap('n', '<leader>tc', ':NvimCmpToggle<CR>', { desc = '[T]oggle [C]ompletions', noremap = true, silent = true })
|
||||
end,
|
||||
},
|
||||
-- ...
|
||||
},
|
||||
}
|
||||
@@ -2,4 +2,41 @@
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
-- local job_id = 0
|
||||
|
||||
return {
|
||||
-- vim.opt_local.shiftwidth = 2
|
||||
-- vim.opt.clipboard = 'unnamedplus'
|
||||
-- vim.opt_local.number = true
|
||||
-- vim.opt_local.relativenummber = true
|
||||
-- vim.g.python3_host_prog = vim.fs.joinpatth(vim.fn.stdpath('config'), '.pynvim/bin/python'),
|
||||
vim.api.nvim_set_var('python3_host_prog', vim.fs.joinpath(vim.fn.stdpath 'config', '.pynvim/bin/python')),
|
||||
|
||||
vim.keymap.set('n', '<space>rf', '<cmd>source %<CR>', { desc = '[R]eload [F]ile' }),
|
||||
|
||||
-- Reload line
|
||||
vim.keymap.set('n', '<space>x', ':.lua<CR>', { desc = '[R]eload [L]ine' }),
|
||||
-- Reload selection
|
||||
vim.keymap.set('v', '<space>x', 'lua<CR>', { desc = '[R]eload [L]ine' }),
|
||||
|
||||
vim.keymap.set('n', '<space>x', ':.lua<CR>', { desc = 'Quickfix Next' }),
|
||||
vim.keymap.set('n', '<space>x', ':.lua<CR>', { desc = 'Quickfix Prev' }),
|
||||
|
||||
vim.api.nvim_create_autocmd('TermOpen', {
|
||||
group = vim.api.nvim_create_augroup('custom-term-open', { clear = true }),
|
||||
callback = function()
|
||||
vim.opt.number = false
|
||||
vim.opt.relativenumber = false
|
||||
end,
|
||||
}),
|
||||
|
||||
-- local job)id = 0
|
||||
--
|
||||
-- vim.keymap.set('n', '<space>st', function()
|
||||
-- vim.cmd.vnew()
|
||||
-- vim.cmd.term()
|
||||
-- vim.cmd.wincmd 'J'
|
||||
-- vim.api.nvim_win_set_height(0, 5)
|
||||
-- job_id = vim.bo.channel
|
||||
-- end),
|
||||
}
|
||||
|
||||
11
lua/custom/plugins/oil.lua
Normal file
11
lua/custom/plugins/oil.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
--dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if prefer nvim-web-devicons
|
||||
},
|
||||
}
|
||||
53
lua/custom/telescope/multigrep.lua
Normal file
53
lua/custom/telescope/multigrep.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
local pickers = require "telescope.pickers"
|
||||
local finders = require "telescope.finders"
|
||||
local make_entry = require "telescope.make_entry"
|
||||
local conf = require "telescope.config".values
|
||||
|
||||
local M = {}
|
||||
|
||||
local live_multigrep = function(opts)
|
||||
opts = opts or {}
|
||||
opts.cwd = opts.cwd or vim.uv.cwd()
|
||||
|
||||
local finder = finders.new_async_job {
|
||||
if not prompt or prompt == "" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local pieces = vim.split(prompt, " ")
|
||||
local args = { "rg" }
|
||||
if pieces[1] then
|
||||
table.insert(args, "-e")
|
||||
table.insert(arga, pieces[1])
|
||||
end
|
||||
|
||||
if pieces[2] then
|
||||
table.insert(args, "-e")
|
||||
table.insert(arga, pieces[2])
|
||||
end
|
||||
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
return vim.tbl_flatten {
|
||||
args,
|
||||
{ "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" },
|
||||
}
|
||||
end,
|
||||
entry_maker = make_entry.gen_from_wimgrep(opts),
|
||||
cwd = opts.cwd,
|
||||
}
|
||||
|
||||
pickers.new(opts, {
|
||||
debounce = 100,
|
||||
prompt_title = "Multi Grep",
|
||||
finder = finder,
|
||||
previewer = conf.grep+_previewer(opts),
|
||||
sorter = require("telescope.sorters").empty(),
|
||||
}):find()
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
-- vim.keymapset("n", "<leader>fg", live_multigrep)
|
||||
vim.keymap.set('n', '<leader>sm', live_multigrep, { desc = '[S]earch [M]ulti Grep' })
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user