diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-11-30 15:26:53 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-11-30 15:26:53 +0100 |
commit | 3c63a9b9075a652ba57c20ca21437aa224367037 (patch) | |
tree | ff44b42400a470fb1af69c1956555f1c0ed46b1a /init.vim | |
parent | 0feb1c2bf8c62ba02834340bf1052e8fcafd531a (diff) | |
download | nvimrc-3c63a9b9075a652ba57c20ca21437aa224367037.tar.gz nvimrc-3c63a9b9075a652ba57c20ca21437aa224367037.tar.bz2 nvimrc-3c63a9b9075a652ba57c20ca21437aa224367037.zip |
Update config to use vim-lazy for handling plugins.
Diffstat (limited to 'init.vim')
-rw-r--r-- | init.vim | 80 |
1 files changed, 77 insertions, 3 deletions
@@ -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 <silent> <Esc> :nohlsearch<Bar>:echo<CR> + +" Arrow keys move visually up/down. +noremap <up> gk +noremap <down> gj + +nnoremap <c-o> :Neotree toggle reveal_force_cwd<cr> +" nnoremap | :Neotree reveal<cr> +" nnoremap gd :Neotree float reveal_file=<cfile> reveal_force_cwd<cr> +" nnoremap <leader>b :Neotree toggle show buffers right<cr> +nnoremap <leader>s :Neotree float git_status<cr> + +" 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 <silent> <leader>w :call ToggleWrap()<CR> +function ToggleWrap() + if &wrap + echo "Wrap OFF" + setlocal nowrap + set virtualedit=all + silent! nunmap <buffer> <Up> + silent! nunmap <buffer> <Down> + silent! nunmap <buffer> <Home> + silent! nunmap <buffer> <End> + silent! iunmap <buffer> <Up> + silent! iunmap <buffer> <Down> + silent! iunmap <buffer> <Home> + silent! iunmap <buffer> <End> + else + echo "Wrap ON" + setlocal wrap linebreak nolist + set virtualedit= + setlocal display+=lastline + noremap <buffer> <silent> <Up> gk + noremap <buffer> <silent> <Down> gj + noremap <buffer> <silent> <Home> g<Home> + noremap <buffer> <silent> <End> g<End> + inoremap <buffer> <silent> <Up> <C-o>gk + inoremap <buffer> <silent> <Down> <C-o>gj + inoremap <buffer> <silent> <Home> <C-o>g<Home> + inoremap <buffer> <silent> <End> <C-o>g<End> + endif +endfunction + +lua require('config.lazy') lua require('basic') lua require('debugging') + |