Skip to main content
Magictt provides multiple powerful tools for navigating files and projects: Telescope for fuzzy finding, nvim-tree for file exploration, and Harpoon for quick file switching.

Fuzzy Finder: Telescope

Telescope is a highly extendable fuzzy finder for files, text, and more. It’s the primary way to navigate and search in Magictt.

Features

  • Fast Fuzzy Finding: Quickly find files by typing partial names
  • Live Grep: Search text across entire project
  • Smart Path Display: Shows relevant parts of file paths
  • FZF Integration: Uses native FZF for better performance
  • TODO Integration: Search for TODO comments
  • Preview Window: Preview file contents before opening

Keybindings

KeybindingActionDescription
<leader>ffFind FilesFuzzy find files in current directory
<leader>frRecent FilesFind recently opened files
<leader>fsFind StringLive grep - search text in all files
<leader>fcFind CursorFind string under cursor in project
<leader>ftFind TODOsSearch TODO comments with Telescope

Telescope Navigation

Once in Telescope:
KeybindingAction
<C-j>Move to next result
<C-k>Move to previous result
<C-q>Send selected to quickfix list
<CR>Open selected file
<Esc>Close Telescope

Usage Workflows

Find Files

  1. Press <leader>ff
  2. Start typing filename (fuzzy matching)
  3. Navigate results with <C-j>/<C-k>
  4. Press <CR> to open file
<leader>ff
Type: "main.js"
Matches: src/main.js, lib/mainController.js

Search Text

  1. Press <leader>fs
  2. Type search term
  3. Results update live as you type
  4. Preview shows context
  5. Open file with <CR>
<leader>fs
Type: "function handleClick"
Finds all occurrences across project

Find Under Cursor

  1. Place cursor on word
  2. Press <leader>fc
  3. Telescope searches for that word
  4. See all occurrences

Recent Files

  1. Press <leader>fr
  2. See recently opened files
  3. Quick access to your working set

Configuration

