Lädt...


🔧 🎉 LazyVim Adventure Part 2: Managing Projects Like a Boss! 🎉


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Welcome back, brave LazyVim adventurer! 🚀 In Part 1, you tamed LazyVim and learned the basics. Now it’s time to level up and conquer project management with LazyVim. This guide will teach you how to handle multiple files, navigate directories, and even integrate your terminal like a pro. Let’s dive in!

🏗️ Step 1: Project Setup

Let’s start by creating a project structure. Fire up your terminal (not LazyVim yet):

Create Your Project

mkdir -p MyAwesomeProject/src
mkdir MyAwesomeProject/tests
touch MyAwesomeProject/src/main.py
touch MyAwesomeProject/tests/test_main.py

Now you have this:

MyAwesomeProject/
├── src/
│   └── main.py
└── tests/
    └── test_main.py

🎨 Step 2: Open the Project in LazyVim

Navigate to your project folder:

cd MyAwesomeProject

Open LazyVim:

nvim .

Yes, the . tells LazyVim to open the current directory as a workspace. You'll see a file explorer pop up on the left. 🎉

📁 Step 3: Navigating the File Explorer (Nvim-Tree)

LazyVim comes preloaded with Nvim-Tree, a file explorer for your projects.

Open and Close the File Explorer

Press:

<leader> + e

(Reminder: <leader> = spacebar)

The file tree shows your project structure. Use the arrow keys to navigate:

  • Enter: Open a file or folder.
  • Backspace: Go up one level.
  • a: Create a new file or folder.
  • d: Delete a file or folder.
  • r: Rename a file or folder.

🔀 Step 4: Switching Between Files

You can’t just live in one file, right? LazyVim makes switching files a breeze.

Buffers Are Your Friends

Every file you open becomes a buffer. Think of buffers as open tabs in a browser.

  • Switch Buffers:

    Press Shift + h (previous buffer) or Shift + l (next buffer).

  • View Open Buffers:

    Press:

  <leader> + b

Select your file from the list.

  • Close Buffers: Press:
  <leader> + c

🧭 Step 5: Move Around the Project

LazyVim is all about quick navigation.

Navigate Between Splits

Want to edit two files side by side? Use splits:

  • Horizontal Split:

    Press Ctrl-w s.

  • Vertical Split:

    Press Ctrl-w v.

Switch between splits:

Ctrl-w + arrow keys

Jump to Definitions

If you’re working on a Python file, move to a function definition with gd (go to definition). To return, press Ctrl-o.

💻 Step 6: Run Terminal Commands

Sometimes, you need to execute commands without leaving LazyVim. Here’s how:

Open the Terminal

LazyVim lets you pop up a terminal with ease. Press:

<leader> + t

Now you can run commands like:

pytest tests/test_main.py

To exit the terminal, type exit or press Ctrl-d.

Open a Floating Terminal

Need a quick terminal overlay? Press:

<leader> + f + t

This opens a terminal in a floating window. Close it with Ctrl-w q.

🔍 Step 7: Searching and Jumping

You don’t have to scroll endlessly—LazyVim has your back!

Search Across Files

Press:

<leader> + /

Type your search term, and LazyVim will look across your project. Navigate through results with Enter.

Jump to a File

Want to quickly open a specific file? Press:

<leader> + p

Start typing the file name, and LazyVim will find it for you.

🛠️ Step 8: Project-Specific Commands

Sometimes, you’ll want to run project-specific commands like linting or testing.

Create a Makefile

Add a Makefile to your project:

run:
    python src/main.py

test:
    pytest tests/

Now you can run these commands in LazyVim’s terminal:

make run
make test

🎯 Step 9: Save Time with Key Mappings

LazyVim has built-in key mappings for efficiency. Here are a few gems:

  • Format Code: Press:
  <leader> + =
  • Toggle Comments: Press:
  <leader> + /
  • Find and Replace: Press :%s/old_text/new_text/g to replace all occurrences of old_text with new_text in the current file.

🎉 Step 10: Flex Your LazyVim Skills

Congrats, you’ve unlocked Part 2 of the LazyVim adventure. By now, you’re managing projects, navigating files like a ninja, and running commands like a pro.

