Skip to content

Commit 784eb85

Browse files
committed
Add file browser plugin
1 parent 7aed029 commit 784eb85

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

init.lua

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ require('lazy').setup({
388388

389389
-- Useful for getting pretty icons, but requires a Nerd Font.
390390
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
391+
{ 'nvim-telescope/telescope-file-browser.nvim' },
391392
},
392393
config = function()
393394
-- Telescope is a fuzzy finder that comes with a lot of different things that
@@ -428,7 +429,7 @@ require('lazy').setup({
428429
'--hidden',
429430
'-g',
430431
'!.git',
431-
}
432+
},
432433
},
433434
},
434435
extensions = {
@@ -441,6 +442,7 @@ require('lazy').setup({
441442
-- Enable Telescope extensions if they are installed
442443
pcall(require('telescope').load_extension, 'fzf')
443444
pcall(require('telescope').load_extension, 'ui-select')
445+
pcall(require('telescope').load_extension, 'file_browser')
444446

445447
-- See `:help telescope.builtin`
446448
local builtin = require 'telescope.builtin'
@@ -455,6 +457,10 @@ require('lazy').setup({
455457
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
456458
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
457459

460+
-- File Browser
461+
vim.keymap.set('n', '<leader>fb', ':Telescope file_browser<CR>', { desc = '[F]ile [B]rowser' })
462+
vim.keymap.set('n', '<space>fbp', ':Telescope file_browser path=%:p:h select_buffer=true<CR>', { desc = '[F]ile [B]rowser at current [P]ath' })
463+
458464
-- Slightly advanced example of overriding default behavior and theme
459465
vim.keymap.set('n', '<leader>/', function()
460466
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
@@ -712,7 +718,7 @@ require('lazy').setup({
712718
},
713719
}
714720

715-
local lspconfig = require('lspconfig')
721+
local lspconfig = require 'lspconfig'
716722

717723
-- Ensure the servers and tools above are installed
718724
--
@@ -748,15 +754,15 @@ require('lazy').setup({
748754
},
749755
}
750756

751-
lspconfig.sourcekit.setup({
757+
lspconfig.sourcekit.setup {
752758
capabilities = {
753759
workspace = {
754760
didChangeWatchedFiles = {
755761
dyanamicRegistration = true,
756-
}
757-
}
758-
}
759-
})
762+
},
763+
},
764+
},
765+
}
760766
end,
761767
},
762768

@@ -796,17 +802,17 @@ require('lazy').setup({
796802
formatters_by_ft = {
797803
lua = { 'stylua' },
798804
-- Conform can also run multiple formatters sequentially
799-
python = { "ruff", "isort", "black" },
805+
python = { 'ruff', 'isort', 'black' },
800806
--
801807
-- You can use 'stop_after_first' to run the first available formatter from the list
802-
javascript = { "prettierd", "prettier", stop_after_first = true },
803-
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
804-
typescript = { "prettierd", "prettier", stop_after_first = true },
805-
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
806-
css = { "prettierd", "prettier", stop_after_first = true },
807-
html = { "prettierd", "prettier", stop_after_first = true },
808-
json = { "prettierd", "prettier", stop_after_first = true },
809-
yaml = { "prettierd", "prettier", stop_after_first = true },
808+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
809+
javascriptreact = { 'prettierd', 'prettier', stop_after_first = true },
810+
typescript = { 'prettierd', 'prettier', stop_after_first = true },
811+
typescriptreact = { 'prettierd', 'prettier', stop_after_first = true },
812+
css = { 'prettierd', 'prettier', stop_after_first = true },
813+
html = { 'prettierd', 'prettier', stop_after_first = true },
814+
json = { 'prettierd', 'prettier', stop_after_first = true },
815+
yaml = { 'prettierd', 'prettier', stop_after_first = true },
810816
},
811817
},
812818
},
@@ -998,26 +1004,25 @@ require('lazy').setup({
9981004
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
9991005
},
10001006
{ -- AI Autocomplete
1001-
"supermaven-inc/supermaven-nvim",
1007+
'supermaven-inc/supermaven-nvim',
10021008
opts = {
10031009
keymaps = {
1004-
accept_suggestion = "<Tab>",
1005-
accept_word = "<C-Enter>",
1010+
accept_suggestion = '<Tab>',
1011+
accept_word = '<C-Enter>',
10061012
},
10071013
},
10081014
},
10091015

1010-
10111016
{
10121017
'akinsho/toggleterm.nvim',
1013-
version = "*",
1018+
version = '*',
10141019
opts = {
1015-
open_mapping = "<leader>tt",
1020+
open_mapping = '<leader>tt',
10161021
direction = 'horizontal',
10171022
size = function(term)
1018-
if term.direction == "horizontal" then
1023+
if term.direction == 'horizontal' then
10191024
return vim.o.lines * 0.4
1020-
elseif term.direction == "vertical" then
1025+
elseif term.direction == 'vertical' then
10211026
return vim.o.columns * 0.4
10221027
end
10231028
end,

0 commit comments

Comments
 (0)