-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
189 lines (121 loc) · 3.04 KB
/
vimrc
File metadata and controls
189 lines (121 loc) · 3.04 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
" Plugin settings ------{{{
" ALE
let g:ale_virtualtext_cursor = 0
let g:ale_linters_explicit = 1
" ayu-vim
let g:ayucolor = "mirage"
" gruvbox
let gruvbox_italic = 1
" nerdtree
let NERDTreeAutoDeleteBuffer = 1
let NERDTreeShowHidden=1
" vim-airline
let g:airline_powerline_fonts = 1
"}}}
" Generic settings ------{{{
" Enable loading plugins for specific filetype
filetype plugin on
" Use system clipboard (+clipboard needed)
set clipboard=unnamedplus
" Reload file when modified outside of vim
set autoread
" Encoding
set encoding=utf-8
" Don't wrap lines
set nowrap
" Make search recursive
set path+=**
" Enable enhanced command line completion
set wildmenu
" Completion mode
set wildmode=longest:full,full
" Don't create swapfile
set noswapfile
" Don't create viminfo
set viminfo=""
"}}}
" Indentation ------{{{
" Load indent by filetype
filetype indent on
" Copy indent from current line when starting a new one
set autoindent
" Tab size
set tabstop=2
" Tab size when performing editing operations
set softtabstop=2
" Use spaces instead of tabs
set expandtab
" Indentation size in normal mode when using >>, <<, cindent
set shiftwidth=2
" Round indent to multiple of shiftwidth when using > or < commands
set shiftround
"}}}
" Text search and highlight ------{{{
" Hilight search
set hlsearch
" Ignore case when searching
set ignorecase
" Search in case-sensitive mode if search contains uppercase characters
set smartcase
" Show matches while typing
set incsearch
"}}}
" User interface ------{{{
" Set colorscheme
colorscheme monokai_pro
" Background is dark
set background=dark
" Open folds by default
set foldlevel=99
" Show invisible characters
set list listchars=trail:·,tab:▸\
" Enable use of the mouse
set mouse=a
" Show line numbers
set number
" Show line and column number of the cursor position
set ruler
" Show command in the last line of the screen
set showcmd
" Create horizontal split below
set splitbelow
" Create vertical split right
set splitright
" Use 24-bit colors in the terminal
set termguicolors
" Set the title of the window to the value of filename
set title
" Enable syntax highlighting
syntax on
" Highlight current line
set cursorline
"}}}
" Keymappings ------{{{
" F2 switch to paste mode
set pastetoggle=<F2>
" CTRL+a to unhilight everything
nnoremap <C-a> :noh<CR>
" Shortcuts for splits navigation
nnoremap <C-h> <C-W>h
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
nnoremap <C-l> <C-W>l
" Toggle fold under cursor using spacebar
nnoremap <Space> za
" Re-select text after moving it
vnoremap < <gv
vnoremap > >gv
" Shortcuts to explicitly copy/paste to/from system clipboard
if has('clipboard')
vnoremap <leader>y "+y
vnoremap <leader>p "+p
endif
"}}}
" Autocommands ------{{{
" Automatically switch to file directory
autocmd BufEnter * silent! lcd %:p:h
" Set filetype of yaml files in 'playbooks' directory to yaml.ansible
autocmd BufRead,BufNewFile */playbooks/*.yml,*/playbooks/*.yaml set filetype=yaml.ansible
" Trigger autoread when changing buffers
autocmd FocusGained,BufEnter * checktime
"}}}