Skip to content

Here’s a structured table for the shortcuts and configurations, followed by all complementary configurations in one file for easy setup.

Shortcuts Table

ActionShortcutDescription
File and Buffer Management
Save the current file:wSaves the current file
Quit the current window:qQuits the current window
Save and quit:wqSaves the file and quits the current window
Close the buffer:bdCloses the current buffer
Go to the next buffer:bnMoves to the next buffer
Go to the previous buffer:bpMoves to the previous buffer
Navigation
Jump to the top of fileggMoves the cursor to the top of the file
Jump to the bottom of fileGMoves the cursor to the bottom of the file
Jump to the beginning of line0Moves the cursor to the start of the current line
Jump to the end of line$Moves the cursor to the end of the current line
Move forward by a wordwMoves the cursor one word forward
Move backward by a wordbMoves the cursor one word backward
Go back to previous locationCtrl + oJumps back to the previous cursor location
Go forwardCtrl + iJumps forward to the next cursor location
Scroll up half a pageCtrl + uScrolls up half a page
Scroll down half a pageCtrl + dScrolls down half a page
Visual Mode
Enter visual modevEnter character-wise visual mode
Enter line-wise visual modeVSelects an entire line in visual mode
Enter block visual modeCtrl + vEnters block-wise visual mode for column editing
Yank (copy) selected textyCopies the selected text
Delete selected textdDeletes the selected text
Paste after cursorpPastes after the cursor
Paste before cursorPPastes before the cursor
Editing
Undo last actionuUndoes the last action
Redo last actionCtrl + rRedoes the last undone action
Indent current line>>Indents the current line
Un-indent current line<<Un-indents the current line
Yank (copy) the current lineyyCopies the current line
Delete the current lineddDeletes the current line
Search and Replace
Start search/Starts forward search
Search backward?Starts backward search
Next search matchnGoes to the next search match
Previous search matchNGoes to the previous search match
Replace text globally:%s/foo/bar/gcReplaces "foo" with "bar" throughout the file with confirmation
Window Management
Split window verticallyCtrl + w vSplits the window vertically
Split window horizontallyCtrl + w sSplits the window horizontally
Move between splitsCtrl + w h/j/k/lMove between window splits
Close current splitCtrl + w qCloses the current split
Tabs
Open new tab:tabnew <filename>Opens a new tab with the specified file
Next tab:tabnMoves to the next tab
Previous tab:tabpMoves to the previous tab
Close current tab:tabcloseCloses the current tab
Quickfix/Location List
Open the quickfix list:copenOpens the quickfix list
Next quickfix item:cnextJumps to the next item in the quickfix list
Previous quickfix item:cprevJumps to the previous item in the quickfix list
Open the location list:lopenOpens the location list
Next location list item:lnextJumps to the next item in the location list
Previous location list item:lprevJumps to the previous item in the location list

Complete Configuration File

lua
-- Enable line numbers and relative line numbers for easier navigation
vim.opt.number = true               -- Shows absolute line number on the current line
vim.opt.relativenumber = true       -- Shows relative line numbers on all other lines

-- Split window behavior for horizontal and vertical splits
vim.opt.splitbelow = true           -- Horizontal splits open below the current window
vim.opt.splitright = true           -- Vertical splits open to the right of the current window

-- Disable line wrapping and configure tab behavior
vim.opt.wrap = false                -- Disable line wrapping
vim.opt.expandtab = false           -- Use tabs instead of spaces
vim.opt.tabstop = 4                 -- Each tab character is equal to 4 spaces
vim.opt.shiftwidth = 4              -- Indentation levels are 4 spaces wide

-- Enable virtual editing in block visual mode
vim.opt.virtualedit = "block"       -- Allows the cursor to move freely in block visual mode

-- Integrate clipboard for system-wide copy-paste
vim.opt.clipboard = "unnamedplus"   -- Uses the system clipboard

-- Scrolling behavior that keeps the cursor centered
vim.opt.scrolloff = 999             -- Always keep the cursor vertically centered

-- Incremental command execution for substitution previews
vim.opt.inccommand = "split"        -- Show live substitution previews in a split window

-- Enable case-insensitive search, with case-sensitive override
vim.opt.ignorecase = true           -- Ignore case while searching
vim.opt.smartcase = true            -- Override to case-sensitive if the search contains uppercase letters

-- Enable true color support for better color schemes
vim.opt.termguicolors = true        -- Enable 24-bit RGB colors for the terminal

-- Automatically highlight all search matches
vim.opt.hlsearch = true             -- Highlight all matches of the search pattern

-- Enable incremental search to show results as you type
vim.opt.incsearch = true            -- Display search matches as you type

-- Enable persistent undo across sessions
vim.opt.undofile = true             -- Store undo history to file

-- Always show the sign column to prevent text shifting
vim.opt.signcolumn = "yes"          -- Show the sign column all the time

-- Set up lazy.nvim plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
    local lazyrepo = "https://github.com/folke/lazy.nvim.git"
    local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
    if vim.v.shell_error ~= 0 then
        vim.api.nvim_echo({
            { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
            { out, "WarningMsg" },
            { "\nPress any key to exit..." },
        }, true, {})
        vim.fn.getchar()
        os.exit(1)
    end
end
vim.opt.rtp:prepend(lazypath)

-- Install and configure the kanagawa colorscheme plugin
require("lazy").setup({
    spec = {
        "rebelot/kanagawa.nvim"   -- Install the Kanagawa color scheme plugin
    }
})

-- Apply the Kanagawa color scheme
vim.cmd('colorscheme kanagawa-wave')

This file combines configurations to improve navigation, enable better file handling, enhance color support, and handle splits and search efficiently. It also provides Neovim shortcuts that complement the configs, optimizing your Neovim setup.

Released under the MIT License.