.vimrc 2.76 KB
Newer Older
1
" basic stuff
Franciszek Madej's avatar
Franciszek Madej committed
2
set number
Franciszek Madej's avatar
Franciszek Madej committed
3 4 5 6
set relativenumber
filetype plugin indent on          " Load plugins according to detected filetype.
syntax on                          " Enable syntax highlighting.
set encoding    =utf-8             " https://xkcd.com/927/
Franciszek Madej's avatar
Franciszek Madej committed
7

Franciszek Madej's avatar
Franciszek Madej committed
8 9 10 11 12 13 14
set autoindent                     " Indent according to previous line.
set expandtab                      " Use spaces instead of tabs.
set tabstop     =4                 " Tab key indents by 4 spaces.
set shiftwidth  =0                 " >> indents by tabstop spaces.
set softtabstop =-1                " >> indents by softtabstop spaces.
set shiftround                     " >> indents to next multiple of 'shiftwidth'.
set textwidth   =79                " https://www.youtube.com/watch?v=4fndeDfaWCg
15
" set signcolumn  =yes               " Better UX for linters
Franciszek Madej's avatar
Franciszek Madej committed
16
set fileformat  =unix              " Obviously
Franciszek Madej's avatar
Franciszek Madej committed
17

Franciszek Madej's avatar
Franciszek Madej committed
18 19 20 21
set backspace   =indent,eol,start  " Make backspace work as you would expect.
set hidden                         " Switch between buffers without having to save first.
set laststatus  =2                 " Always show statusline.
set display     =lastline          " Show as much as possible of the last line.
Franciszek Madej's avatar
Franciszek Madej committed
22

Franciszek Madej's avatar
Franciszek Madej committed
23 24
set showmode                       " Show current mode in command-line.
set showcmd                        " Show already typed keys when more are expected.
Franciszek Madej's avatar
Franciszek Madej committed
25

Franciszek Madej's avatar
Franciszek Madej committed
26 27 28
set incsearch                      " Highlight while searching with / or ?.
set hlsearch                       " Keep matches highlighted.
set number relativenumber          " Line numbers
Franciszek Madej's avatar
Franciszek Madej committed
29

Franciszek Madej's avatar
Franciszek Madej committed
30 31
set ttyfast                        " Faster redrawing.
set lazyredraw                     " Only redraw when necessary.
32

Franciszek Madej's avatar
Franciszek Madej committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
set splitbelow                     " Open new windows below the current window.
set splitright                     " Open new windows right of the current window.

set cursorline                     " Find the current line quickly.
set wrapscan                       " Searches wrap around end-of-file.
set report      =0                 " Always report changed lines.
set synmaxcol   =200               " Only highlight the first 200 columns.

set list                           " Show non-printable characters.
if has('multi_byte') && &encoding ==# 'utf-8'
    let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±'
else
    let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.'
endif

" The fish shell is not very compatible to other shells and unexpectedly
" breaks things that use 'shell'.
if &shell =~# 'fish$'
    set shell=/bin/bash
endif

"" Disable arrows
map <right> <nop> " normal, visual, operation-pending
map <down> <nop>
map <left> <nop>
map <up> <nop>
imap <right> <nop>  " insert mode
imap <down> <nop>
imap <left> <nop>
imap <up> <nop>

"" Split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>