-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
96 lines (81 loc) · 2.41 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
" VIM Settings
set noerrorbells
set nocompatible
" settings
" turn hybrid line numbers on
set number relativenumber
" relative numbers
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
set shiftwidth=4 " four spaces per indent
set tabstop=4 " number of spaces per tab in display
set softtabstop=4 " number of spaces per tab when inserting
set expandtab " substitute spaces for tabs
set autoindent " carry indent over to new lines
set modelines=0
set backspace=indent,eol,start " Makes backspace key more powerful.
set showcmd " Show me what I'm typing
set showmode " Show current mode.
set showmatch " Show me the matching delimiter
set splitright " Split vertical windows right to the current windows
set splitbelow " Split horizontal windows below to the current windows
set encoding=utf-8 " Set default encoding to UTF-8
set autowrite " Automatically save before :next, :make etc.
set autoread " Automatically reread changed files without asking me anything
set ttyfast
set hidden
" Make it obvious where 80 characters is
" set textwidth=80
set colorcolumn=81
" Search settings
if has("extra_search")
" Highlight searches [use :noh to clear]
set hlsearch
" Highlight dynamically as pattern is typed
set incsearch
" Ignore case of searches...
set ignorecase
" ...unless has mixed case
set smartcase
endif
" PLUGINS
filetype off
filetype indent plugin on
" set color scheme to one dark
syntax on
set t_Co=256
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" Disable arrow keys
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
" I bind Ctrl+HJKL to arrow keys, so map arrow keys for Vim Tmux Navigator.
nmap <Up> <C-k>
nmap <Down> <C-j>
nmap <Left> <C-h>
nmap <Right> <C-l>
" Avoid mistyping write/quit
command WQ wq
command Wq wq
command W w
command Q q
" Buffer shortcuts
nmap gn :bn<cr>
nmap gp :bp<cr>
nmap gb :b#<cr>
nmap gq :bp <BAR> bd #<CR>
" Move to next displayed line instead of actual line
nnoremap j gj
nnoremap k gk
" Local config
if filereadable($HOME . "/.vim/vimrc_local")
source ~/.vim/vimrc_local
endif