From 97d14386672a38ebf04ad80436d14785a7b3f708 Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Fri, 20 Jun 2025 17:09:57 +0400 Subject: refactor (vim): consistent with nvim config --- config/vim/vimrc | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'config/vim/vimrc') diff --git a/config/vim/vimrc b/config/vim/vimrc index 7c66eef..a7d1c0c 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -1,15 +1,16 @@ -" Suleyman's minimal vim config for servers -" at https://git.farajli.net/slcf - let mapleader = " " +set background=dark +set clipboard=unnamedplus " Use system clipboard +" set list " Show spaces, tabs, etc. set number -set scrolloff=5 " Smooth scroll -set clipboard=unnamedplus " Use system clipboard -set shortmess+=I " Deactivate intro text -set fillchars=eob:\ " Remove "~" for empty lines (`eob:\` must end with a trailing space) -:set nowrap " Disable wrapping -autocmd BufwritePost * %s/\s\+$//e " Remove useless trailing spaces when saving -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Disable autocomments +set relativenumber +set shortmess+=I " Deactivate intro text +set nowrap " Disable wrapping +set fillchars=eob:\ " Remove "~" for empty lines (`eob:\` must end with a trailing space) + +autocmd BufwritePost * %s/\s\+$//e " Remove trailing spaces when saving +" Disable autocomments +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Different cursor shapes for insert and normal modes let &t_SI = "\e[6 q" @@ -18,19 +19,26 @@ set ttimeout set ttimeoutlen=1 set ttyfast -" Normal mode maps -map :w! -map q :wqa! -map :tabnew -map :tabclose! -map J :tabn -map K :tabp +" Tabs +nnoremap :tabnew +nnoremap J :tabn +nnoremap K :tabp -" Insert mode maps +" Windows +nnoremap :split +nnoremap :vsplit +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" Imitate normal mode in insert mode inoremap +inoremap +inoremap inoremap -inoremap gj -inoremap gk -inoremap o +inoremap -set background=dark +" Other +nnoremap :w! +nnoremap q :wqa! -- cgit v1.2.3