Skip to content

Commit

Permalink
neovim: reorganise plugin imports
Browse files Browse the repository at this point in the history
  • Loading branch information
geodimm committed Mar 3, 2024
1 parent 20891ac commit d0806c8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.
32 changes: 18 additions & 14 deletions nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ return {
dependencies = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
cond = function()
return vim.fn.executable('make') == 1
end,
},
{
'gbrlsnchs/telescope-lsp-handlers.nvim',
},
{
'cljoly/telescope-repo.nvim',
},
},
config = function()
local telescope = require('telescope')
local builtin = require('telescope.builtin')
local command = require('telescope.command')
local sorters = require('telescope.sorters')
local previewers = require('telescope.previewers')
local themes = require('telescope.themes')
Expand Down Expand Up @@ -124,18 +136,20 @@ return {
telescope.load_extension('repo')

local keymap = require('utils.keymap')
keymap.set('n', '<leader>ft', command.load_command, { desc = 'Open telescope' })
keymap.set('n', '<leader>ft', builtin.builtin, { desc = 'Open telescope' })
keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Files' })
keymap.set('n', '<leader>fd', function()
builtin.find_files({ search_dirs = { os.getenv('HOME') .. '/dotfiles' } })
end, { desc = 'dotfiles' })
keymap.set('n', '<leader>f/', builtin.current_buffer_fuzzy_find, { desc = 'Current file' })
keymap.set('n', '<leader>f/', function()
builtin.current_buffer_fuzzy_find(themes.get_dropdown({ previewer = false }))
end, { desc = 'Current file' })
keymap.set('n', '<leader>f*', builtin.grep_string, { desc = 'Word under cursor' })
keymap.set('n', '<leader>fb', function()
builtin.buffers({ show_all_buffers = true, sort_lastused = true })
end, { desc = 'Buffers' })
keymap.set('n', '<leader>fa', builtin.live_grep, { desc = 'Fuzzy live grep' })
keymap.set('n', '<leader>fm', builtin.keymaps, { desc = 'Keymapss' })
keymap.set('n', '<leader>fm', builtin.keymaps, { desc = 'Keymaps' })
keymap.set('n', '<leader>fgb', builtin.git_branches, { desc = 'Branches' })
keymap.set('n', '<leader>fgc', builtin.git_commits, { desc = 'Commits' })
keymap.set('n', '<leader>fgf', builtin.git_files, { desc = 'Files' })
Expand All @@ -147,14 +161,4 @@ return {
keymap.register_group('<leader>fg', 'Git', {})
end,
},
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
},
{
'gbrlsnchs/telescope-lsp-handlers.nvim',
},
{
'cljoly/telescope-repo.nvim',
},
}
45 changes: 22 additions & 23 deletions nvim/lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ return {
'folke/noice.nvim',
dependencies = {
'MunifTanjim/nui.nvim',
'rcarriga/nvim-notify',
{
'rcarriga/nvim-notify',
opts = function()
local icons = require('user.icons')
return {
timeout = 3000,
stages = 'slide',
icons = {
DEBUG = icons.ui.bug,
ERROR = icons.ui.times,
INFO = icons.ui.info,
TRACE = icons.ui.pencil,
WARN = icons.ui.exclamation,
},
}
end,
config = function(_, opts)
local notify = require('notify')
vim.notify = notify
notify.setup(opts)
end,
},
},
opts = {
lsp = {
Expand Down Expand Up @@ -101,28 +122,6 @@ return {
},
},
},
{
'rcarriga/nvim-notify',
opts = function()
local icons = require('user.icons')
return {
timeout = 3000,
stages = 'slide',
icons = {
DEBUG = icons.ui.bug,
ERROR = icons.ui.times,
INFO = icons.ui.info,
TRACE = icons.ui.pencil,
WARN = icons.ui.exclamation,
},
}
end,
config = function(_, opts)
local notify = require('notify')
vim.notify = notify
notify.setup(opts)
end,
},
{
'folke/which-key.nvim',
opts = function()
Expand Down

0 comments on commit d0806c8

Please sign in to comment.