From 916c3c057a0a48ba2f39c8951274821b8d6c988a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 23 Apr 2023 15:35:24 +0200 Subject: ported nvim config to vimrc --- config/old/vim/.vimrc | 78 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 10 deletions(-) (limited to 'config/old/vim') diff --git a/config/old/vim/.vimrc b/config/old/vim/.vimrc index 03aebfe..768cff3 100644 --- a/config/old/vim/.vimrc +++ b/config/old/vim/.vimrc @@ -8,9 +8,8 @@ set runtimepath+=~/.config/vim,~/.config/vim/after set viminfo+=n~/.config/vim/viminfo " Plugins " s;https://github.com/\(.*\);Plug '\1'; -call plug#begin('~/.vim/plugged') +call plug#begin('~/.config/vim/plugged') Plug 'LordTlasT/live-server' -Plug 'tpope/vim-endwise' Plug 'airblade/vim-gitgutter' Plug 'arcticicestudio/nord-vim' Plug 'godlygeek/tabular' @@ -19,11 +18,13 @@ Plug 'junegunn/fzf.vim' Plug 'michaeljsmith/vim-indent-object' Plug 'tpope/vim-capslock' Plug 'tpope/vim-commentary' +Plug 'tpope/vim-endwise' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'tpope/vim-vinegar' Plug 'yuezk/vim-js' +Plug 'theRealCarneiro/hyprland-vim-syntax' call plug#end() set termguicolors " amazing! @@ -60,11 +61,7 @@ let &t_EI = "\e[2 q" " Normal cursor let ghregex='\(^\|\s\s\)\zs\.\S\+' " Start netrw with dotfiles hidden let g:netrw_list_hide=ghregex -let g:indentLine_fileTypeExclude = ['dashboard'] " No indentline on dashboard - """"""""""""""""""" FUNCTIONS AND COMMANDS -" Force quit faster -command Q execute 'quit!' " autocomment z80 autocmd FileType z80 setlocal commentstring=;\ %s @@ -75,10 +72,11 @@ autocmd BufReadPost * \ exe "normal! g`\"" | \ endif -augroup nvim_term - autocmd! - autocmd TermOpen * startinsert - autocmd TermOpen * :setlocal nonumber norelativenumber signcolumn=no +" Absolute numbers if window isn't focused +augroup numbertoggle + autocmd! + autocmd BufEnter,FocusGained,WinEnter * if &nu | set rnu | endif + autocmd BufLeave,FocusLost,WinLeave * if &nu | set nornu | endif augroup END " Toggle status bar @@ -115,3 +113,63 @@ inoremap { {} " goto buffer nnoremap gb :buffers:buffer + +let mapleader = " " +let maplocalleader = "\\" + +" -- vinegar is already doing this +nnoremap - Ex + +" moving +inoremap I +inoremap A +inoremap D + +inoremap ( ()O +inoremap (; ();O +inoremap { {}O +inoremap {; {};O + +" buffers +nnoremap gb buffers:buffer +nnoremap q q! +nnoremap Q qa! + +" Windows +nnoremap h +nnoremap j +nnoremap k +nnoremap l +nnoremap o +" command line +cnoremap +cnoremap +cnoremap + +" clipboard +nnoremap y \ + +" templates +nnoremap rt :-1r + +" utils +inoremap r r!echo -n $RANDOMkJA +" ordered list +nnoremap n I0. gvg +vnoremap u '<,'>s/^[0-9]\\+\\. // +" scripts +nnoremap x !chmod +x % +" replace +nnoremap sf [[:%s/\<\>//gI]] +nnoremap sl [[:s/\<\>//gI]] + +" write +nnoremap w write +nnoremap W write! +nnoremap e edit + +" Packer +nnoremap P PackerSync + +" spelling +nnoremap setlocal spell! -- cgit v1.2.3