This repository was archived by the owner on Nov 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
239 lines (194 loc) · 7.35 KB
/
init.vim
File metadata and controls
239 lines (194 loc) · 7.35 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
"
" neovim config
"
" ---------------------------------------------------------------------------
" CONTENTS
" ---------------------------------------------------------------------------
" 1. Vim Compatability Settings
" 2. Vim-Plug Config
" 3. General Configuration
" 4. Filetype Specific
" 5. Custom Functions
" 6. Plugin Settings
" ---------------------------------------------------------------------------
" +=========================================================================+
" | 1. VIM COMPATABILITY SETTINGS |
" +=========================================================================+
" Automatically set in neovim:
"set nocompatible " VIM instead of vi settings
"set backspace=indent,eol,start " Make backspace delete over anything
" +=========================================================================+
" | 2. VIM-PLUG CONFIG |
" +=========================================================================+
" Automatic install of vim-plug
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Specify directory for plugins
call plug#begin('~/.local/share/nvim/plugged')
" Github Plugins
" ==========================================================================
" Solarized
"Plug 'altercation/vim-colors-solarized'
" NeoSolarized
Plug 'iCyMind/NeoSolarized'
" Vim Tmux Navigator
Plug 'christoomey/vim-tmux-navigator'
" Tabular
"Plug 'godlygeek/tabular'
" Vim Markdown
Plug 'gabrielelana/vim-markdown'
" Thesaurus
Plug 'beloglazov/vim-online-thesaurus'
" Initialize plugin system
call plug#end()
" +=========================================================================+
" | 3. GENERAL CONFIGURATION |
" +=========================================================================+
" Colors
" ==========================================================================
set termguicolors
set background=dark
colorscheme NeoSolarized " NeoSolarized colorscheme
" File Management
" ==========================================================================
set noundofile
set nobackup
set noswapfile
" Tabs
" ==========================================================================
"set autoindent " Automatic in neovim
set smartindent
"set smarttab " Automatic in neovim
set shiftwidth=4
set softtabstop=4
set expandtab
set tabstop=4
set shiftround
" General Display
" ==========================================================================
set number
set relativenumber
"set ruler " Neovim default
set cmdheight=2
set hlsearch
set showmode
"set showcmd " Neovim default
"set wildmenu " Neovim default
set wildignorecase
set showtabline=2
set hidden
set ignorecase
set smartcase
set splitbelow
set splitright
set linebreak
" Cursor Display
" ==========================================================================
" mode-list:argument-list
" ^ dash-separated lists
" n - normal
" v - visual
" i - insert
" r - replace
"
" horN - horizontal bar, N% height
" verN - vertical bar, N% width
" block - block cursor, filled
"
" blinkwaitN delay before cursor starts blinking
" blinkonN time cursor is shown
" blinkoffN time cursor is hidden
"
" group-name highlight group name that sets color
set guicursor=n-v-sm:block-blinkon0
set guicursor+=i-ci:ver25-blinkwait400-blinkoff600-blinkon600
set guicursor+=r-cr-o-c:block-blinkwait400-blinkoff600-blinkon600
" Keymappings
" ==========================================================================
nmap <leader><Tab> :set expandtab!<CR>:set expandtab?<CR>
nmap <leader>v :tabedit $MYVIMRC<CR>
nmap <leader>l :set list!<CR>
nmap <leader>b :buffers<CR>:buffer<Space>
nmap <leader>t :tabnew<CR>
nmap <silent> <leader>bd :bp\|bd #<CR>
nnoremap <leader><space> :noh<cr>
nmap <leader>w :w<CR>
nmap <leader>q :q<CR>
nnoremap <silent> <M-h> :tabprevious<CR>
nnoremap <silent> <M-l> :tabnext<CR>
nnoremap <silent> <M-j> :bn<CR>
nnoremap <silent> <M-k> :bp<CR>
nmap <leader>sl :rightbelow vnew<CR>
nmap <leader>sj :rightbelow new<CR>
set timeout timeoutlen=1500 ttimeoutlen=100
" +=========================================================================+
" | 4. FILETYPE SPECIFIC |
" +=========================================================================+
" HTML
" ==========================================================================
au FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
" CSS
" ==========================================================================
au FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2
" +=========================================================================+
" | 5. CUSTOM FUNCTIONS |
" +=========================================================================+
" Keep tabs consistent. See: http://vimcasts.org/episodes/tabs-and-spaces/
" ==========================================================================
command! -nargs=* Stab call Stab()
function! Stab()
let l:tabstop = 1 * input('set tabstop = softtabstop = shiftwidth = ')
if l:tabstop > 0
let &l:sts = l:tabstop
let &l:ts = l:tabstop
let &l:sw = l:tabstop
endif
call SummarizeTabs()
endfunction
function! SummarizeTabs()
try
echohl ModeMsg
echon 'tabstop='.&l:ts
echon ' shiftwidth='.&l:sw
echon ' softtabstop='.&l:sts
if &l:et
echon ' expandtab'
else
echon ' noexpandtab'
endif
finally
echohl None
endtry
endfunction
" Syntax highlighting under cursor
" ==========================================================================
map <F10> :echo "hi<"
\ . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name")
\ . ">"<CR>
" +=========================================================================+
" | 6. PLUGIN SETTINGS |
" +=========================================================================+
" vim-tmux-navigator
" ==========================================================================
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
nnoremap <silent> <C-l> :TmuxNavigateRight<CR>
" gabrielelana/vim-markdown
" ==========================================================================
"let g:markdown_enable_conceal = 1
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'sql', 'c']
" beloglazov/vim-online-thesaurus
" ==========================================================================
let g:online_thesaurus_map_keys = 0
nnoremap <leader>k :OnlineThesaurusCurrentWord<CR>
augroup init
autocmd!
au VimLeave * set guicursor=a:block-blinkwait400-blinkoff600-blinkon600
augroup END