Skip to content

lstanard/neovim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Configuration

Personal neovim configuration, written in Lua with a focus on front-end development.

Uses lazy.nvim plugin manager and Everforest color scheme.

Requirements

Installation

  1. Clone repo
  2. Symlink configuration - ln -s ~/repo/path ~/.config/nvim
  3. Open neovim to install all plugins, then restart

Commonly used key mappings

keys mapping
<leader>qq Quit
<leader>ca Show LSP code actions
<leader>ch Show LSP symbol signature
[d Move to previous diagnostic
]d Move to next diagnostic
<leader>hl Toggle search highlight
<leader>a Select all text in current buffer
<leader>ws Toggle show whitespace characters
<leader>tk Change vertical split to horizontal
<leader>th Change horizontal split to vertical

Plugins

Navigation

File finder, previewer, and picker.

keys mapping
<C-t> Go to file in a new tab
<leader>ff File finder
<leader>fg Live grep
<leader>fu Open buffer browser

File browser extension for Telescope.

keys mapping
<leader>fb Open file browser
<C-h> Toggle hidden files/folders

Recent file browser extension for Telescope.

keys mapping
<leader>fr Open recent files browser

File explorer tree.

keys mapping
<C-n> Toggle file explorer
<leader>n Focus file explorer
<leader>nc Collapse tree recursively
<leader>nr Refresh tree

Tree-like symbol view.

See default keymaps

keys mapping
<leader>so Toggle symbol outline pane

Session management

Delete buffers without messing up window layouts.

keys mapping
<leader>q Delete buffer without closing window

Session management.

keys mapping
<leader>qs Restore session for current directory
<leader>ql Restore last session

Code and text editing

A pretty list for showing diagnostics, references, telescope results, quickfix and location lists.

keys mapping
<leader>xx TroubleToggle
<leader>xw TroubleToggle Workspace Diagnostics
<leader>xd TroubleToggle Document Diagnostics
<leader>xl TroubleToggle Location List
<leader>xq TroubleToggle Quick Fix
gR LSP References
gY LSP Type Definitions
gD LSP Definitions

Easily comment and un-comment code.

keys mapping
gcc Comment out a line
gc{motion} Comment target of a motion

Change, add, and remove surrounding characters.

keys mapping
S In visual mode - wrap selected text
cs{existing character}{new character} Replace surrounding characters
ds{existing character} Remove surrounding characters
ysiw{surrounding character} Surround current text with characters

Examples:

  • cs"' would replace double quotes with single quotes
  • ds" would remove double quotes around a string
  • ysiw] would surround current text with square brackets
    • Use ] for no space, and [ to enter space inside the brackets around text
  • S in visual mode – S<p class="important"> would wrap selected line with a <p> tag that includes a class

Git integration

Inline git blame message.

keys mapping
<leader>gb Toggle git blame

LazyGit integration for neovim.

keys mapping
Lg Open LazyGit

Git status symbols in the sign column.

keys mapping
[c Previous hunk
]c Next hunk
<leader>hp Preview hunk
<leader>hs Stage hunk
<leader>hu Undo hunk

Miscellaneous

Undo visualizer.

keys mapping
<leader>h Toggle undotree

Dim inactive portions of code.

keys mapping
<leader>t Toggle Twilight

Issues & Todo

  • Further configuration of ufo code folding
    • Remove folding indicators in sign column (make match repo screenshot)
  • Fix diagnostics symbols in the sign column
    • Right now it's showing 'W' or 'E' instead of icon
  • Figure out why custom code snippets aren't working
  • Would like to create a custom command/plugin (not sure which), where I could select a word, then run a command that would insert a console.log() statement on the next line with that value being logged out

About

Personal neovim configuration

Resources

Stars

Watchers

Forks

Languages