Skip to content

Commit

Permalink
.vimrc - set splits to be natural & fix window movements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Novikov authored and Mikhail Novikov committed Apr 21, 2020
1 parent 74b2815 commit 7cf7403
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ set relativenumber " Display relative line numbers
set ruler " Display cursor position
set wrap " Wrap lines when they are too long
set noequalalways " When closing a window the extra lines are given to the window next to it
set splitbelow " Splitting feels more natural
set splitright " Splitting feels more natural

set scrolloff=1 " Display at least 1 line around you cursor (for scrolling)

Expand Down Expand Up @@ -186,15 +188,15 @@ if has('nvim')
endif

" Easy windows switching with leader key
nmap <leader>h :wincmd h<CR>
nmap <leader>j :wincmd j<CR>
nmap <leader>k :wincmd k<CR>
nmap <leader>l :wincmd l<CR>
nmap <c-h> :wincmd h<CR>
nmap <c-j> :wincmd j<CR>
nmap <c-k> :wincmd k<CR>
nmap <c-l> :wincmd l<CR>
if has('nvim')
tnoremap <leader>h <c-\><c-n><c-w>h
tnoremap <leader>j <c-\><c-n><c-w>j
tnoremap <leader>k <c-\><c-n><c-w>k
tnoremap <leader>l <c-\><c-n><c-w>l
tnoremap <c-h> <c-\><c-n><c-w>h
tnoremap <c-j> <c-\><c-n><c-w>j
tnoremap <c-k> <c-\><c-n><c-w>k
tnoremap <c-l> <c-\><c-n><c-w>l
endif

" Maps to resizing a window split
Expand Down

0 comments on commit 7cf7403

Please sign in to comment.