mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-27 05:41:45 +00:00
Compare commits
7 Commits
baba79c8b1
...
62df1661f9
Author | SHA1 | Date | |
---|---|---|---|
62df1661f9 | |||
3b24286f30 | |||
32a74e1d54 | |||
778776a45c | |||
12007a56dc | |||
aa93d43236 | |||
|
18b919c61e |
14
lua/custom/plugins/autopairs.lua
Normal file
14
lua/custom/plugins/autopairs.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
-- File: lua/custom/plugins/autopairs.lua
|
||||||
|
|
||||||
|
return {
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
-- Optional dependency
|
||||||
|
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||||
|
config = function()
|
||||||
|
require('nvim-autopairs').setup {}
|
||||||
|
-- If you want to automatically add `(` after selecting a function or method
|
||||||
|
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||||
|
local cmp = require 'cmp'
|
||||||
|
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||||
|
end,
|
||||||
|
}
|
18
lua/custom/plugins/filetree.lua
Normal file
18
lua/custom/plugins/filetree.lua
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||||
|
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
|
||||||
|
|
||||||
|
-- Open nvim-neo-tree window
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>f', ':Neotree toggle<enter>', { desc = 'Explore [F]ile Tree' })
|
||||||
|
|
||||||
|
return {
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
version = '*',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('neo-tree').setup {}
|
||||||
|
end,
|
||||||
|
}
|
@ -1,5 +0,0 @@
|
|||||||
-- You can add your own plugins here or in other files in this directory!
|
|
||||||
-- I promise not to create any merge conflicts in this directory :)
|
|
||||||
--
|
|
||||||
-- See the kickstart.nvim README for more information
|
|
||||||
return {}
|
|
@ -31,10 +31,15 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||||||
|
|
||||||
-- Delete (currently selected) text without yanking it
|
-- Delete (currently selected) text without yanking it
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>dny', '"_d', { desc = '[D]elete [N]o [Y]ank' })
|
vim.keymap.set({ 'n', 'v' }, '<leader>dny', '"_d', { desc = '[D]elete [N]o [Y]ank' })
|
||||||
|
|
||||||
-- Replace currently selected text with default register without yanking it
|
-- Replace currently selected text with default register without yanking it
|
||||||
vim.keymap.set('v', '<leader>pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' })
|
vim.keymap.set('v', '<leader>pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' })
|
||||||
|
|
||||||
|
-- Populate CMD to prepare for change directory
|
||||||
|
vim.keymap.set('n', '<leader>cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
|
||||||
|
|
||||||
|
-- Open git window from fugitive in full screen
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>go', ':Git<enter><C-w>o', { desc = '[G]it [O]pen' })
|
||||||
|
|
||||||
-- Highlight when yanking (copying) text
|
-- Highlight when yanking (copying) text
|
||||||
-- Try it with `yap` in normal mode
|
-- Try it with `yap` in normal mode
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.on_yank()`
|
||||||
|
@ -9,7 +9,11 @@
|
|||||||
-- :Lazy update
|
-- :Lazy update
|
||||||
--
|
--
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup({
|
require('lazy').setup {
|
||||||
|
|
||||||
|
-- [[ Plugin Specs list ]]
|
||||||
|
|
||||||
|
|
||||||
-- NOTE: First, some plugins that don't require any configuration
|
-- NOTE: First, some plugins that don't require any configuration
|
||||||
-- Discord RPC
|
-- Discord RPC
|
||||||
'andweeb/presence.nvim',
|
'andweeb/presence.nvim',
|
||||||
@ -294,7 +298,7 @@ require('lazy').setup({
|
|||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- For additional information see: :help lazy.nvim-lazy.nvim-structuring-your-plugins
|
-- For additional information see: :help lazy.nvim-lazy.nvim-structuring-your-plugins
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}, {})
|
}
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
@ -19,6 +19,7 @@ pcall(require('telescope').load_extension, 'ui-select')
|
|||||||
|
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
local builtin = require 'telescope.builtin'
|
local builtin = require 'telescope.builtin'
|
||||||
|
local actions = require 'telescope.actions'
|
||||||
|
|
||||||
-- Telescope live_grep in git root
|
-- Telescope live_grep in git root
|
||||||
-- Function to find the git root directory based on the current buffer's path
|
-- Function to find the git root directory based on the current buffer's path
|
||||||
@ -76,7 +77,31 @@ end
|
|||||||
vim.keymap.set('n', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' })
|
vim.keymap.set('n', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' })
|
||||||
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
||||||
vim.keymap.set('n', '<leader>gf', builtin.git_files, { desc = 'Search [G]it [F]iles' })
|
vim.keymap.set('n', '<leader>gf', builtin.git_files, { desc = 'Search [G]it [F]iles' })
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
vim.keymap.set('n', '<leader>sf', function()
|
||||||
|
builtin.find_files {
|
||||||
|
-- This will ignore the directories you specified
|
||||||
|
find_command = {
|
||||||
|
'rg',
|
||||||
|
'--files',
|
||||||
|
'--hidden',
|
||||||
|
'-u',
|
||||||
|
'-g',
|
||||||
|
'!{' .. table.concat({
|
||||||
|
'.git',
|
||||||
|
'target',
|
||||||
|
'node_modules',
|
||||||
|
'.svelte-kit',
|
||||||
|
'bin',
|
||||||
|
'obj',
|
||||||
|
}, ',') .. '}',
|
||||||
|
},
|
||||||
|
attach_mappings = function(_, map)
|
||||||
|
map('i', '<CR>', actions.select_default + actions.center)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
desc = '[S]earch [F]iles',
|
||||||
|
}
|
||||||
|
end)
|
||||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||||
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
||||||
|
Loading…
Reference in New Issue
Block a user