Location: lua/magictt/plugins/telescope.lua
return {
  "nvim-telescope/telescope.nvim",
  branch = "0.1.x",
  dependencies = {
    "nvim-lua/plenary.nvim",
    { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
    "nvim-tree/nvim-web-devicons",
    "folke/todo-comments.nvim",
  },
  config = function()
    local telescope = require("telescope")
    local actions = require("telescope.actions")

    telescope.setup({
      defaults = {
        path_display = { "smart" },  -- Smart path truncation
        mappings = {
          i = {
            ["<C-k>"] = actions.move_selection_previous,
            ["<C-j>"] = actions.move_selection_next,
            ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
          },
        },
      },
    })

    -- Load FZF extension for better performance
    telescope.load_extension("fzf")

    -- Keybindings
    local keymap = vim.keymap
    keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
    keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>")
    keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>")
    keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>")
    keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>")
  end,
}

FZF Native Extension

The telescope-fzf-native extension provides:
  • Faster sorting
  • Better fuzzy matching algorithm
  • Native C implementation for performance
Requires make to build during installation.

File Explorer: nvim-tree

nvim-tree is a file explorer tree that provides a traditional sidebar view of your project structure.

Features

  • Tree View: Hierarchical file/folder display
  • Git Integration: Shows git status for files
  • Icons: File type icons and folder indicators
  • Relative Numbers: Line numbers for quick navigation
  • Indent Markers: Visual guides for tree structure
  • File Operations: Create, rename, delete files/folders

Keybindings

Open/Close

KeybindingAction
<leader>eeToggle file explorer
<leader>efToggle explorer on current file
<leader>ecCollapse file explorer
<leader>erRefresh file explorer

Inside nvim-tree

KeybindingAction
<CR>Open file/folder
oOpen file/folder
<C-v>Open in vertical split
<C-x>Open in horizontal split
<C-t>Open in new tab
<BS>Close directory
PGo to parent directory
KGo to first sibling
JGo to last sibling
rRename file/folder
aCreate new file/folder
dDelete file/folder
cCopy file/folder
xCut file/folder
pPaste file/folder
yCopy filename
YCopy relative path
gyCopy absolute path
g?Show help
qClose tree

Git Status Icons

  • ✓ Staged
  • ✗ Deleted
  • ★ Renamed
  • ✚ Untracked
  • ● Modified
  • ◌ Ignored

File Operations Workflow

Create File/Folder

  1. Open nvim-tree (<leader>ee)
  2. Navigate to desired location
  3. Press a (add)
  4. Type name (add / at end for folder)
  5. Press <CR>

Rename File

  1. Navigate to file
  2. Press r
  3. Edit name
  4. Press <CR>
  5. LSP automatically updates imports (via nvim-lsp-file-operations)

Delete File

  1. Navigate to file
  2. Press d
  3. Confirm deletion

Configuration

Location: lua/magictt/plugins/nvim-tree.lua
return {
  "nvim-tree/nvim-tree.lua",
  dependencies = "nvim-tree/nvim-web-devicons",
  config = function()
    local nvimtree = require("nvim-tree")

    -- Disable netrw (Vim's default file explorer)
    vim.g.loaded_netrw = 1
    vim.g.loaded_netrwPlugin = 1

    nvimtree.setup({
      view = {
        width = 35,              -- Tree width in columns
        relativenumber = true,   -- Show relative line numbers
      },
      renderer = {
        indent_markers = {
          enable = true,         -- Show indent guide lines
        },
        icons = {
          glyphs = {
            folder = {
              arrow_closed = "",  -- Closed folder arrow
              arrow_open = "",    -- Open folder arrow
            },
          },
        },
      },
      actions = {
        open_file = {
          window_picker = {
            enable = false,      -- Better split behavior
          },
        },
      },
      filters = {
        custom = { ".DS_Store" }, -- Hide macOS files
      },
      git = {
        ignore = false,          -- Show .gitignored files
      },
    })

    -- Keybindings
    local keymap = vim.keymap
    keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>")
    keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFileToggle<CR>")
    keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>")
    keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>")
  end,
}

Quick Navigation: Harpoon

Harpoon provides lightning-fast navigation between your most important files in a project.

Concept

Harpoon lets you “mark” files and quickly jump between them:
  • Add files to your Harpoon list
  • Navigate with simple keybindings
  • Perfect for files you’re actively working on

Features

  • Quick Marks: Mark important files
  • Fast Navigation: Jump between marked files instantly
  • Visual Menu: See all marked files
  • Persistent: Marks persist per project
  • Minimal: No visual clutter

Keybindings

KeybindingAction
<leader>haAdd current file to Harpoon
<leader>hrRemove current file from Harpoon
<C-e>Toggle Harpoon quick menu
<C-p>Navigate to previous Harpoon file
<C-n>Navigate to next Harpoon file

Workflow

Typical Harpoon Session

  1. Mark Files
    Open src/main.js
    Press <leader>ha (file added to Harpoon)
    
    Open src/utils.js
    Press <leader>ha (file added to Harpoon)
    
    Open src/api.js
    Press <leader>ha (file added to Harpoon)
    
  2. Navigate Between Files
    Press <C-n> (jump to utils.js)
    Press <C-n> (jump to api.js)
    Press <C-p> (jump back to utils.js)
    
  3. View All Marks
    Press <C-e> (opens menu)
    See all marked files
    Navigate and select
    
  4. Remove Marks
    Open file to remove
    Press <leader>hr (removed from Harpoon)
    

Use Cases

  • Active Development: Mark the 3-4 files you’re currently working on
  • Code Review: Mark files under review for easy switching
  • Related Files: Mark implementation, test, and config files
  • Quick Context Switch: Jump between feature files

Configuration

Location: lua/magictt/plugins/harpoon.lua
return {
  "ThePrimeagen/harpoon",
  branch = "harpoon2",
  dependencies = { "nvim-lua/plenary.nvim" },
  config = function()
    local harpoon = require("harpoon")
    harpoon:setup()
    
    -- Register with which-key
    require("which-key").add({
      { "<leader>h", group = "Harpoon" },
    })

    -- Add file to Harpoon
    vim.keymap.set("n", "<leader>ha", function()
      harpoon:list():add()
    end, { desc = "Harpoon: Add file" })

    -- Toggle quick menu
    vim.keymap.set("n", "<C-e>", function()
      harpoon.ui:toggle_quick_menu(harpoon:list())
    end, { desc = "Harpoon: Toggle menu" })

    -- Navigate to previous file
    vim.keymap.set("n", "<C-p>", function()
      harpoon:list():prev()
    end, { desc = "Harpoon: Previous file" })

    -- Navigate to next file
    vim.keymap.set("n", "<C-n>", function()
      harpoon:list():next()
    end, { desc = "Harpoon: Next file" })

    -- Remove current file
    vim.keymap.set("n", "<leader>hr", function()
      harpoon:list():remove()
    end, { desc = "Harpoon: Remove current file" })
  end,
}

When to Use Each Tool

ToolBest ForSpeedUse Case
TelescopeFinding files by name or contentFast”Where is that file?“
nvim-treeExploring project structureMedium”What’s in this folder?”
HarpoonSwitching between active filesInstant”Back to my main files”

Combined Workflow Example

1. Use nvim-tree to explore new project
   - Understand structure
   - Find main entry points

2. Use Telescope to find specific files
   - Search for feature implementations
   - Grep for function definitions

3. Use Harpoon for active development
   - Mark the 3-4 files you're editing
   - Quick switch while coding

4. Use Telescope for searches
   - Find references
   - Search for TODO comments

5. Back to nvim-tree for file operations
   - Create new files
   - Rename/move files

Keybindings Summary

Quick Reference

KeybindingActionTool
<leader>ffFind filesTelescope
<leader>fsSearch textTelescope
<leader>frRecent filesTelescope
<leader>ftFind TODOsTelescope
<leader>eeToggle treenvim-tree
<leader>efFind in treenvim-tree
<leader>haHarpoon addHarpoon
<C-e>Harpoon menuHarpoon
<C-p> / <C-n>Harpoon navHarpoon

Tips and Tricks

Telescope

  • Use fuzzy matching: type non-contiguous letters
    • “mcom” matches “MainComponent.jsx”
  • Use <C-q> to send results to quickfix for batch operations
  • Preview window shows file contents before opening

nvim-tree

  • Use relative numbers (<number>j/<number>k) for fast navigation
  • Press g? inside tree to see all keybindings
  • Use . to show/hide hidden files

Harpoon

  • Keep your list small (3-5 files) for best results
  • Clear your list when switching tasks
  • Use <C-e> to reorder files in the menu

Customization

Change Telescope Layout

Edit lua/magictt/plugins/telescope.lua:
defaults = {
  layout_strategy = "vertical",  -- or "horizontal", "center"
  layout_config = {
    width = 0.9,
    height = 0.9,
  },
}

Change nvim-tree Width

Edit lua/magictt/plugins/nvim-tree.lua:
view = {
  width = 40,  -- Change from 35 to 40
}

Add More Harpoon Keybindings

Edit lua/magictt/plugins/harpoon.lua:
-- Jump to specific positions
vim.keymap.set("n", "<leader>1", function()
  harpoon:list():select(1)
end)
vim.keymap.set("n", "<leader>2", function()
  harpoon:list():select(2)
end)

Plugin Overview

See all installed plugins

Keybindings

Complete keybinding reference

Build docs developers (and LLMs) love