From a249ffe37d8883add72caec7c2cfa62f536f52d6 Mon Sep 17 00:00:00 2001 From: Serguey Parkhomovsky Date: Fri, 27 Mar 2026 21:43:52 -0700 Subject: more tiny fixes --- vim/.vimrc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index 8b964e0..beba357 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,6 +1,8 @@ " ~/.vimrc — Vim 9 configuration " Requires: vim-plug, rust-analyzer in PATH, fzf binary +let mapleader = ' ' + " ── Bootstrap vim-plug ──────────────────────────────────────────────────────── let s:plug_path = expand('~/.vim/autoload/plug.vim') if !filereadable(s:plug_path) @@ -32,6 +34,7 @@ set hidden set tabstop=4 set shiftwidth=4 +set softtabstop=4 set expandtab set ignorecase @@ -61,9 +64,6 @@ let g:tokyonight_style = 'night' colorscheme tokyonight " ── LSP (yegappan/lsp) ──────────────────────────────────────────────────────── -" g:LspOnSetup is called by the User LspSetup autocmd below. -" Variables must be defined and consumed inside the same function call — -" they cannot be captured by an inner autocmd in a def function. def g:LspOnSetup() var lspServers = [ { @@ -73,29 +73,29 @@ def g:LspOnSetup() syncInit: true, } ] - g:LspAddServer(lspServers) enddef -autocmd User LspSetup call g:LspOnSetup() - -" LSP keymaps (only when LSP is active) -autocmd FileType rust { - nnoremap gd LspGotoDefinition - nnoremap gD LspGotoDeclaration - nnoremap gi LspGotoImpl - nnoremap gr LspShowReferences - nnoremap gy LspGotoTypeDef - nnoremap K LspHover - nnoremap r LspRename - nnoremap a LspCodeAction - nnoremap f LspFormat - nnoremap d LspDiagShow - nnoremap [d LspDiagPrev - nnoremap ]d LspDiagNext - nnoremap o LspOutline - nnoremap i LspInlayHints toggle -} +augroup MyLsp + autocmd! + autocmd User LspSetup call g:LspOnSetup() + autocmd FileType rust { + nnoremap gd LspGotoDefinition + nnoremap gD LspGotoDeclaration + nnoremap gi LspGotoImpl + nnoremap gr LspShowReferences + nnoremap gy LspGotoTypeDef + nnoremap K LspHover + nnoremap lr LspRename + nnoremap la LspCodeAction + nnoremap lf LspFormat + nnoremap ld LspDiagShow + nnoremap [d LspDiagPrev + nnoremap ]d LspDiagNext + nnoremap lo LspOutline + nnoremap li LspInlayHints toggle + } +augroup END " ── Search ──────────────────────────────────────────────────────────────────── nnoremap nohlsearch -- cgit v1.2.3