Skip to content

Mahathirrr/dot-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Emha's Neovim Configuration

Last

Dashboard

✨ Features

  • 🎨 Beautiful UI with Solarized Osaka colorscheme and custom dashboard
  • 🔍 Powerful Search with Telescope and file browser integration
  • 💡 Smart Completion with nvim-cmp and multiple sources
  • 🌳 Advanced Syntax highlighting with Treesitter
  • 🔧 LSP Integration for 15+ programming languages
  • 🎯 Code Actions with formatting, linting, and refactoring
  • 📝 Snippet Support with LuaSnip and friendly-snippets
  • 🚀 Fast Startup with lazy loading and optimized performance
  • 🎮 Git Integration with Gitsigns and Git.nvim
  • 🖥️ Terminal Integration with ToggleTerm

📋 Requirements

  • Neovim >= 0.9.0
  • Git >= 2.19.0
  • Node.js >= 16.0.0 (for LSP servers)
  • Python >= 3.8 (for Python support)
  • Go >= 1.19 (for Go support)
  • Java >= 11 (for Java support)
  • A Nerd Font (recommended: JetBrains Mono Nerd Font)

🚀 Installation

Prerequisites

# Install required dependencies
# On macOS
brew install neovim git node python go

# On Ubuntu/Debian
sudo apt update
sudo apt install neovim git nodejs npm python3 python3-pip golang-go

# On Arch Linux
sudo pacman -S neovim git nodejs npm python python-pip go

Install Configuration

# Backup existing configuration (if any)
mv ~/.config/nvim ~/.config/nvim.backup

# Clone this configuration
git clone https://github.com/yourusername/nvim-config ~/.config/nvim

# Start Neovim (plugins will install automatically)
nvim

🎨 Colorschemes

  • Primary: Solarized Osaka (with transparency support)
  • Alternative: Catppuccin, Tokyo Night

🔧 Language Support

Fully Configured Languages

Language LSP Server Formatter Linter Debugger
JavaScript/TypeScript tsserver Prettier ESLint
Python Pyright Black, isort Pylint
Go gopls gofumpt -
Java jdtls google-java-format -
C/C++ clangd clang-format - -
PHP intelephense phpcbf phpcs -
Lua lua_ls stylua - -
HTML/CSS html, cssls Prettier - -
JSON jsonls Prettier - -
Tailwind CSS tailwindcss - - -
Svelte svelte Prettier ESLint -
GraphQL graphql Prettier - -
Prisma prismals - - -
Markdown marksman Prettier - -
YAML yamlls Prettier - -
Docker dockerls - - -

⌨️ Key Mappings

General

Key Mode Action
<Space> Normal Leader key
jk / kj Insert Exit insert mode
<C-a> Normal Select all
<Leader>+ Normal Increment number
<Leader>- Normal Decrement number

Window Management

Key Mode Action
ss Normal Split horizontal
sv Normal Split vertical
<C-h/j/k/l> Normal Navigate windows
<C-w><arrows> Normal Resize windows

File Navigation

Key Mode Action
;f Normal Find files
;r Normal Live grep
\\ Normal List buffers
sf Normal File browser
;; Normal Resume last search

LSP

Key Mode Action
gd Normal Go to definition
gD Normal Go to declaration
gr Normal Show references
gi Normal Go to implementation
K Normal Hover documentation
<Leader>ca Normal/Visual Code actions
<Leader>rn Normal Rename symbol
[d / ]d Normal Navigate diagnostics

Git

Key Mode Action
<Leader>gb Normal Git blame
<Leader>go Normal Open in browser

Terminal

Key Mode Action
<C-\> Normal/Insert Toggle terminal

Custom Features

Key Mode Action
<Leader>r Normal Convert hex to HSL
<Leader>i Normal Toggle inlay hints
<Leader>z Normal Zen mode
<Leader>cc Normal Generate comment

🔌 Plugin Highlights

Core Plugins

UI & Appearance

Editor Enhancement

LSP & Development

Git Integration

Utilities

📁 Project Structure

~/.config/nvim/
├── init.lua                    # Entry point
├── lazy-lock.json             # Plugin lockfile
├── lazyvim.json              # LazyVim configuration
├── lua/
│   ├── config/               # Core configuration
│   │   ├── autocmds.lua     # Auto commands
│   │   ├── keymaps.lua      # Key mappings
│   │   ├── lazy.lua         # Plugin manager setup
│   │   ├── options.lua      # Neovim options
│   │   └── lsp/             # LSP configuration
│   ├── emha/                # Custom utilities
│   │   ├── hsl.lua         # Color conversion utilities
│   │   ├── icons.lua       # Icon definitions
│   │   ├── lsp.lua         # LSP helpers
│   │   ├── toggleterm.lua  # Terminal configuration
│   │   └── snip/           # Custom snippets
│   ├── plugins/             # Plugin configurations
│   │   ├── coding.lua      # Coding enhancements
│   │   ├── colorscheme.lua # Theme configuration
│   │   ├── editor.lua      # Editor plugins
│   │   ├── ui.lua          # UI plugins
│   │   └── ...
│   └── utils/               # Utility functions
└── snippets/                # Custom snippet collections

🎯 Custom Features

HSL Color Conversion

Convert hex colors to HSL format with <Leader>r - useful for CSS development.

Inlay Hints Toggle

Toggle LSP inlay hints with <Leader>i for better code understanding.

Smart Indentation

Automatic language-specific indentation:

  • 2 spaces: JavaScript, TypeScript, HTML, CSS, Lua
  • 4 spaces: Python, Java, C/C++, PHP, Go

Custom Dashboard

Beautiful ASCII art dashboard with quick access to recent files and projects.

🔧 Customization

Adding New Languages

  1. Install LSP server via Mason:

    -- In lua/plugins/mason.lua
    ensure_installed = {
      "your_language_server",
      -- ... other servers
    }
  2. Configure LSP in lua/plugins/lspconfig.lua:

    lspconfig["your_server"].setup({
      capabilities = capabilities,
      on_attach = on_attach,
      -- server-specific settings
    })
  3. Add formatter/linter in lua/plugins/none-ls.lua:

    sources = {
      formatting.your_formatter,
      diagnostics.your_linter,
      -- ... other sources
    }

Changing Colorscheme

Edit lua/config/lazy.lua:

opts = {
  colorscheme = "your_preferred_theme",
}

Custom Key Mappings

Add to lua/config/keymaps.lua:

keymap.set("n", "<your_key>", "<your_command>", { desc = "Description" })

🐛 Troubleshooting

Common Issues

  1. LSP not working: Run :Mason and ensure servers are installed
  2. Treesitter errors: Run :TSUpdate to update parsers
  3. Slow startup: Check :Lazy profile for plugin load times
  4. Missing icons: Install a Nerd Font and configure your terminal

Health Check

Run :checkhealth to diagnose configuration issues.

Logs

Check logs with:

  • :Lazy log - Plugin manager logs
  • :LspLog - LSP server logs
  • :messages - Neovim messages

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

This configuration is licensed under the MIT License. See LICENSE for details.

🙏 Acknowledgments

  • LazyVim for the excellent base configuration
  • Neovim community for the amazing ecosystem
  • All plugin authors for their incredible work

⭐ If you find this configuration helpful, please give it a star! ⭐

About

My Personal Neovim Profile

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages