From ad5d34530f9767ca5cc9b44e4f24fed255a160c7 Mon Sep 17 00:00:00 2001 From: amninder-narota <163357823+amninder-narota@users.noreply.github.com> Date: Sat, 29 Nov 2025 19:55:52 -0500 Subject: [PATCH] nvim-config --- Makefile | 104 ++++++++++++++++++++++++ init.lua | 127 ++++++++++++++++++++++-------- lua/custom/keymaps/files.lua | 16 ++++ lua/custom/keymaps/general.lua | 34 ++++++++ lua/custom/keymaps/git.lua | 6 ++ lua/custom/keymaps/init.lua | 5 ++ lua/custom/keymaps/terminal.lua | 12 +++ lua/custom/plugins/bufferline.lua | 63 +++++++++++++++ lua/custom/plugins/gruvbox.lua | 23 ++++++ lua/custom/plugins/lazygit.lua | 16 ++++ lua/custom/plugins/lualine.lua | 97 +++++++++++++++++++++++ lua/custom/plugins/nvim-tree.lua | 20 +++++ lua/custom/plugins/telescope.lua | 50 ++++++++++++ lua/custom/plugins/toggleterm.lua | 23 ++++++ 14 files changed, 563 insertions(+), 33 deletions(-) create mode 100644 Makefile create mode 100644 lua/custom/keymaps/files.lua create mode 100644 lua/custom/keymaps/general.lua create mode 100644 lua/custom/keymaps/git.lua create mode 100644 lua/custom/keymaps/init.lua create mode 100644 lua/custom/keymaps/terminal.lua create mode 100644 lua/custom/plugins/bufferline.lua create mode 100644 lua/custom/plugins/gruvbox.lua create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/lualine.lua create mode 100644 lua/custom/plugins/nvim-tree.lua create mode 100644 lua/custom/plugins/telescope.lua create mode 100644 lua/custom/plugins/toggleterm.lua diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..059ec510 --- /dev/null +++ b/Makefile @@ -0,0 +1,104 @@ +.PHONY: install update clean backup install-fonts install-brew link help + +NVIM_DIR := $(HOME)/.config/nvim +BACKUP_DIR := $(HOME)/.config/nvim-backup-$(shell date +%Y%m%d-%H%M%S) + +# Detect OS +UNAME_S := $(shell uname -s) + +# Default Nerd Fonts to install (can be overridden) +NERD_FONTS ?= font-jetbrains-mono-nerd-font font-fira-code-nerd-font font-hack-nerd-font font-meslo-lg-nerd-font + +help: + @echo "Neovim Configuration Management" + @echo "================================" + @echo "install - Install/sync all plugins via lazy.nvim" + @echo "update - Update all plugins to latest versions" + @echo "clean - Clean plugin cache and unused plugins" + @echo "backup - Backup current configuration" + @echo "link - Create symlink from current directory to ~/.config/nvim" + @echo "install-fonts - Install Nerd Fonts (macOS: via brew)" + @echo "install-brew - Install Homebrew (macOS only)" + @echo "" + @echo "Environment Variables:" + @echo " NERD_FONTS - Space-separated list of fonts to install" + @echo " Default: JetBrains Mono, Fira Code, Hack, Meslo LG" + +install: + @echo "Installing/syncing Neovim plugins..." + nvim --headless "+Lazy! sync" +qa + @echo "✓ Plugins installed successfully" + +update: + @echo "Updating Neovim plugins..." + nvim --headless "+Lazy! update" +qa + @echo "✓ Plugins updated successfully" + +clean: + @echo "Cleaning plugin cache..." + nvim --headless "+Lazy! clean" +qa + @echo "✓ Cache cleaned successfully" + +backup: + @echo "Backing up configuration to $(BACKUP_DIR)..." + @cp -r $(NVIM_DIR) $(BACKUP_DIR) + @echo "✓ Backup created at $(BACKUP_DIR)" + +link: + @echo "Creating symlink to ~/.config/nvim..." + @if [ -e $(NVIM_DIR) ] || [ -L $(NVIM_DIR) ]; then \ + if [ -L $(NVIM_DIR) ]; then \ + current_target=$$(readlink $(NVIM_DIR)); \ + if [ "$$current_target" = "$(CURDIR)" ]; then \ + echo "✓ Symlink already points to $(CURDIR)"; \ + exit 0; \ + fi; \ + fi; \ + echo "⚠ $(NVIM_DIR) already exists"; \ + backup_dir=$(HOME)/.config/nvim-backup-$$(date +%Y%m%d-%H%M%S); \ + echo "Creating backup at $$backup_dir..."; \ + mv $(NVIM_DIR) $$backup_dir; \ + echo "✓ Backup created at $$backup_dir"; \ + fi + @mkdir -p $(HOME)/.config + @ln -s $(CURDIR) $(NVIM_DIR) + @echo "✓ Symlink created: $(NVIM_DIR) -> $(CURDIR)" + +install-brew: +ifeq ($(UNAME_S),Darwin) + @if ! command -v brew >/dev/null 2>&1; then \ + echo "Installing Homebrew..."; \ + /bin/bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; \ + echo "✓ Homebrew installed successfully"; \ + else \ + echo "✓ Homebrew already installed"; \ + fi +else + @echo "⚠ Homebrew installation is only supported on macOS" +endif + +install-fonts: install-brew +ifeq ($(UNAME_S),Darwin) + @echo "Installing Nerd Fonts on macOS..." + @for font in $(NERD_FONTS); do \ + echo "Installing $$font..."; \ + brew install --cask $$font || echo "⚠ Failed to install $$font"; \ + done + @echo "✓ Nerd Fonts installation complete" +else ifeq ($(UNAME_S),Linux) + @echo "Installing Nerd Fonts on Linux..." + @mkdir -p $(HOME)/.local/share/fonts + @for font in $(NERD_FONTS); do \ + font_name=$$(echo $$font | sed 's/font-//;s/-nerd-font//;s/-/ /g'); \ + echo "Downloading $$font_name..."; \ + curl -fLo "$(HOME)/.local/share/fonts/$$font.zip" \ + "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$$font_name.zip" || \ + echo "⚠ Failed to download $$font"; \ + unzip -o "$(HOME)/.local/share/fonts/$$font.zip" -d "$(HOME)/.local/share/fonts/" 2>/dev/null || true; \ + rm -f "$(HOME)/.local/share/fonts/$$font.zip"; \ + done + @fc-cache -fv + @echo "✓ Nerd Fonts installation complete" +else + @echo "⚠ Unsupported OS: $(UNAME_S)" +endif diff --git a/init.lua b/init.lua index b98ffc61..04120591 100644 --- a/init.lua +++ b/init.lua @@ -698,6 +698,59 @@ require('lazy').setup({ }, }, }, + + -- TypeScript + ts_ls = { + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, + }, + + -- Python + pyright = { + settings = { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = 'workspace', + useLibraryCodeForTypes = true, + typeCheckingMode = 'basic', + }, + }, + }, + }, + + -- Terraform + terraformls = { + settings = { + terraform = { + experimentalFeatures = { + validateOnSave = true, + }, + }, + }, + }, } -- Ensure the servers and tools above are installed @@ -716,6 +769,9 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'prettier', -- Formatter for TypeScript/JavaScript + 'black', -- Formatter for Python + 'isort', -- Python import sorting }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -876,27 +932,28 @@ require('lazy').setup({ }, }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. - config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - end, - }, + -- { -- You can easily change to a different colorscheme. + -- -- Change the name of the colorscheme plugin below, and then + -- -- change the command in the config to whatever the name of that colorscheme is. + -- -- + -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. + -- 'folke/tokyonight.nvim', + -- priority = 1000, -- Make sure to load this before all the other start plugins. + -- config = function() + -- ---@diagnostic disable-next-line: missing-fields + -- require('tokyonight').setup { + -- styles = { + -- comments = { italic = false }, -- Disable italics in comments + -- }, + -- } + -- + -- -- Load the colorscheme here. + -- -- Like many other themes, this one has different styles, and you could load + -- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. + -- vim.cmd.colorscheme 'tokyonight-night' + -- end, + -- }, + -- NOTE: TokyoNight is disabled in favor of Gruvbox (configured in lua/custom/plugins/gruvbox.lua) -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, @@ -922,17 +979,18 @@ require('lazy').setup({ -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- NOTE: mini.statusline is disabled in favor of lualine (configured in lua/custom/plugins/lualine.lua) + -- local statusline = require 'mini.statusline' + -- -- set use_icons to true if you have a Nerd Font + -- statusline.setup { use_icons = vim.g.have_nerd_font } + -- + -- -- You can configure sections in the statusline by overriding their + -- -- default behavior. For example, here we set the section for + -- -- cursor location to LINE:COLUMN + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim @@ -984,7 +1042,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! @@ -1012,5 +1070,8 @@ require('lazy').setup({ }, }) +-- Load custom keymaps +require('custom.keymaps') + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/keymaps/files.lua b/lua/custom/keymaps/files.lua new file mode 100644 index 00000000..3339924e --- /dev/null +++ b/lua/custom/keymaps/files.lua @@ -0,0 +1,16 @@ +-- File navigation and Telescope-related keybindings + +-- File explorer +vim.keymap.set('n', 'e', ':NvimTreeToggle', { desc = 'Toggle file explorer' }) +vim.keymap.set('n', 'fb', ':Telescope file_browser', { desc = 'Telescope file browser' }) + +-- Telescope pickers (additional to Kickstart defaults) +-- Note: These require telescope to be loaded, so we'll use pcall for safety +local ok, telescope_builtin = pcall(require, 'telescope.builtin') +if ok then + vim.keymap.set('n', 'ff', telescope_builtin.find_files, { desc = 'Find files' }) + vim.keymap.set('n', 'fg', telescope_builtin.live_grep, { desc = 'Live grep' }) + vim.keymap.set('n', 'fh', telescope_builtin.help_tags, { desc = 'Search help' }) + vim.keymap.set('n', 'fr', telescope_builtin.oldfiles, { desc = 'Recent files' }) + vim.keymap.set('n', 'fc', telescope_builtin.current_buffer_fuzzy_find, { desc = 'Search in current buffer' }) +end diff --git a/lua/custom/keymaps/general.lua b/lua/custom/keymaps/general.lua new file mode 100644 index 00000000..a37a43a8 --- /dev/null +++ b/lua/custom/keymaps/general.lua @@ -0,0 +1,34 @@ +-- General keymaps for navigation, editing, and window management + +-- Exit insert mode with jj +vim.keymap.set('i', 'jj', '', { desc = 'Exit insert mode' }) + +-- Split management +vim.keymap.set('n', 'sj', 'w', { desc = 'Move to next window' }) +vim.keymap.set('n', 'sk', 'W', { desc = 'Move to previous window' }) +vim.keymap.set('n', 'su', ':resize +5', { desc = 'Increase window height' }) +vim.keymap.set('n', 'si', ':resize -5', { desc = 'Decrease window height' }) +vim.keymap.set('n', 'sh', ':vertical resize +5', { desc = 'Increase window width' }) +vim.keymap.set('n', 'sl', ':vertical resize -5', { desc = 'Decrease window width' }) +vim.keymap.set('n', 'sd', ':hide', { desc = 'Hide current window' }) +vim.keymap.set('n', 'so', ':', { desc = 'Open command mode' }) +vim.keymap.set('n', 'ss', ':split ', { desc = 'Horizontal split' }) +vim.keymap.set('n', 'sv', ':vsplit ', { desc = 'Vertical split' }) + +-- Tab management +vim.keymap.set('n', 'th', ':tabfirst', { desc = 'Go to first tab' }) +vim.keymap.set('n', 'tj', ':tabnext', { desc = 'Go to next tab' }) +vim.keymap.set('n', 'tk', ':tabprev', { desc = 'Go to previous tab' }) +vim.keymap.set('n', 'tl', ':tablast', { desc = 'Go to last tab' }) +vim.keymap.set('n', 'tt', ':tabedit ', { desc = 'Create new tab' }) +vim.keymap.set('n', 'tn', ':tabnext', { desc = 'Go to next tab' }) +vim.keymap.set('n', 'tm', ':tabm ', { desc = 'Move tab' }) +vim.keymap.set('n', 'td', ':tabclose', { desc = 'Close tab' }) + +-- Buffer management +vim.keymap.set('n', '', ':bnext', { desc = 'Next buffer' }) +vim.keymap.set('n', '', ':bprev', { desc = 'Previous buffer' }) +vim.keymap.set('n', 'bd', ':bdelete', { desc = 'Close current buffer' }) + +-- Python debugging +vim.keymap.set('n', 'p', 'oimport ipdb; ipdb.set_trace()', { desc = 'Insert Python debugger breakpoint' }) diff --git a/lua/custom/keymaps/git.lua b/lua/custom/keymaps/git.lua new file mode 100644 index 00000000..18901bc8 --- /dev/null +++ b/lua/custom/keymaps/git.lua @@ -0,0 +1,6 @@ +-- Git-related keymaps + +-- LazyGit +vim.keymap.set('n', 'gg', ':LazyGit', { desc = 'Open LazyGit' }) +vim.keymap.set('n', 'gc', ':LazyGitCurrentFile', { desc = 'LazyGit current file' }) +vim.keymap.set('n', 'gf', ':LazyGitFilter', { desc = 'LazyGit filter' }) diff --git a/lua/custom/keymaps/init.lua b/lua/custom/keymaps/init.lua new file mode 100644 index 00000000..69e84746 --- /dev/null +++ b/lua/custom/keymaps/init.lua @@ -0,0 +1,5 @@ +-- Central loader for all keymap modules +require('custom.keymaps.general') +require('custom.keymaps.files') +require('custom.keymaps.git') +require('custom.keymaps.terminal') diff --git a/lua/custom/keymaps/terminal.lua b/lua/custom/keymaps/terminal.lua new file mode 100644 index 00000000..d1ad2dd6 --- /dev/null +++ b/lua/custom/keymaps/terminal.lua @@ -0,0 +1,12 @@ +-- Terminal and code execution keymaps + +-- ToggleTerm keybindings +-- Note: is already mapped in toggleterm config for opening terminal +vim.keymap.set('n', 'tt', ':ToggleTerm', { desc = 'Toggle terminal' }) +vim.keymap.set('n', 'tf', ':ToggleTerm direction=float', { desc = 'Toggle floating terminal' }) +vim.keymap.set('n', 'th', ':ToggleTerm direction=horizontal', { desc = 'Toggle horizontal terminal' }) +vim.keymap.set('n', 'tv', ':ToggleTerm direction=vertical', { desc = 'Toggle vertical terminal' }) + +-- Terminal mode mappings to escape easily +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) +vim.keymap.set('t', 'jj', '', { desc = 'Exit terminal mode with jj' }) diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua new file mode 100644 index 00000000..0442e3a6 --- /dev/null +++ b/lua/custom/plugins/bufferline.lua @@ -0,0 +1,63 @@ +return { + 'akinsho/bufferline.nvim', + version = '*', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('bufferline').setup { + options = { + mode = 'buffers', -- set to "tabs" to only show tabpages instead + themable = true, + numbers = 'none', -- "none" | "ordinal" | "buffer_id" | "both" + close_command = 'bdelete! %d', + right_mouse_command = 'bdelete! %d', + left_mouse_command = 'buffer %d', + middle_mouse_command = nil, + indicator = { + icon = '▎', + style = 'icon', -- 'icon' | 'underline' | 'none' + }, + buffer_close_icon = '󰅖', + modified_icon = '●', + close_icon = '', + left_trunc_marker = '', + right_trunc_marker = '', + max_name_length = 18, + max_prefix_length = 15, + truncate_names = true, + tab_size = 18, + diagnostics = 'nvim_lsp', + diagnostics_update_in_insert = false, + diagnostics_indicator = function(count, level, diagnostics_dict, context) + local icon = level:match('error') and ' ' or ' ' + return ' ' .. icon .. count + end, + offsets = { + { + filetype = 'NvimTree', + text = 'File Explorer', + text_align = 'center', + separator = true, + }, + }, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = true, + show_tab_indicators = true, + show_duplicate_prefix = true, + persist_buffer_sort = true, + separator_style = 'thin', -- "slant" | "slope" | "thick" | "thin" | { 'any', 'any' } + enforce_regular_tabs = false, + always_show_bufferline = true, + hover = { + enabled = true, + delay = 200, + reveal = { 'close' }, + }, + sort_by = 'insert_after_current', + }, + } + end, +} diff --git a/lua/custom/plugins/gruvbox.lua b/lua/custom/plugins/gruvbox.lua new file mode 100644 index 00000000..a95b86b1 --- /dev/null +++ b/lua/custom/plugins/gruvbox.lua @@ -0,0 +1,23 @@ +return { + 'ellisonleao/gruvbox.nvim', + priority = 1000, + config = function() + require('gruvbox').setup { + contrast = 'medium', + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + italic = { + strings = false, + emphasis = false, + comments = false, + operators = false, + folds = false, + }, + bold = true, + } + vim.o.background = 'dark' + vim.cmd.colorscheme 'gruvbox' + end, +} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000..91a50455 --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,16 @@ +return { + 'kdheepak/lazygit.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + keys = { + { 'gg', 'LazyGit', desc = 'LazyGit' }, + }, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000..a406417c --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,97 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'gruvbox', -- Matches global Gruvbox theme + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = { 'NvimTree' }, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = true, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + -- Section A: Mode (like airline) + lualine_a = { 'mode' }, + + -- Section B: Git branch and diff (like airline's VCS info) + lualine_b = { + 'branch', + 'diff', + }, + + -- Section C: Filename with readonly/modified status (like airline) + lualine_c = { + { + 'filename', + file_status = true, -- displays file status (readonly, modified) + path = 1, -- 0: filename, 1: relative path, 2: absolute path + shorting_target = 40, + symbols = { + modified = '[+]', + readonly = '[-]', + unnamed = '[No Name]', + }, + }, + 'diagnostics', -- LSP diagnostics + }, + + -- Section X: Filetype (like airline) + lualine_x = { + { + 'filetype', + colored = true, + icon_only = false, + }, + }, + + -- Section Y: File encoding and format (like airline: utf-8[unix]) + lualine_y = { + { + 'encoding', + fmt = string.upper, + }, + { + 'fileformat', + symbols = { + unix = 'LF', + dos = 'CRLF', + mac = 'CR', + }, + }, + }, + + -- Section Z: Position (like airline: 10% ☰ 10/100 ln : 20) + lualine_z = { + 'progress', + 'location', + }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = { 'nvim-tree', 'lazy', 'mason', 'toggleterm' }, + } + end, +} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100644 index 00000000..686d369c --- /dev/null +++ b/lua/custom/plugins/nvim-tree.lua @@ -0,0 +1,20 @@ +return { + 'nvim-tree/nvim-tree.lua', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('nvim-tree').setup { + sort_by = 'case_sensitive', + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = false, + }, + } + end, +} diff --git a/lua/custom/plugins/telescope.lua b/lua/custom/plugins/telescope.lua new file mode 100644 index 00000000..1d3aa73f --- /dev/null +++ b/lua/custom/plugins/telescope.lua @@ -0,0 +1,50 @@ +return { + 'nvim-telescope/telescope.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-fzf-native.nvim', + 'nvim-telescope/telescope-ui-select.nvim', + 'nvim-telescope/telescope-file-browser.nvim', + }, + config = function() + local telescope = require('telescope') + local actions = require('telescope.actions') + + telescope.setup { + defaults = { + prompt_prefix = '🔍 ', + selection_caret = '➤ ', + path_display = { 'truncate' }, + mappings = { + i = { + [''] = actions.move_selection_previous, + [''] = actions.move_selection_next, + [''] = actions.send_selected_to_qflist + actions.open_qflist, + }, + }, + }, + pickers = { + find_files = { + theme = 'dropdown', + previewer = false, + }, + buffers = { + theme = 'dropdown', + previewer = false, + initial_mode = 'normal', + }, + }, + extensions = { + file_browser = { + theme = 'ivy', + hijack_netrw = true, + }, + }, + } + + -- Load extensions + pcall(telescope.load_extension, 'fzf') + pcall(telescope.load_extension, 'ui-select') + pcall(telescope.load_extension, 'file_browser') + end, +} diff --git a/lua/custom/plugins/toggleterm.lua b/lua/custom/plugins/toggleterm.lua new file mode 100644 index 00000000..ab187073 --- /dev/null +++ b/lua/custom/plugins/toggleterm.lua @@ -0,0 +1,23 @@ +return { + 'akinsho/toggleterm.nvim', + version = '*', + config = function() + require('toggleterm').setup { + size = 20, + open_mapping = [[]], + hide_numbers = true, + shade_terminals = true, + shading_factor = 2, + start_in_insert = true, + insert_mappings = true, + persist_size = true, + direction = 'float', + close_on_exit = true, + shell = vim.o.shell, + float_opts = { + border = 'curved', + winblend = 0, + }, + } + end, +}