💅 style(options): increase updatetime for balance between responsiveness and performance

This commit is contained in:
sankalp committed 2025-06-15 22:05:46 +05:45
1 parent d36d0084f1
commit da5e51e9c4
10 files changed
+50 -170

No files matched your search

+2 -147
View File
@@ -14,6 +14,7 @@ vim.g.maplocalleader = ' '
-- normal_mode = "n", insert_mode = "i", visual_mode = "v",
-- visual_block_mode = "x", term_mode = "t", command_mode = "c",
-- Use jj as escape
map('i', 'jj', '<Esc>', opts)
map('i', 'jk', '<Esc>', opts)
@@ -76,6 +77,7 @@ map('n', '<A-S-Down>', 'yyp', { desc = 'Duplicate line down' })
map('v', '<A-S-Up>', "y'<Pgv", { desc = 'Duplicate selection up' })
map('v', '<A-S-Down>', "y'>pgv", { desc = 'Duplicate selection down' })
-- Line manipulation
map('n', '<C-]>', '>>', { desc = 'Indent line' })
map('n', '<C-[>', '<<', { desc = 'Unindent line' })
@@ -148,152 +150,5 @@ map('v', '<leader>{', 's{}<esc>Pll', { desc = 'wrap selection with curly braces'
map('v', "<leader>'", "s''<esc>Pll", { desc = 'wrap selection with single quotes' })
map('v', '<leader>"', 's""<esc>Pll', { desc = 'wrap selection with double quotes' })
local function map(mode, lhs, rhs, opts)
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
local opts = { noremap = true, silent = true }
-- Space as leader
map('n', '<Space>', '', opts)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Modes
-- normal_mode = "n", insert_mode = "i", visual_mode = "v",
-- visual_block_mode = "x", term_mode = "t", command_mode = "c",
-- Use jj as escape
map('i', 'jj', '<Esc>', opts)
map('i', 'jk', '<Esc>', opts)
map('i', 'kj', '<Esc>', opts)
map('t', 'JJ', '<C-\\><C-n>', opts)
-- Terminal Mappings
map('t', 'jk', '<C-\\><C-n>')
map('t', 'kj', '<C-\\><C-n>')
map('t', '<ESC>', '<C-\\><C-n>')
-- Visual overwrite paste
map({ 'v', 'x' }, 'p', '"_dP', opts)
-- Do not copy on x
map({ 'v', 'x' }, 'x', '"_x', opts)
-- VSCode style shortcuts
-- File operations
map('n', '<C-s>', ':w<CR>', { desc = 'Save file' })
map('i', '<C-s>', '<Esc>:w<CR>a', { desc = 'Save file' })
map('n', '<C-q>', ':q<CR>', { desc = 'Quit' })
map('n', '<C-w>', ':bd<CR>', { desc = 'Close buffer' })
-- Undo/Redo
map('n', '<C-z>', 'u', { desc = 'Undo' })
map('i', '<C-z>', '<C-o>u', { desc = 'Undo' })
map('n', '<C-y>', '<C-r>', { desc = 'Redo' })
map('i', '<C-y>', '<C-o><C-r>', { desc = 'Redo' })
-- Select all
map('n', '<C-a>', 'ggVG', { desc = 'Select all' })
map('i', '<C-a>', '<Esc>ggVG', { desc = 'Select all' })
-- Copy/Cut
map('v', '<C-c>', 'y', { desc = 'Copy' })
map('v', '<C-x>', 'd', { desc = 'Cut' })
-- Line operations (VSCode style)
map('n', '<A-Up>', ':m .-2<CR>==', { desc = 'Move line up' })
map('n', '<A-Down>', ':m .+1<CR>==', { desc = 'Move line down' })
map('i', '<A-Up>', '<Esc>:m .-2<CR>==gi', { desc = 'Move line up' })
map('i', '<A-Down>', '<Esc>:m .+1<CR>==gi', { desc = 'Move line down' })
map('v', '<A-Up>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up' })
map('v', '<A-Down>', ":m '>+1<CR>gv=gv", { desc = 'Move selection down' })
-- VSCode-style line operations
map('n', '<S-CR>', 'o<Esc>', { desc = 'Insert line below' })
map('i', '<S-CR>', '<C-o>o', { desc = 'Insert line below' })
-- Quick word operations
map('n', '<C-BS>', 'db', { desc = 'Delete word backward' })
map('i', '<C-BS>', '<C-w>', { desc = 'Delete word backward' })
map('n', '<C-Del>', 'dw', { desc = 'Delete word forward' })
map('i', '<C-Del>', '<C-o>dw', { desc = 'Delete word forward' })
-- Duplicate line
map('n', '<A-S-Up>', 'yykP', { desc = 'Duplicate line up' })
map('n', '<A-S-Down>', 'yyp', { desc = 'Duplicate line down' })
map('v', '<A-S-Up>', "y'<Pgv", { desc = 'Duplicate selection up' })
map('v', '<A-S-Down>', "y'>pgv", { desc = 'Duplicate selection down' })
-- Line manipulation
map('n', '<C-]>', '>>', { desc = 'Indent line' })
map('n', '<C-[>', '<<', { desc = 'Unindent line' })
map('i', '<C-]>', '<C-o>>>', { desc = 'Indent line' })
map('i', '<C-[>', '<C-o><<', { desc = 'Unindent line' })
-- Visual overwrite paste
map({ 'v', 'x' }, 'p', '"_dP', opts)
-- Do not copy on x
map({ 'v', 'x' }, 'x', '"_x', opts)
map('n', 'X', '"_D', opts)
map({ 'v', 'x' }, 'X', '"_d', opts)
-- Increment/decrement
map({ 'n', 'v', 'x' }, '-', '<C-x>', opts)
map({ 'n', 'v', 'x' }, '=', '<C-a>', opts)
-- Move to line beginning and end
map({ 'n', 'v', 'x' }, 'gl', '$', { desc = 'End of line' })
map({ 'n', 'v', 'x' }, 'gh', '^', { desc = 'Beginning of line' })
-- Center Cursors
map('n', 'J', 'mzJ`z', opts)
map('n', '<C-d>', '<C-d>zz', opts)
map('n', '<C-u>', '<C-u>zz', opts)
map('n', 'n', 'nzzzv', opts)
map('n', 'N', 'Nzzzv', opts)
-- Better up/down
map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move text up and down
map({ 'v', 'x' }, 'J', ":move '>+1<cr>gv-gv", opts)
map({ 'v', 'x' }, 'K', ":move '<-2<cr>gv-gv", opts)
-- Clear search, diff update and redraw
map({ 'i', 'n' }, '<esc>', '<cmd>noh<cr><esc>', { desc = 'Escape and clear hlsearch' })
-- Consistent n/N search navigation
map('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
map('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
map('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
map('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
-- Better indenting
map('v', '<', '<gv')
map('v', '>', '>gv')
-- Add undo breakpoints
map('i', ',', ',<c-g>u')
map('i', '.', '.<c-g>u')
map('i', ';', ';<c-g>u')
map('n', 'd', '"_d', { desc = 'Delete without replacing clipboard' })
map('n', 'x', '"_x', { desc = 'Cut without replacing clipboard' })
map('n', 'c', '"_c', { desc = 'Change without replacing clipboard' })
map('v', 'p', '"_dP', { desc = 'Paste without replacing clipboard' })
-- Toggle relative numbers off or on (for code presentation)
map({ 'n', 'v' }, '<leader>tn', '<cmd>set rnu!<cr>', {})
--insert the following characters around the visual selection
map('v', '<leader>(', 's()<esc>Pll', { desc = 'wrap selection with parens' })
map('v', '<leader>[', 's[]<esc>Pll', { desc = 'wrap selection with square braces' })
map('v', '<leader>{', 's{}<esc>Pll', { desc = 'wrap selection with curly braces' })
map('v', "<leader>'", "s''<esc>Pll", { desc = 'wrap selection with single quotes' })
map('v', '<leader>"', 's""<esc>Pll', { desc = 'wrap selection with double quotes' })
+1 -1
View File
@@ -51,7 +51,7 @@ local options = {
undofile = true, -- enable persistent undo
undodir = vim.fn.stdpath('cache') .. '/undo',
undolevels = 10000,
updatetime = 50, -- faster completion (4000ms default)
updatetime = 250, -- balance between responsiveness and performance
wildmenu = true, -- wildmenu
wildmode = 'longest:full,full', -- Command-line completion mode
winminwidth = 5, -- Minimum window width
+2 -2
View File
@@ -32,7 +32,7 @@ avante.setup({
provider = 'copilot-claude-3.5-sonnet',
-- cursor_applying_provider = 'copilot-o3-mini',
-- auto_suggestions_provider = 'copilot-claude-3.7-sonnet',
providers = vim.tbl_extend('force', {
copilot = {
endpoint = 'https://api.githubcopilot.com',
@@ -43,7 +43,7 @@ avante.setup({
},
max_completion_tokens = 1000000,
reasoning_effort = 'high',
},
}
}, generate_providers()),
behaviour = {
+1 -1
View File
@@ -37,4 +37,4 @@ mcphub.setup({
file_path = vim.fn.stdpath('state') .. '/mcphub.log',
prefix = 'MCPHub',
},
})
})
+1 -1
View File
@@ -24,7 +24,7 @@ treesitter.setup({
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local max_filesize = 1000 * 1024 -- 1 MB instead of 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
+10 -3
View File
@@ -12,9 +12,16 @@ local default_setup = function(server)
if server == 'tailwindcss' then
lspconfig[server].setup({
capabilities = capabilities,
filetypes = {
'html', 'css', 'scss', 'javascript', 'javascriptreact',
'typescript', 'typescriptreact', 'vue', 'svelte'
filetypes = {
'html',
'css',
'scss',
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
'vue',
'svelte',
},
init_options = {
userLanguages = {
+18 -1
View File
@@ -169,7 +169,7 @@ local plugins = {
'ravitemer/mcphub.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
cmd = 'MCPHub',
-- build = "npm install -g mcp-hub@latest", -- use this if you want to use the global mcp-hub
-- build = 'npm install -g mcp-hub@latest', -- use this if you want to use the global mcp-hub
build = 'bundled_build.lua',
config = load_config('ai.mcphub'),
},
@@ -235,6 +235,23 @@ local plugins = {
},
},
},
{
'gbprod/substitute.nvim',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local substitute = require('substitute')
substitute.setup()
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set('n', 's', substitute.operator, { desc = 'Substitute with motion' })
keymap.set('n', 'ss', substitute.line, { desc = 'Substitute line' })
keymap.set('n', 'S', substitute.eol, { desc = 'Substitute to end of line' })
keymap.set('x', 's', substitute.visual, { desc = 'Substitute in visual mode' })
end,
},
{
'numToStr/Navigator.nvim',
config = load_config('tools.navigator'),
+11 -10
View File
@@ -1,30 +1,30 @@
{
"LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
"LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"avante.nvim": { "branch": "main", "commit": "1c4e0621995480c7c8644751908fd9ac9cd59e90" },
"avante.nvim": { "branch": "main", "commit": "fdf4716ec04cf5d9f8f39a44b7d42ab37cc2bd40" },
"blink-cmp-avante": { "branch": "master", "commit": "ddefb8de3cb1286ab39e0ccec0f32a45d03391f2" },
"blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" },
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
"ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
"codesnap.nvim": { "branch": "main", "commit": "be6d6b9a3b5e6999edbda76b16dace03d9bfcd3d" },
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
"copilot.lua": { "branch": "master", "commit": "5f726c8e6bbcd7461ee0b870d4e6c8a973b55b64" },
"copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" },
"esqueleto.nvim": { "branch": "main", "commit": "d495d8aecf6d8cc87b8f9b82276cd88393ce014b" },
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitsigns.nvim": { "branch": "main", "commit": "8bdaccdb897945a3c99c1ad8df94db0ddf5c8790" },
"gitsigns.nvim": { "branch": "main", "commit": "731b581428ec6c1ccb451b95190ebbc6d7006db7" },
"hardtime.nvim": { "branch": "main", "commit": "5d9adcbe2f12741de79e435c8b85dca69a3b22e4" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" },
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"markit.nvim": { "branch": "main", "commit": "9b031afab214aa6e6467f275f55640989f438925" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "60eaff7a470b8e78ddff09d847d17a011f560759" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"mcphub.nvim": { "branch": "main", "commit": "ac5c366b9572ece2782d4765f14d69574e715415" },
"mcphub.nvim": { "branch": "main", "commit": "4888f27a2c0122d351a337e7576797f4a63df166" },
"mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" },
"mini.bracketed": { "branch": "main", "commit": "079b8375e40ebf3f8af319ad835263ff390c3965" },
"mini.files": { "branch": "main", "commit": "49c855977e9f4821d1ed8179ed44fe098b93ea2a" },
@@ -33,10 +33,10 @@
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"neotypist.nvim": { "branch": "master", "commit": "23570aedca4bb4d92967ac82e053cf4d4903abe9" },
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" },
"nvim-dbee": { "branch": "master", "commit": "9656fc59841291e9dbd2f3b50b1cb4c77d9fea79" },
"nvim-lspconfig": { "branch": "master", "commit": "4315a9686f4d21a521d89a693e02947d1e119f5d" },
"nvim-lspconfig": { "branch": "master", "commit": "583a1d555c8e407868ce00c57e37eca4b7ff960e" },
"nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" },
"nvim-spider": { "branch": "main", "commit": "99df646eab60df0b948dd2532ef5f5512707a9a4" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
@@ -50,9 +50,10 @@
"pickme.nvim": { "branch": "main", "commit": "70e8c040a6c01b34a6a7e05aff6ebb241211fc6d" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" },
"smear-cursor.nvim": { "branch": "main", "commit": "162703638203060b1d3412e73429d232bbd2627e" },
"smear-cursor.nvim": { "branch": "main", "commit": "aff844fc1483fd673f721a41affcd7e2fcb885f5" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"sniprun": { "branch": "master", "commit": "a90c65846c3c18efc3f799d8b6dc26af9d4a69ed" },
"substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" },
"termim.nvim": { "branch": "main", "commit": "6bb3f8fb5a3c64ca614d7c4782d4965863c41675" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"utils.nvim": { "branch": "main", "commit": "0e545d194b8eab9870da8e3cdc728fbcfa6a5a19" },
+2 -2
View File
@@ -59,7 +59,7 @@ Snacks.setup({
bigfile = {
enabled = true,
notify = true,
size = 100 * 1024, -- 100 KB
size = 1000 * 1024, -- 1 MB instead of 100 KB
},
bufdelete = { enabled = true },
dashboard = {
@@ -288,7 +288,7 @@ Snacks.setup({
},
scroll = { enabled = false },
statuscolumn = {
enabled = true,
enabled = false, -- Change this to false
left = { 'mark', 'sign' },
right = { 'fold', 'git' },
folds = {
+2 -2
View File
@@ -434,8 +434,8 @@ local no_leader_mappings = {
{ '<S-h>', ':bprevious<cr>', desc = 'Previous Buffer' },
{ '<S-l>', ':bnext<cr>', desc = 'Next Buffer' },
{ '<Tab>', ':bprevious<cr>', desc = 'Previous Buffer' },
{ '<S-Tab>', ':bnext<cr>', desc = 'Next Buffer' },
{ '<Tab>', ':bnext<cr>', desc = 'Next Buffer' },
{ '<S-Tab>', ':bprevious<cr>', desc = 'Previous Buffer' },
{ 'K', ':Lspsaga hover_doc<cr>', desc = 'LSP Hover' },
{ 'Q', ':qall!<cr>', desc = 'Force Quit!' },