From 3c63a9b9075a652ba57c20ca21437aa224367037 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 30 Nov 2024 15:26:53 +0100 Subject: Update config to use vim-lazy for handling plugins. --- init.vim | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 3 deletions(-) (limited to 'init.vim') diff --git a/init.vim b/init.vim index 5ea900f..0a15751 100644 --- a/init.vim +++ b/init.vim @@ -1,6 +1,80 @@ -set runtimepath^=~/.vim runtimepath+=~/.vim.after -let &packpath = &runtimepath -source ~/.vimrc +" Vset runtimepath^=~/.vim runtimepath+=~/.vim.after +" let &packpath = &runtimepath +" source ~/.vimrc +filetype on +syntax on +colorscheme default +set number +filetype indent on +set nowrap +set tabstop=2 +set shiftwidth=2 +set expandtab +set smartindent +set autoindent +set guioptions-=T + +" highlight cursor line +set cursorline + +" highlight search matches +set hlsearch + +" show matching parenthesis/brackets +set showmatch + +" remove whitespace on write +autocmd BufWritePre * :%s/\s\+$//e + +" press esc to cancel search +noremap :nohlsearch:echo + +" Arrow keys move visually up/down. +noremap gk +noremap gj + +nnoremap :Neotree toggle reveal_force_cwd +" nnoremap | :Neotree reveal +" nnoremap gd :Neotree float reveal_file= reveal_force_cwd +" nnoremap b :Neotree toggle show buffers right +nnoremap s :Neotree float git_status + +" Toggle word-wrap mode +" This will also fix movement keys so they move by visual +" lines instead of physical lines in word-wrap mode. +" See https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping +noremap w :call ToggleWrap() +function ToggleWrap() + if &wrap + echo "Wrap OFF" + setlocal nowrap + set virtualedit=all + silent! nunmap + silent! nunmap + silent! nunmap + silent! nunmap + silent! iunmap + silent! iunmap + silent! iunmap + silent! iunmap + else + echo "Wrap ON" + setlocal wrap linebreak nolist + set virtualedit= + setlocal display+=lastline + noremap gk + noremap gj + noremap g + noremap g + inoremap gk + inoremap gj + inoremap g + inoremap g + endif +endfunction + +lua require('config.lazy') lua require('basic') lua require('debugging') + -- cgit v1.2.3