-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
148 lines (101 loc) · 2.95 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
set nocompatible
filetype off
let mapleader = "\<Space>"
" \\\ EASY VIMRC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
" opens vimrc
nnoremap <silent> <leader>ev :e $MYVIMRC<cr>
filetype plugin indent on
syntax enable
" \\\ ETC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
" i love fast redraws
set ttyfast
" smaller timeout to remove lag from airline when leaving insert mode
set ttimeoutlen=50
" syntax highlight by default
syntax on
" allows unsaved buffers
set hidden
" shows line numbers
set number
" required for powerline fonts symbols
set encoding=utf-8
" search immediately
set incsearch
" highlight search
set hlsearch
" toggling
nnoremap <leader>h :set hlsearch!<cr>
" i want my backspace back!
set backspace=indent,eol,start
" use tabs instead of spaces
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
set listchars=tab:¦\ ,trail:•,extends:»,precedes:«
" i want to see the whitespace, sometimes
nnoremap <leader>w :set list!<cr>
" centralize backups, swapfiles and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
if exists("&undodir")
set undodir=~/.vim/undo
endif
" remember more commands
set history=1000
" use more levels of undo
set undolevels=1000
" start scrolling the horizontal window border
set scrolloff=8
" opens new horizontal split to the bottom
set splitbelow
" opens new vertical split windows to the right
set splitright
" do not inc/dec octal numbers as it can lead to errors
set nrformats-=octal
" do not want to miss the changes
set autoread
" turns off physical line wrapping (ie: automatic insertion of newlines)
set nowrap
set textwidth=0 wrapmargin=0
set clipboard+=unnamed,unnamedplus
" visual autocomplete for commands
set wildmenu
" \\\ KEYMAPS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
nnoremap <left> :bprev<cr>
nnoremap <right> :bnext<cr>
nnoremap <up> :tabnext<cr>
nnoremap <down> :tabprev<cr>
" use ctrl-[hjkl] to select the active split
nnoremap <silent> <C-k> :wincmd k<cr>
nnoremap <silent> <C-j> :wincmd j<cr>
nnoremap <silent> <C-h> :wincmd h<cr>
nnoremap <silent> <C-l> :wincmd l<cr>
" for pasting in a lot of text
nnoremap <leader>p :set paste!<cr>
" too lazy to enter-leave insert mode, but i love inner and outer space :o
nnoremap <leader><space> a<space><esc>
" reselects a just-pasted text
nnoremap <leader>v V`]
" allows to save quickly
nnoremap <leader>s :w<cr>
" i want this things to center
nnoremap G Gzz
nnoremap n nzz
nnoremap N Nzz
nnoremap } }zz
nnoremap { {zz
nnoremap * *zz
nnoremap <leader>z zA
" \\\ GUI \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if has("gui_running")
" hides menus, toolbars, widgets and use console dialog promts
set guioptions=c
endif
" \\\ AUTOCMD \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if has("autocmd")
augroup vimrc
autocmd!
" sources vimrc for short interactions ;)
autocmd BufWritePost _vimrc,.vimrc,.gvimrc so $MYVIMRC
augroup end
endif
" \\\ THEME \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
set background=dark