-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
149 lines (110 loc) · 3.3 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
149
" load plugins according to detected filetype
filetype plugin indent on
" syntax highlighting on
syntax on
" Only highlight the first n columns (done for performance reasons)
set synmaxcol=200
" stop trying to be compatible with vi
set nocompatible
" disable modelines because of a security vuln
set modelines=0
" how wide a tab is
set tabstop=4
" number of spaces to use for shiftwidth (<< or >>) operator
set shiftwidth=4
" indents to next multiple of shiftwidth
set shiftround
" number of spaces that a tab counts for while performing
" an editing operation, like inserting a tab or backspace
set softtabstop=4
" insert spaces when tab is pressed
set expandtab
set encoding=utf-8
" lines to keep above or below the cursor in window
set scrolloff=3
" when inserting a new line, copy indent from previous line
set autoindent
" If in Insert, Replace or Visual mode put a message on the last line.
set showmode
" Show (partial) command in the last line of the screen.
set showcmd
" abandoned buffers become hidden instead of unloaded, allows to switch
" between buffers without saving first.
set hidden
set wildmenu
set wildmode=list:longest
" Use visual bell instead of beeping.
set visualbell
" highlight the line with the cursor
set cursorline
" let vim know we have a fast tty
"set ttyfast
" only redraw when necessary
"set lazyredraw
" Show the line and column number of the cursor position
set ruler
" To allow backspacing over everything in insert mode
" (including automatically inserted indentation, line breaks and start of insert)
set backspace=indent,eol,start
" last window always has a status line
set laststatus=2
" show as much as possible of the last line
set display=lastline
" enable relative line numbers
set relativenumber
" also show current line number
set number
" track undo information in files located in undodir
set undofile
" make vim use 'very magic' mode by default when searching
" see :h /magic
nnoremap / /\v
vnoremap / /\v
" If the 'ignorecase' option is on, the case of normal letters is ignored.
set ignorecase
" Override the 'ignorecase' option if the search pattern contains uppercase characters.
set smartcase
" replace all occurrences in line by default
set gdefault
" better searching
set incsearch
set showmatch
set hlsearch
let mapleader=" "
" make it easier to get to command mode
nnoremap ; :
" turn off highlighting via key combo
nnoremap <leader>cs :nohlsearch<cr>
nnoremap <leader>h :helpgrep<space>
" easier way to tab between brackets
nnoremap <tab> %
vnoremap <tab> %
" handle long lines correctly
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=85
" searches wrap around end of file
set wrapscan
" open new windows below current window
set splitbelow
" open new windows to the right of the current window
set splitright
" always report changed lines
set report=0
" save on focus lost
au FocusLost * :wa
" yank and paste from system clipboard by default
set clipboard^=unnamed,unnamedplus
" Show non-printable characters.
set list
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