Remember: LazyVim is your dragon. Keep taming it, and soon you’ll be flying through code faster than ever. Stay curious, have fun, and may your projects always compile on the first try. 🚀

...

🔧 🎉 LazyVim Adventure Part 2: Managing Projects Like a Boss! 🎉


📈 78.99 Punkte
🔧 Programmierung

🔧 🎉 Welcome to the LazyVim Adventure! 🎉 Part1


📈 37.89 Punkte
🔧 Programmierung

🔧 It's adventure time, but not any adventure, a Hive Adventure!


📈 29.79 Punkte
🔧 Programmierung

🔧 Setting Up NeoVim + LazyVim on My New Mac Mini M4 💻✨


📈 27.96 Punkte
🔧 Programmierung

🔧 Ultimate LazyVim Terminal Troubleshooting Tutorial (for the Brave Souls 🛠️)


📈 27.96 Punkte
🔧 Programmierung

🔧 Enhancing Elixir Development in LazyVim: Quick Documentation Access by Telescope


📈 27.96 Punkte
🔧 Programmierung

🔧 Lazyvim version 14.x in WSL


📈 27.96 Punkte
🔧 Programmierung

🔧 Customizing Your Lazyvim Setup for Personal Preferences


📈 27.96 Punkte
🔧 Programmierung

🔧 Effortless Formatting for OpenTofu Files with LazyVim


📈 27.96 Punkte
🔧 Programmierung

📰 Browser and Client-Side Hardening: Blog series: Pushing Left, Like a Boss — Part 5.3


📈 23.02 Punkte
📰 IT Security Nachrichten

📰 Pushing Left, Like a Boss — Part 5.2- Use Safe Dependencies


📈 23.02 Punkte
📰 IT Security Nachrichten

📰 Pushing Left, Like a Boss: Part 3— Secure Design – SheHacksPurple


📈 23.02 Punkte
📰 IT Security Nachrichten

🪟 Palworld boss locations map: Every tower boss and Alpha Pal in order


📈 22.69 Punkte
🪟 Windows Tipps

📰 Lords of the Fallen: Boss Weapons - diese Boss-Waffen gibt es


📈 22.69 Punkte
🖥️ Betriebssysteme

🪟 Diablo 4 Boss ladder: Boss locations, summoning guide and loot tables


📈 22.69 Punkte
🪟 Windows Tipps

🔧 Building My Own Authentication Boss: Go Learning Adventure


📈 21.27 Punkte
🔧 Programmierung

📰 Managing Cyber-Risk Is No Different Than Managing Any Business Risk


📈 20.26 Punkte
📰 IT Security Nachrichten

🐧 Legends of Adventure is an upcoming Sierra On-Line documentary on the rise of adventure games


📈 19.86 Punkte
🐧 Linux Tipps

🔧 NetCraft: The AWS VPC Adventure Series: adventure 1


📈 19.86 Punkte
🔧 Programmierung

🐧 Colossal Cave Adventure - The Most Famous Classic Text-based Adventure Game


📈 19.86 Punkte
🐧 Linux Tipps

🔧 The Faces Behind Open Source Projects: Tim Jones and pg-boss


📈 19.3 Punkte
🔧 Programmierung

📰 New soft robots roll like tires, spin like tops and orbit like moons


📈 18.19 Punkte
🔧 AI Nachrichten

🎥 Managing projects in Microsoft Teams


📈 18.09 Punkte
🎥 Video | Youtube

🐧 Triskel - A web application for managing quotes, invoices, customers, projects, suppliers, payments, etc.


📈 18.09 Punkte
🐧 Linux Tipps

🔧 2025’s Best Practices for Managing CSS in Large-Scale Projects


📈 18.09 Punkte
🔧 Programmierung

🔧 Master Django Admin: A Beginner’s Guide to Managing Your Projects


📈 18.09 Punkte
🔧 Programmierung

🔧 Creating and Managing Projects in Jira: A Beginner’s Guide


📈 18.09 Punkte
🔧 Programmierung

🔧 Creating and Managing Projects in Jira: A Beginner’s Guide


📈 18.09 Punkte
🔧 Programmierung

🔧 Productivity Hacks: Managing Coding Tasks and Learning Projects


📈 18.09 Punkte
🔧 Programmierung

matomo