This repository has been archived on 2021-12-24. You can view files and clone it, but cannot push or open issues/pull-requests.
self-hosting/vim/init.vim

48 lines
1.2 KiB
VimL
Raw Permalink Normal View History

2021-01-26 16:40:58 +01:00
let g:mapleader = ' '
set splitbelow splitright
set expandtab tabstop=4 shiftwidth=4
set incsearch smartcase nohlsearch
set swapfile directory=~/.vim/swap//
set undofile undodir=~/.vim/undo//
nnoremap j jzz
nnoremap k kzz
nnoremap gg ggzz
nnoremap G Gzz
nnoremap <silent> <leader>h :wincmd h<CR>
nnoremap <silent> <leader>j :wincmd j<CR>
nnoremap <silent> <leader>k :wincmd k<CR>
nnoremap <silent> <leader>l :wincmd l<CR>
nnoremap <silent> <Up> :resize +3<CR>
nnoremap <silent> <Down> :resize -3<CR>
nnoremap <silent> <Right> :vertical resize +3<CR>
nnoremap <silent> <Left> :vertical resize -3<CR>
inoremap jk <Esc>
inoremap <Esc> <nop>
nnoremap <leader>a <C-^>
tnoremap <silent> jk <C-\><C-n>
nnoremap <silent> <leader>rr :terminal<CR>
nnoremap <silent> <leader>rh :vsp<CR>:wincmd h<CR>:term<CR>
nnoremap <silent> <leader>rl :vsp<CR>:term<CR>
nnoremap <silent> <leader>rk :sp<CR>:wincmd k<CR>:term<CR>
nnoremap <silent> <leader>rj :sp<CR>:term<CR>
function! ToggleLineNumbers()
if &number
set nonumber
set norelativenumber
else
set number
set relativenumber
endif
endfunction
nnoremap <silent> <leader>L :call ToggleLineNumbers()<CR>