Skip to content

mtift/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nvim

Drupal development with Nvim

Requirements

  • Neovim >= 0.9.0
  • Git >= 2.19.0
  • A Nerd Font
  • A C compiler for nvim-treesitter
  • ripgrep
    • sudo apt install ripgrep
    • brew install ripgrep
  • fd
    • sudo apt install fd-find
    • brew install fd

Installation

Plugin manager

  • lazy (open with :Lazy)

LSP (Language Server Protocol)

  • lsp-zero - Helps setup intelephense LSP
  • mason - Package manager for LSP servers, DAP servers, linters, and formatters
  • mason-lspconfig - Bridges mason.nvim with the lspconfig plugin
  • nvim-lspconfig - Connects Neovim to the language server

Plugins

Debugging requirements

  • xdebug (for PHP debugging)
  • To debug locally, add the following to /etc/php/8.3/fpm/php.ini:
xdebug.client_port=9003
xdebug.mode=debug,develop
xdebug.start_with_request=yes
xdebug.max_nesting_level=1000
  • To debug with ddev:
    • wget https://ddev.readthedocs.io/en/stable/users/snippets/launch.json
    • ddev xdebug

Keyboard shortcuts

  • <leader>c - toggle comments for selected lines in normal and visual mode
  • <leader>cc - toggle comments for selected lines in normal mode
  • <leader>db> - debug toggle breakpoint
  • <leader>dc> - debugger close
  • <leader>di> - debug step into
  • <leader>do> - debug step over
  • <leader>ds> - debug start/continue debugging
  • <leader>dt> - debug step out
  • <leader>e - open neo-tree
  • <leader>er - float linting messages that don't wrap
  • <leader>ff - find files
  • <leader>ft - floating terminal show/hide
  • <leader>gh - show git history for the current file
  • <leader>ghc - close the git history window
  • <leader>lg - live grep
  • <leader>lga - live grep with args ("Choice" -g "*.schema.yml")
  • <leader>rr - make HTTP request
  • <leader>sk - search keymaps
  • <leader>t - open alpha splash screen in a new tab
  • K - hover definition
  • gT - previous buffer
  • gd - go to definition
  • gr - show references in horizontal split
  • gt - next buffer

About

Neovim config for Drupal development

Resources

Stars

Watchers

Forks

Languages