refactor(keys): improve keymap configurations and remove unused floaterm plugin

This commit is contained in:
sankalp committed 2025-09-28 21:28:19 +05:45
1 parent 1c14292c8f
commit 4c5fa067e2
6 files changed
+137 -178

No files matched your search

+13 -17
View File
@@ -80,10 +80,12 @@ map('v', "<leader>'", "s''<esc>Pll", { desc = 'wrap selection with single quotes
map('v', '<leader>"', 's""<esc>Pll', { desc = 'wrap selection with double quotes' })
-- Insert mode cursor movement with Ctrl+hjkl
map('i', '<C-h>', '<Left>', { desc = 'Move to end of previous line' })
map('i', '<C-j>', '<Down>', { desc = 'Move cursor down' })
map('i', '<C-k>', '<Up>', { desc = 'Move cursor up' })
map('i', '<C-l>', '<Right>', { desc = 'Move cursor right' })
map('i', '<C-h>', '<Left>', { noremap = true, silent = true })
map('i', '<C-j>', '<Down>', { noremap = true, silent = true })
map('i', '<C-k>', '<Up>', { noremap = true, silent = true })
map('i', '<C-l>', '<Right>', { noremap = true, silent = true })
map('n', '<leader>re', ':%s/<C-R><C-W>/', { desc = 'Shortcut to replace current word under cursor' })
-- toggle inlay hints
vim.keymap.set('n', '<leader>th', function()
@@ -91,17 +93,11 @@ vim.keymap.set('n', '<leader>th', function()
end)
-- No arrow navigation
vim.api.nvim_set_keymap('n', '<Up>', '<Nop>', opts)
vim.api.nvim_set_keymap('n', '<Down>', '<Nop>', opts)
vim.api.nvim_set_keymap('n', '<Left>', '<Nop>', opts)
vim.api.nvim_set_keymap('n', '<Right>', '<Nop>', opts)
local modes = { 'n', 'v', 'i' }
local arrows = { '<Up>', '<Down>', '<Left>', '<Right>' }
vim.api.nvim_set_keymap('v', '<Up>', '<Nop>', opts)
vim.api.nvim_set_keymap('v', '<Down>', '<Nop>', opts)
vim.api.nvim_set_keymap('v', '<Left>', '<Nop>', opts)
vim.api.nvim_set_keymap('v', '<Right>', '<Nop>', opts)
vim.api.nvim_set_keymap('i', '<Up>', '<Nop>', opts)
vim.api.nvim_set_keymap('i', '<Down>', '<Nop>', opts)
vim.api.nvim_set_keymap('i', '<Left>', '<Nop>', opts)
vim.api.nvim_set_keymap('i', '<Right>', '<Nop>', opts)
for _, mode in ipairs(modes) do
for _, key in ipairs(arrows) do
vim.api.nvim_set_keymap(mode, key, '<Nop>', opts)
end
end
+53 -53
View File
@@ -1,66 +1,66 @@
local options = {
ai = true,
clipboard = "unnamedplus", -- use system clipboard
number = true,
relativenumber = true,
undofile = true, -- save state of file on write
undodir = vim.fn.stdpath("cache") .. "/undo",
undolevels = 10000,
autoread = true, -- autoread changes from other sources
signcolumn = "yes",
cursorline = true,
cursorlineopt = "number",
wrap = false,
scrolloff = 3,
ruler = false, -- removes cursor position from lastline
pumheight = 10, -- size of completion window
showmode = false, -- do not show mode under statusline
swapfile = false, -- creates a swapfile
backup = false, -- creates a backup file
writebackup = false, -- do not edit backups
winminwidth = 5, -- Minimum window width
termguicolors = true, -- set term gui colors (most terminals support this)
showtabline = 0, -- always show tabs
showcmd = false,
mouse = "a", -- allow the mouse to be used in neovim
confirm = true, -- Confirm to save changes before exiting modified buffer
ai = true,
clipboard = 'unnamedplus', -- use system clipboard
number = true,
relativenumber = true,
undofile = true, -- save state of file on write
undodir = vim.fn.stdpath('cache') .. '/undo',
undolevels = 10000,
autoread = true, -- autoread changes from other sources
signcolumn = 'yes',
cursorline = true,
cursorlineopt = 'number',
wrap = false,
scrolloff = 3,
ruler = false, -- removes cursor position from lastline
pumheight = 10, -- size of completion window
showmode = false, -- do not show mode under statusline
swapfile = false, -- creates a swapfile
backup = false, -- creates a backup file
writebackup = false, -- do not edit backups
winminwidth = 5, -- Minimum window width
termguicolors = true, -- set term gui colors (most terminals support this)
showtabline = 0, -- always show tabs
showcmd = false,
mouse = 'a', -- allow the mouse to be used in neovim
confirm = true, -- Confirm to save changes before exiting modified buffer
-- tabs
smarttab = true,
tabstop = 4, -- 1 tab represented as 4 spaces
expandtab = true, -- <tab> key will create " " instead of "\t"
shiftwidth = 4, -- indent change after backspace and >> <<
softtabstop = 4, -- number of spaces instead of tab
autoindent = true, -- auto indent
smartindent = true, -- make indenting smarter again
list = true,
-- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight
showbreak = string.rep(" ", 3),
-- tabs
smarttab = true,
tabstop = 4, -- 1 tab represented as 4 spaces
expandtab = true, -- <tab> key will create " " instead of "\t"
shiftwidth = 4, -- indent change after backspace and >> <<
softtabstop = 4, -- number of spaces instead of tab
autoindent = true, -- auto indent
smartindent = true, -- make indenting smarter again
list = true,
-- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight
showbreak = string.rep(' ', 3),
-- Search
ignorecase = true,
smartcase = true,
hlsearch = true,
wildmenu = true,
wildmode = "longest:full,full",
wildoptions = "pum",
-- Search
ignorecase = true,
smartcase = true,
hlsearch = true,
wildmenu = true,
wildmode = 'longest:full,full',
wildoptions = 'pum',
-- Folds (keep open by default, works well with nvim-ufo)
foldlevel = 99,
foldlevelstart = 99,
foldenable = true,
-- Folds (keep open by default, works well with nvim-ufo)
foldlevel = 99,
foldlevelstart = 99,
foldenable = true,
-- Window
splitright = true,
splitbelow = true,
title = true,
-- Window
splitright = true,
splitbelow = true,
title = true,
}
for k, v in pairs(options) do
vim.opt[k] = v
vim.opt[k] = v
end
vim.opt.path:append({ "**" })
vim.opt.path:append({ '**' })
vim.opt.shortmess:append({ W = true, I = true, c = true }) -- disable greeting
-- Fix markdown indentation settings