View difference between Paste ID: 5jfuBBmg and BsgWET3J
SHOW: | | - or go back to the newest paste.
1-
" Source external config files.
1+
" Source external config files.
2-
source $NVIM_VIMRC/plugins.vim
2+
source $NVIM_VIMRC/plugins.vim
3-
source $NVIM_VIMRC/backups.vim
3+
source $NVIM_VIMRC/backups.vim
4-
source $NVIM_VIMRC/abbreviations.vim
4+
source $NVIM_VIMRC/abbreviations.vim
5-
5+
6-
6+
7-
" Searching & Patterns --------------------------------------------{{{
7+
" Searching & Patterns --------------------------------------------{{{
8-
8+
9-
set incsearch nohlsearch
9+
set incsearch nohlsearch
10-
set ignorecase smartcase " searches are only case-sensitive when an uppercase letter is used.
10+
set ignorecase smartcase " searches are only case-sensitive when an uppercase letter is used.
11-
set showmatch " Briefly jump to matching brackets when new bracket is inserted.
11+
set showmatch " Briefly jump to matching brackets when new bracket is inserted.
12-
set gdefault " Default g flag on searches.
12+
set gdefault " Default g flag on searches.
13-
set startofline " Seaches start at the first non-blank character or a line instead of the current cursor position.
13+
set startofline " Seaches start at the first non-blank character or a line instead of the current cursor position.
14-
14+
15-
"Set command and modifyer timeouts
15+
"Set command and modifyer timeouts
16-
set timeout
16+
set timeout
17-
set timeoutlen=800
17+
set timeoutlen=800
18-
set ttimeoutlen=100
18+
set ttimeoutlen=100
19-
19+
20-
"}}}
20+
"}}}
21-
" Text Display & Colorscheme --------------------------------------{{{
21+
" Text Display & Colorscheme --------------------------------------{{{
22-
22+
23-
" Solarized, dark, with true color support and patched nerd font.
23+
" Solarized, dark, with true color support and patched nerd font.
24-
colorscheme solarized
24+
colorscheme solarized
25-
set background=dark
25+
set background=dark
26-
set guifont=Meslo_LG_S_DZ_Regular_for_Powerline_Nerd_Font_Complete:h12
26+
set guifont=Meslo_LG_S_DZ_Regular_for_Powerline_Nerd_Font_Complete:h12
27-
27+
28-
" Force true colour on, since vim can’t detect it within tmux.
28+
" Force true colour on, since vim can’t detect it within tmux.
29-
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
29+
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
30-
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
30+
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
31-
31+
32-
32+
33-
" Line/relative numbers and number gutter col width.
33+
" Line/relative numbers and number gutter col width.
34-
set number relativenumber numberwidth=4
34+
set number relativenumber numberwidth=4
35-
set cursorline " Cursor highlighting.
35+
set cursorline " Cursor highlighting.
36-
set wrap linebreak " Wrap words and word break at end of lines.
36+
set wrap linebreak " Wrap words and word break at end of lines.
37-
set nolist " Disable list when using wrap + linebreak.
37+
set nolist " Disable list when using wrap + linebreak.
38-
set textwidth=0 " No window width limit.
38+
set textwidth=0 " No window width limit.
39-
set fileformat=unix " Set <EOL>, prevent conversion errors in Git.
39+
set fileformat=unix " Set <EOL>, prevent conversion errors in Git.
40-
set encoding=utf8 fileencoding=utf8 " Set UTF-8 encoding.
40+
set encoding=utf8 fileencoding=utf8 " Set UTF-8 encoding.
41-
set conceallevel=1 " Allow syntax concealing with symbols.
41+
set conceallevel=1 " Allow syntax concealing with symbols.
42-
42+
43-
"set scrolloff=1 " Number of context lines above and below cursor"
43+
"set scrolloff=1 " Number of context lines above and below cursor"
44-
" set list " Cannot have listchars with linebreak.
44+
" set list " Cannot have listchars with linebreak.
45-
" set listchars=tab:▸\ ,eol:¬,trail:␠,nbsp:⎵,precedes:←,extends:→
45+
" set listchars=tab:▸\ ,eol:¬,trail:␠,nbsp:⎵,precedes:←,extends:→
46-
46+
47-
47+
48-
"}}}
48+
"}}}
49-
" Hightlighting ---------------------------------------------------{{{
49+
" Hightlighting ---------------------------------------------------{{{
50-
50+
51-
" Enable italicized comments (requires xterm-256color-italic).
51+
" Enable italicized comments (requires xterm-256color-italic).
52-
highlight Comment cterm=italic
52+
highlight Comment cterm=italic
53-
53+
54-
54+
55-
"}}}
55+
"}}}
56-
" Windows & Buffers -----------------------------------------------{{{
56+
" Windows & Buffers -----------------------------------------------{{{
57-
57+
58-
" Change the current working directory whenever you open a file,
58+
" Change the current working directory whenever you open a file,
59-
" switch buffers, delete a buffer or open/close a window.
59+
" switch buffers, delete a buffer or open/close a window.
60-
set autochdir
60+
set autochdir
61-
61+
62-
" Open new files even if current buffer has unsaved changes.
62+
" Open new files even if current buffer has unsaved changes.
63-
set hidden
63+
set hidden
64-
64+
65-
"set noequalalways " Do not automatically resize windows
65+
"set noequalalways " Do not automatically resize windows
66-
66+
67-
67+
68-
"}}}
68+
"}}}
69-
" Messages & Info -------------------------------------------------{{{
69+
" Messages & Info -------------------------------------------------{{{
70-
70+
71-
set showcmd " Shows typed commands in the botton right.
71+
set showcmd " Shows typed commands in the botton right.
72-
set laststatus=2 " Set the status bar such that it always displays.
72+
set laststatus=2 " Set the status bar such that it always displays.
73-
73+
74-
"set noshowmode " Hide the mode title bar.
74+
"set noshowmode " Hide the mode title bar.
75-
75+
76-
76+
77-
"}}}
77+
"}}}
78-
" Tabs & Indenting ------------------------------------------------{{{
78+
" Tabs & Indenting ------------------------------------------------{{{
79-
79+
80-
" set autoindent " Next line indent defaults to the same space.
80+
" set autoindent " Next line indent defaults to the same space.
81-
set tabstop=4 shiftwidth=4 softtabstop=4 " Set tab spacing.
81+
set tabstop=4 shiftwidth=4 softtabstop=4 " Set tab spacing.
82-
set shiftround " Round non mutiples of tabs to the shiftwidth multiple.
82+
set shiftround " Round non mutiples of tabs to the shiftwidth multiple.
83-
83+
84-
"set smartindent
84+
"set smartindent
85-
"set expandtab
85+
"set expandtab
86-
86+
87-
87+
88-
"}}}
88+
"}}}
89-
" Text Editing ----------------------------------------------------{{{
89+
" Text Editing ----------------------------------------------------{{{
90-
90+
91-
" Make all yanking/deleting operations automatically copy to the system
91+
" Make all yanking/deleting operations automatically copy to the system
92-
" clipboard (works with tmux).
92+
" clipboard (works with tmux).
93-
set clipboard=unnamedplus
93+
set clipboard=unnamedplus
94-
94+
95-
" Normal backspace behaviour.
95+
" Normal backspace behaviour.
96-
set backspace=indent,eol,start
96+
set backspace=indent,eol,start
97-
set history=1000 undolevels=5000
97+
set history=1000 undolevels=5000
98-
set noerrorbells visualbell t_vb=
98+
set noerrorbells visualbell t_vb=
99-
" Allow copy and pasting to Vim since Sierra upgrade.
99+
" Allow copy and pasting to Vim since Sierra upgrade.
100-
100+
101-
"highlight ColorColumn ctermbg=magenta
101+
"highlight ColorColumn ctermbg=magenta
102-
"set colorcolumn=81 "Dividing column to limit code length
102+
"set colorcolumn=81 "Dividing column to limit code length
103-
"call matchadd('ColorColumn', '\%81v', 100) "Column highlights when text reaches.
103+
"call matchadd('ColorColumn', '\%81v', 100) "Column highlights when text reaches.
104-
"call matchadd('ColorColumn', '\%>80v', 100) "Highlight everything past the 80th column
104+
"call matchadd('ColorColumn', '\%>80v', 100) "Highlight everything past the 80th column
105-
105+
106-
106+
107-
"}}}
107+
"}}}
108-
" Folding ---------------------------------------------------------{{{
108+
" Folding ---------------------------------------------------------{{{
109-
109+
110-
" Enable folds with a fold column of 3.
110+
" Enable folds with a fold column of 3.
111-
set foldenable foldcolumn=3
111+
set foldenable foldcolumn=3
112-
112+
113-
"}}}
113+
"}}}
114-
"Diff Mode --------------------------------------------------------{{{
114+
"Diff Mode --------------------------------------------------------{{{
115-
115+
116-
"Stores a temporary copy of the file in the current buffer (including latest changes) and diffs it against the
116+
"Stores a temporary copy of the file in the current buffer (including latest changes) and diffs it against the
117-
"version of the file on your hard drive.
117+
"version of the file on your hard drive.
118-
function! DiffWithFileFromDisk()
118+
function! DiffWithFileFromDisk()
119-
	let filename=expand('%')
119+
	let filename=expand('%')
120-
	let diffname = filename.'.fileFromBuffer'
120+
	let diffname = filename.'.fileFromBuffer'
121-
	exec 'saveas! '.diffname
121+
	exec 'saveas! '.diffname
122-
	diffthis
122+
	diffthis
123-
	vsplit
123+
	vsplit
124-
	exec 'edit '.filename
124+
	exec 'edit '.filename
125-
	diffthis
125+
	diffthis
126-
endfunction
126+
endfunction
127-
127+
128-
128+
129-
"}}}
129+
"}}}
130-
" Mappings --------------------------------------------------------{{{
130+
" Mappings --------------------------------------------------------{{{
131-
131+
132-
let mapleader = ","
132+
let mapleader = ","
133-
133+
134-
" Normal Mode -----------------------------------------------------{{{
134+
" Normal Mode -----------------------------------------------------{{{
135-
135+
136-
" ** Note: the <C-h>, <C-j> <C-k> and <C-l> mappings are already mapped
136+
" ** Note: the <C-h>, <C-j> <C-k> and <C-l> mappings are already mapped
137-
" by the vim-tmux-navigator plugin as shown below:
137+
" by the vim-tmux-navigator plugin as shown below:
138-
138+
139-
" nnoremap <silent> <C-h>  :TmuxNavigateLeft<CR>
139+
" nnoremap <silent> <C-h>  :TmuxNavigateLeft<CR>
140-
" nnoremap <silent> <C-j>  :TmuxNavigateDown<CR>
140+
" nnoremap <silent> <C-j>  :TmuxNavigateDown<CR>
141-
" nnoremap <silent> <C-k>  :TmuxNavigateUp<CR>
141+
" nnoremap <silent> <C-k>  :TmuxNavigateUp<CR>
142-
" nnoremap <silent> <C-l>  :TmuxNavigateRight<CR>
142+
" nnoremap <silent> <C-l>  :TmuxNavigateRight<CR>
143-
" nnoremap <silent> <C-h>  :TmuxNavigatePrevious<CR>
143+
" nnoremap <silent> <C-h>  :TmuxNavigatePrevious<CR>
144-
144+
145-
145+
146-
146+
147-
" Edit/source .vimrc|init.vim
147+
" Edit/source .vimrc|init.vim
148-
nnoremap <silent> <leader>ev :tabe $MYVIMRC<CR>
148+
nnoremap <silent> <leader>ev :tabe $MYVIMRC<CR>
149-
nnoremap <silent> <leader>sv :so $MYVIMRC<CR>
149+
nnoremap <silent> <leader>sv :so $MYVIMRC<CR>
150-
150+
151-
151+
152-
" Automatically set search patterns in 'very magic' mode.
152+
" Automatically set search patterns in 'very magic' mode.
153-
" nnoremap / /\v
153+
" nnoremap / /\v
154-
154+
155-
155+
156-
" Call custom diffmode function (see Diff Mode section).
156+
" Call custom diffmode function (see Diff Mode section).
157-
nnoremap <F7> :call DiffWithFileFromDisk()<CR>
157+
nnoremap <F7> :call DiffWithFileFromDisk()<CR>
158-
158+
159-
159+
160-
"_____ File Manipulation _____
160+
"_____ File Manipulation _____
161-
161+
162-
" Yank from the cursor to the end of the line.
162+
" Yank from the cursor to the end of the line.
163-
nnoremap Y y$
163+
nnoremap Y y$
164-
164+
165-
165+
166-
" Yank the current line and paste it below/above.
166+
" Yank the current line and paste it below/above.
167-
nnoremap yj yyp
167+
nnoremap yj yyp
168-
nnoremap yk yyP
168+
nnoremap yk yyP
169-
169+
170-
170+
171-
" Copy the current buffer path to the clipboard
171+
" Copy the current buffer path to the clipboard
172-
nnoremap cp :let @+ = expand("%:p")<CR>
172+
nnoremap cp :let @+ = expand("%:p")<CR>
173-
173+
174-
174+
175-
" Change entire line.
175+
" Change entire line.
176-
nnoremap cc 0C
176+
nnoremap cc 0C
177-
177+
178-
178+
179-
" Enter inserts a newline.
179+
" Enter inserts a newline.
180-
nnoremap <CR> i<CR><ESC>k$
180+
nnoremap <CR> i<CR><ESC>k$
181-
181+
182-
182+
183-
" Add a marker in register a when moving to the bottom of the page.
183+
" Add a marker in register a when moving to the bottom of the page.
184-
nnoremap G mhG
184+
nnoremap G mhG
185-
nnoremap gg mggg
185+
nnoremap gg mggg
186-
186+
187-
187+
188-
" Toggle folds open and close.
188+
" Toggle folds open and close.
189-
nnoremap <space> za
189+
nnoremap <space> za
190-
190+
191-
191+
192-
"_____ Window/Buffer Navigation _____
192+
"_____ Window/Buffer Navigation _____
193-
193+
194-
" Move between buffers (Use Prefix +h/j/k/l key in tmux).
194+
" Move between buffers (Use Prefix +h/j/k/l key in tmux).
195-
nnoremap gh <C-w>h
195+
nnoremap gh <C-w>h
196-
nnoremap gj <C-w>j
196+
nnoremap gj <C-w>j
197-
nnoremap gk <C-w>k
197+
nnoremap gk <C-w>k
198-
nnoremap gl <C-w>l
198+
nnoremap gl <C-w>l
199-
" Close window
199+
" Close window
200-
nnoremap gc <C-w>c
200+
nnoremap gc <C-w>c
201-
201+
202-
202+
203-
" Reposition buffers.
203+
" Reposition buffers.
204-
nnoremap gH <C-w>H
204+
nnoremap gH <C-w>H
205-
nnoremap gJ <C-w>J
205+
nnoremap gJ <C-w>J
206-
nnoremap gK <C-w>K
206+
nnoremap gK <C-w>K
207-
nnoremap gL <C-w>L
207+
nnoremap gL <C-w>L
208-
208+
209-
209+
210-
" Buffer next/previous.
210+
" Buffer next/previous.
211-
nnoremap gn :bn<CR>
211+
nnoremap gn :bn<CR>
212-
nnoremap gp :bp<CR>
212+
nnoremap gp :bp<CR>
213-
" nnoremap gq :q<CR>
213+
" nnoremap gq :q<CR>
214-
214+
215-
215+
216-
" Create a new vertical split.
216+
" Create a new vertical split.
217-
nnoremap gs <C-W>v
217+
nnoremap gs <C-W>v
218-
218+
219-
219+
220-
" Allow movements over wrapped lines.
220+
" Allow movements over wrapped lines.
221-
nnoremap j gj
221+
nnoremap j gj
222-
nnoremap k gk
222+
nnoremap k gk
223-
nnoremap $ g$
223+
nnoremap $ g$
224-
nnoremap 0 g0
224+
nnoremap 0 g0
225-
nnoremap p gp
225+
nnoremap p gp
226-
226+
227-
227+
228-
"_____ Help File Navigation _____
228+
"_____ Help File Navigation _____
229-
nnoremap <silent> <RIGHT> :cnext<CR>
229+
nnoremap <silent> <RIGHT> :cnext<CR>
230-
nnoremap <silent> <RIGHT><RIGHT> :cnfile<CR><C-G>
230+
nnoremap <silent> <RIGHT><RIGHT> :cnfile<CR><C-G>
231-
nnoremap <silent> <LEFT> :cprev<CR>
231+
nnoremap <silent> <LEFT> :cprev<CR>
232-
nnoremap <silent> <LEFT><LEFT> :cpfile<CR><C-G>
232+
nnoremap <silent> <LEFT><LEFT> :cpfile<CR><C-G>
233-
233+
234-
234+
235-
"_____ Not In Use _____
235+
"_____ Not In Use _____
236-
" nnoremap <BS> :noh<CR>
236+
" nnoremap <BS> :noh<CR>
237-
237+
238-
" Open current file in google chrome
238+
" Open current file in google chrome
239-
" nnoremap <F5> :exe ':silent !chrome %'<CR>
239+
" nnoremap <F5> :exe ':silent !chrome %'<CR>
240-
240+
241-
241+
242-
"}}}
242+
"}}}
243-
" Insert Mode -----------------------------------------------------{{{
243+
" Insert Mode -----------------------------------------------------{{{
244-
244+
245-
" Exit insert mode (must have classic).
245+
" Exit insert mode (must have classic).
246-
inoremap jj <ESC>
246+
inoremap jj <ESC>
247-
247+
248-
248+
249-
" Insert a newline above/below current line & preserve indentation.
249+
" Insert a newline above/below current line & preserve indentation.
250-
inoremap JJ <ESC>o
250+
inoremap JJ <ESC>o
251-
inoremap KK <ESC>O
251+
inoremap KK <ESC>O
252-
252+
253-
253+
254-
" Move up/down a line in insert mode.
254+
" Move up/down a line in insert mode.
255-
inoremap GJ <DOWN>
255+
inoremap GJ <DOWN>
256-
inoremap GK <UP>
256+
inoremap GK <UP>
257-
257+
258-
258+
259-
"Insert a semi-colon at the end of the line.
259+
"Insert a semi-colon at the end of the line.
260-
inoremap ;; <ESC>A;<ESC>
260+
inoremap ;; <ESC>A;<ESC>
261-
261+
262-
262+
263-
"_____ Omni-Complete _____
263+
"_____ Omni-Complete _____
264-
264+
265-
"inoremap ,o <C-x><C-o>
265+
"inoremap ,o <C-x><C-o>
266-
" Remap onmi menu up/down navigation.
266+
" Remap onmi menu up/down navigation.
267-
" inoremap <C-j> <C-n>
267+
" inoremap <C-j> <C-n>
268-
" inoremap <C-k> <C-p>
268+
" inoremap <C-k> <C-p>
269-
269+
270-
270+
271-
"_____ Not In Use _____
271+
"_____ Not In Use _____
272-
"inoremap == <C-r>=
272+
"inoremap == <C-r>=
273-
273+
274-
274+
275-
"}}}
275+
"}}}
276-
" Command Mode ----------------------------------------------------{{{
276+
" Command Mode ----------------------------------------------------{{{
277-
277+
278-
" Write all buffers active/hidden buffers.
278+
" Write all buffers active/hidden buffers.
279-
cnoremap W<CR> wa<CR>
279+
cnoremap W<CR> wa<CR>
280-
280+
281-
281+
282-
"}}}
282+
"}}}
283-
283+
284-
284+
285-
"}}}
285+
"}}}
286-
" Command Line Editing --------------------------------------------{{{
286+
" Command Line Editing --------------------------------------------{{{
287-
287+
288-
set wildmenu
288+
set wildmenu
289-
set wildmode=full:longest,full
289+
set wildmode=full:longest,full
290-
290+
291-
291+
292-
"}}}
292+
"}}}
293-
"Autocommands -----------------------------------------------------{{{
293+
"Autocommands -----------------------------------------------------{{{
294-
294+
295-
augroup vimrc
295+
augroup vimrc
296-
	autocmd!
296+
	autocmd!
297-
    autocmd BufWritePost,BufWinLeave *.*
297+
    autocmd BufWritePost,BufWinLeave *.*
298-
    \   if expand('%') != '' && &buftype !~ 'nofile'
298+
    \   if expand('%') != '' && &buftype !~ 'nofile'
299-
    \|      mkview
299+
    \|      mkview
300-
    \|  endif
300+
    \|  endif
301-
    autocmd BufRead,BufWinEnter *.*
301+
    autocmd BufRead,BufWinEnter *.*
302-
    \   if expand('%') != '' && &buftype !~ 'nofile'
302+
    \   if expand('%') != '' && &buftype !~ 'nofile'
303-
    \|      silent! loadview
303+
    \|      silent! loadview
304-
    \|  endif
304+
    \|  endif
305-
augroup END
305+
augroup END
306-
306+
307-
307+
308-
" Remembers the cursor position upon re-entering a buffer.
308+
" Remembers the cursor position upon re-entering a buffer.
309-
" autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
309+
" autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
310-
310+
311-
" autocmd GUIEnter * set visualbell t_vb=
311+
" autocmd GUIEnter * set visualbell t_vb=
312-
312+
313-
313+
314-
314+
315-
"_____ Automatically Equalize Splits _____
315+
"_____ Automatically Equalize Splits _____
316-
augroup AutomaticallyResizeWindows
316+
augroup AutomaticallyResizeWindows
317-
	autocmd!
317+
	autocmd!
318-
	autocmd VimResized * wincmd =
318+
	autocmd VimResized * wincmd =
319-
augroup END
319+
augroup END
320-
320+
321-
321+
322-
"_____ Highlights Extra Whitespace _____
322+
"_____ Highlights Extra Whitespace _____
323-
" highlight ExtraWhitespace ctermbg=red guibg=red
323+
" highlight ExtraWhitespace ctermbg=red guibg=red
324-
" match ExtraWhitespace /\s\+$/
324+
" match ExtraWhitespace /\s\+$/
325-
" autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
325+
" autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
326-
" autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
326+
" autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
327-
" autocmd InsertLeave * match ExtraWhitespace /\s\+$/
327+
" autocmd InsertLeave * match ExtraWhitespace /\s\+$/
328-
" autocmd BufWinLeave * call clearmatches()
328+
" autocmd BufWinLeave * call clearmatches()
329-
329+
330-
330+
331-
augroup SetFoldmethodAndFoldLevel
331+
augroup SetFoldmethodAndFoldLevel
332-
	autocmd!
332+
	autocmd!
333-
	autocmd FileType javascript,typescript,json setlocal foldmethod=syntax
333+
	autocmd FileType javascript,typescript,json setlocal foldmethod=syntax
334-
	autocmd FileType javascript,html,css,scss,typescript setlocal foldlevel=99
334+
	autocmd FileType javascript,html,css,scss,typescript setlocal foldlevel=99
335-
augroup END
335+
augroup END
336-
336+
337-
337+
338-
"TODO: Autocommand to load sessions. Look further into this. Change the
338+
"TODO: Autocommand to load sessions. Look further into this. Change the
339-
"session.vim name**
339+
"session.vim name**
340-
" autocmd VimEnter * call LoadSession()
340+
" autocmd VimEnter * call LoadSession()
341-
" autocmd VimLeave * call SaveSession()
341+
" autocmd VimLeave * call SaveSession()
342-
" function! SaveSession()
342+
" function! SaveSession()
343-
"     execute 'mksession! $VIMRC_CONFIG/.vim/sessions/session.vim'
343+
"     execute 'mksession! $VIMRC_CONFIG/.vim/sessions/session.vim'
344-
" endfunction
344+
" endfunction
345-
" function! LoadSession()
345+
" function! LoadSession()
346-
"     if argc() == 0
346+
"     if argc() == 0
347-
"         execute 'source $VIMRC_CONFIG/.vim/sessions/session.vim'
347+
"         execute 'source $VIMRC_CONFIG/.vim/sessions/session.vim'
348-
"     endif
348+
"     endif
349-
" endfunction
349+
" endfunction
350-
350+
351-
351+
352-
"}}}
352+
"}}}
353-
" Functions -------------------------------------------------------{{{
353+
" Functions -------------------------------------------------------{{{
354-
354+
355-
" Source function definitions.
355+
" Source function definitions.
356-
source $NVIM_VIMRC/functions.vim
356+
source $NVIM_VIMRC/functions.vim
357-
357+
358-
nnoremap <Leader>q :call DeleteCurBufferNotCloseWindow()<CR>
358+
nnoremap <Leader>q :call DeleteCurBufferNotCloseWindow()<CR>
359-
359+
360-
360+
361-
"}}}
361+
"}}}
362-
" Plugins ---------------------------------------------------------{{{
362+
" Plugins ---------------------------------------------------------{{{
363-
363+
364-
"NERD TREE --------------------------------------------------------{{{
364+
"NERD TREE --------------------------------------------------------{{{
365-
"_____ Globals _____
365+
"_____ Globals _____
366-
let NERDTreeMinimalUI=1 " Simply the UI.
366+
let NERDTreeMinimalUI=1 " Simply the UI.
367-
let g:NERDTreeQuitOnOpen=1 " Close NERD Tree when opening file.
367+
let g:NERDTreeQuitOnOpen=1 " Close NERD Tree when opening file.
368-
let NERDTreeAutoDeleteBuffer=1 " Automatically delete buffers of files deleted with NerdTree.
368+
let NERDTreeAutoDeleteBuffer=1 " Automatically delete buffers of files deleted with NerdTree.
369-
let NERDTreeCascadeSingleChildDir=0 " Do not collapse dirs with one child.
369+
let NERDTreeCascadeSingleChildDir=0 " Do not collapse dirs with one child.
370-
"let NERDTreeChDirMode=2
370+
"let NERDTreeChDirMode=2
371-
" let NERDTreeShowBookmarks=1
371+
" let NERDTreeShowBookmarks=1
372-
" let NERDTreeIgnore=['\~$','\.pyc$', '\.swp$']
372+
" let NERDTreeIgnore=['\~$','\.pyc$', '\.swp$']
373-
" let NERDTreeSortOrder=['^__\.py$','\/$','*','\.swp$','\~$']
373+
" let NERDTreeSortOrder=['^__\.py$','\/$','*','\.swp$','\~$']
374-
374+
375-
375+
376-
"_____ Mappings _____
376+
"_____ Mappings _____
377-
" Toogle NERTree open/close.
377+
" Toogle NERTree open/close.
378-
nnoremap <leader>n :NERDTreeToggle<CR>
378+
nnoremap <leader>n :NERDTreeToggle<CR>
379-
379+
380-
" Open the current file in NERDTree.
380+
" Open the current file in NERDTree.
381-
nnoremap <silent> <leader>v :NERDTreeFind<CR>
381+
nnoremap <silent> <leader>v :NERDTreeFind<CR>
382-
382+
383-
383+
384-
"_____ Autocommands _____
384+
"_____ Autocommands _____
385-
augroup CustomNERDTreeMappings
385+
augroup CustomNERDTreeMappings
386-
	autocmd!
386+
	autocmd!
387-
	" Open NERDTree when no arguments are supplied.
387+
	" Open NERDTree when no arguments are supplied.
388-
	autocmd StdinReadPre * let s:std_in=1
388+
	autocmd StdinReadPre * let s:std_in=1
389-
	autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
389+
	autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
390-
390+
391-
	" Space opens/closes files/directories.
391+
	" Space opens/closes files/directories.
392-
	autocmd FileType nerdtree nmap <buffer> <space> o
392+
	autocmd FileType nerdtree nmap <buffer> <space> o
393-
augroup END
393+
augroup END
394-
394+
395-
395+
396-
"}}}
396+
"}}}
397-
397+
398-
"NERD TREE COMMENTER ----------------------------------------------{{{
398+
"NERD TREE COMMENTER ----------------------------------------------{{{
399-
"_____ Globals _____
399+
"_____ Globals _____
400-
let NERDSpaceDelims=1
400+
let NERDSpaceDelims=1
401-
let NERDCompactSexyComs=1
401+
let NERDCompactSexyComs=1
402-
let NERDDefaultAlign='start'
402+
let NERDDefaultAlign='start'
403-
let NERDTrimTrailingWhitespace=1
403+
let NERDTrimTrailingWhitespace=1
404-
404+
405-
405+
406-
"}}}
406+
"}}}
407-
407+
408-
"NERDTREE GIT PLUGIN ----------------------------------------------{{{
408+
"NERDTREE GIT PLUGIN ----------------------------------------------{{{
409-
let g:NERDTreeIndicatorMapCustom = {
409+
let g:NERDTreeIndicatorMapCustom = {
410-
	\ "Modified"  : "",
410+
	\ "Modified"  : "",
411-
    \ "Staged"    : "✚",
411+
    \ "Staged"    : "✚",
412-
    \ "Untracked" : "✭",
412+
    \ "Untracked" : "✭",
413-
    \ "Renamed"   : "➜",
413+
    \ "Renamed"   : "➜",
414-
    \ "Unmerged"  : "═",
414+
    \ "Unmerged"  : "═",
415-
    \ "Deleted"   : "✖",
415+
    \ "Deleted"   : "✖",
416-
    \ "Dirty"     : "✗",
416+
    \ "Dirty"     : "✗",
417-
    \ "Clean"     : "✔︎",
417+
    \ "Clean"     : "✔︎",
418-
    \ 'Ignored'   : '',
418+
    \ 'Ignored'   : '',
419-
    \ "Unknown"   : "?"
419+
    \ "Unknown"   : "?"
420-
    \ }
420+
    \ }
421-
421+
422-
let g:WebDevIconsOS = 'Darwin' " Set MacOS specific glyps (avoid system() call).
422+
let g:WebDevIconsOS = 'Darwin' " Set MacOS specific glyps (avoid system() call).
423-
let g:NERDTreeShowIgnoredStatus = 1 " Show ignored git files (might affect performance).
423+
let g:NERDTreeShowIgnoredStatus = 1 " Show ignored git files (might affect performance).
424-
" let g:WebDevIconsUnicodeDecorateFolderNodes = 1 " Enable folder glyphs.
424+
" let g:WebDevIconsUnicodeDecorateFolderNodes = 1 " Enable folder glyphs.
425-
425+
426-
426+
427-
"}}}
427+
"}}}
428-
428+
429-
" COMPLETION MANAGER ----------------------------------------------{{{
429+
" COMPLETION MANAGER ----------------------------------------------{{{
430-
"_____ Globals _____
430+
"_____ Globals _____
431-
set shortmess+=c
431+
set shortmess+=c
432-
432+
433-
433+
434-
"_____ Mappings _____
434+
"_____ Mappings _____
435-
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<CR>" : "\<CR>")
435+
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<CR>" : "\<CR>")
436-
436+
437-
437+
438-
"}}}
438+
"}}}
439-
439+
440-
" EASY MOTION -----------------------------------------------------{{{
440+
" EASY MOTION -----------------------------------------------------{{{
441-
"_____ Mappings _____
441+
"_____ Mappings _____
442-
nmap <Leader>f <Plug>(easymotion-bd-w)
442+
nmap <Leader>f <Plug>(easymotion-bd-w)
443-
nmap <Leader>w <Plug>(easymotion-overwin-w)
443+
nmap <Leader>w <Plug>(easymotion-overwin-w)
444-
444+
445-
445+
446-
"}}}
446+
"}}}
447-
447+
448-
" AIRLINE TAB -----------------------------------------------------{{{
448+
" AIRLINE TAB -----------------------------------------------------{{{
449-
"_____ Globals _____
449+
"_____ Globals _____
450-
let g:airline_solarized_bg='dark'
450+
let g:airline_solarized_bg='dark'
451-
let g:airline#extensions#tabline#enabled = 1
451+
let g:airline#extensions#tabline#enabled = 1
452-
"let g:airline#extensions#bufferline#enabled = 1
452+
"let g:airline#extensions#bufferline#enabled = 1
453-
let g:airline#extensions#tabline#formatter = 'jsformatter'
453+
let g:airline#extensions#tabline#formatter = 'jsformatter'
454-
let g:airline_powerline_fonts = 1 "Allow Powerline Fonts
454+
let g:airline_powerline_fonts = 1 "Allow Powerline Fonts
455-
"Define straight tab seperators
455+
"Define straight tab seperators
456-
"let g:airline#extensions#tabline#left_sep = ' '
456+
"let g:airline#extensions#tabline#left_sep = ' '
457-
"let g:airline#extensions#tabline#left_alt_sep = '|'
457+
"let g:airline#extensions#tabline#left_alt_sep = '|'
458-
458+
459-
459+
460-
"}}}
460+
"}}}
461-
461+
462-
" ULTISNIPS -------------------------------------------------------{{{
462+
" ULTISNIPS -------------------------------------------------------{{{
463-
"_____ Globals _____
463+
"_____ Globals _____
464-
let g:UltiSnipsSnippetsDir ="~/.config/nvim/UltiSnips/" " Default snippets :UltiSipsEdits directory
464+
let g:UltiSnipsSnippetsDir ="~/.config/nvim/UltiSnips/" " Default snippets :UltiSipsEdits directory
465-
let g:UltiSnipsEnableSnipMate = 0 " Disable search for Snipmate snippets
465+
let g:UltiSnipsEnableSnipMate = 0 " Disable search for Snipmate snippets
466-
let g:UltiSnipsEditSplit="vertical" " :UltiSipsEdits splits vertically
466+
let g:UltiSnipsEditSplit="vertical" " :UltiSipsEdits splits vertically
467-
467+
468-
" Key Bindings.
468+
" Key Bindings.
469-
let g:UltiSnipsExpandTrigger = "<tab>"
469+
let g:UltiSnipsExpandTrigger = "<tab>"
470-
let g:UltiSnipsJumpForwardTrigger = "<tab>"
470+
let g:UltiSnipsJumpForwardTrigger = "<tab>"
471-
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
471+
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
472-
" let g:UltiSnipsJumpForwardTrigger = "<C-j>"
472+
" let g:UltiSnipsJumpForwardTrigger = "<C-j>"
473-
" let g:UltiSnipsJumpBackwardTrigger = "<C-k>"
473+
" let g:UltiSnipsJumpBackwardTrigger = "<C-k>"
474-
474+
475-
" Global Snippets Config
475+
" Global Snippets Config
476-
let g:ultisnips_javascript = {
476+
let g:ultisnips_javascript = {
477-
     \ 'semi': 'never',
477+
     \ 'semi': 'never',
478-
     \ }
478+
     \ }
479-
479+
480-
480+
481-
"_____ Abbreviations _____
481+
"_____ Abbreviations _____
482-
cnoreabbrev editsnips :UltiSnipsEdit<CR>
482+
cnoreabbrev editsnips :UltiSnipsEdit<CR>
483-
483+
484-
484+
485-
"_____ Autocommands _____
485+
"_____ Autocommands _____
486-
autocmd FileType html UltiSnipsAddFiletypes javascript
486+
autocmd FileType html UltiSnipsAddFiletypes javascript
487-
487+
488-
488+
489-
"}}}
489+
"}}}
490-
490+
491-
" CTRLP -----------------------------------------------------------{{{
491+
" CTRLP -----------------------------------------------------------{{{
492-
"_____ Globals _____
492+
"_____ Globals _____
493-
" let g:ctrlp_working_path_mode = 'ra' " Search within these nearest ancestors: .git .hg .svn .bzr _darcs
493+
" let g:ctrlp_working_path_mode = 'ra' " Search within these nearest ancestors: .git .hg .svn .bzr _darcs
494-
" let g:ctrlp_extensions = ['dir'] " Default dir name search
494+
" let g:ctrlp_extensions = ['dir'] " Default dir name search
495-
" let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] " Ignore files in .gitignore
495+
" let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] " Ignore files in .gitignore
496-
" let g:ctrlp_cmd = 'CtrlP'
496+
" let g:ctrlp_cmd = 'CtrlP'
497-
497+
498-
498+
499-
"}}}
499+
"}}}
500-
500+
501-
" FZF -----------------------------------------------------------{{{
501+
" FZF -----------------------------------------------------------{{{
502-
"_____ Globals _____
502+
"_____ Globals _____
503-
" Customize fzf colors to match the color scheme.
503+
" Customize fzf colors to match the color scheme.
504-
let g:fzf_colors =
504+
let g:fzf_colors =
505-
\ { 'fg':      ['fg', 'Normal'],
505+
\ { 'fg':      ['fg', 'Normal'],
506-
  \ 'bg':      ['bg', 'Normal'],
506+
  \ 'bg':      ['bg', 'Normal'],
507-
  \ 'hl':      ['fg', 'Comment'],
507+
  \ 'hl':      ['fg', 'Comment'],
508-
  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
508+
  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
509-
  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
509+
  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
510-
  \ 'hl+':     ['fg', 'Statement'],
510+
  \ 'hl+':     ['fg', 'Statement'],
511-
  \ 'info':    ['fg', 'PreProc'],
511+
  \ 'info':    ['fg', 'PreProc'],
512-
  \ 'border':  ['fg', 'Ignore'],
512+
  \ 'border':  ['fg', 'Ignore'],
513-
  \ 'prompt':  ['fg', 'Conditional'],
513+
  \ 'prompt':  ['fg', 'Conditional'],
514-
  \ 'pointer': ['fg', 'Exception'],
514+
  \ 'pointer': ['fg', 'Exception'],
515-
  \ 'marker':  ['fg', 'Keyword'],
515+
  \ 'marker':  ['fg', 'Keyword'],
516-
  \ 'spinner': ['fg', 'Label'],
516+
  \ 'spinner': ['fg', 'Label'],
517-
  \ 'header':  ['fg', 'Comment'] }
517+
  \ 'header':  ['fg', 'Comment'] }
518-
518+
519-
let g:fzf_history_dir = '~/.config/.fzf/fzf-history'
519+
let g:fzf_history_dir = '~/.config/.fzf/fzf-history'
520-
520+
521-
521+
522-
"_____ Globals _____
522+
"_____ Globals _____
523-
nnoremap <C-t> :GFiles<CR>
523+
nnoremap <C-t> :GFiles<CR>
524-
524+
525-
"}}}
525+
"}}}
526-
526+
527-
" VIM FUGITIVE ----------------------------------------------------{{{
527+
" VIM FUGITIVE ----------------------------------------------------{{{
528-
"_____ Globals _____
528+
"_____ Globals _____
529-
" Make EditorConfig comptible with Fugitive plugin/avoid loading remote files over ssh.
529+
" Make EditorConfig comptible with Fugitive plugin/avoid loading remote files over ssh.
530-
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
530+
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
531-
531+
532-
532+
533-
"_____ Abbreviations _____
533+
"_____ Abbreviations _____
534-
" cnoremap gs<CR> Gstatus<CR>
534+
" cnoremap gs<CR> Gstatus<CR>
535-
535+
536-
536+
537-
"}}}
537+
"}}}
538-
538+
539-
" JAVASCRIPT LIBRARIES SYNTAX ------------------------------------{{{
539+
" JAVASCRIPT LIBRARIES SYNTAX ------------------------------------{{{
540-
"_____ Globals _____
540+
"_____ Globals _____
541-
let g:used_javascript_libs = 'underscore,react,flux,ramda,requirejs,jquery' " Set libraries used
541+
let g:used_javascript_libs = 'underscore,react,flux,ramda,requirejs,jquery' " Set libraries used
542-
542+
543-
543+
544-
"}}}
544+
"}}}
545-
545+
546-
" VIM JAVASCRIPT --------------------------------------------------{{{
546+
" VIM JAVASCRIPT --------------------------------------------------{{{
547-
"_____ Globals _____
547+
"_____ Globals _____
548-
let g:javascript_plugin_flow = 1
548+
let g:javascript_plugin_flow = 1
549-
let g:javascript_plugin_jsdoc = 1
549+
let g:javascript_plugin_jsdoc = 1
550-
let g:javascript_plugin_ngdoc = 1
550+
let g:javascript_plugin_ngdoc = 1
551-
let g:javascript_conceal_NaN = "ℕ"
551+
let g:javascript_conceal_NaN = "ℕ"
552-
let g:javascript_conceal_null = "ø"
552+
let g:javascript_conceal_null = "ø"
553-
let g:javascript_conceal_this = "@"
553+
let g:javascript_conceal_this = "@"
554-
let g:javascript_conceal_super = "Ω"
554+
let g:javascript_conceal_super = "Ω"
555-
let g:javascript_conceal_static = "•"
555+
let g:javascript_conceal_static = "•"
556-
let g:javascript_conceal_return = "⇚"
556+
let g:javascript_conceal_return = "⇚"
557-
let g:javascript_conceal_function = "ƒ"
557+
let g:javascript_conceal_function = "ƒ"
558-
let g:javascript_conceal_undefined = "¿"
558+
let g:javascript_conceal_undefined = "¿"
559-
let g:javascript_conceal_prototype = "¶"
559+
let g:javascript_conceal_prototype = "¶"
560-
let g:javascript_conceal_arrow_function = "⇒"
560+
let g:javascript_conceal_arrow_function = "⇒"
561-
let g:javascript_conceal_noarg_arrow_function = "λ"
561+
let g:javascript_conceal_noarg_arrow_function = "λ"
562-
"let g:javascript_conceal_underscore_arrow_function = "λ"
562+
"let g:javascript_conceal_underscore_arrow_function = "λ"
563-
563+
564-
564+
565-
"}}}
565+
"}}}
566-
566+
567-
" VIM JS CONTEXT COLORING -----------------------------------------{{{
567+
" VIM JS CONTEXT COLORING -----------------------------------------{{{
568-
"_____ Globals _____
568+
"_____ Globals _____
569-
let g:js_context_colors_enabled = 0
569+
let g:js_context_colors_enabled = 0
570-
let g:js_context_colors_highlight_function_names = 1
570+
let g:js_context_colors_highlight_function_names = 1
571-
let g:js_context_colors_jsx = 1
571+
let g:js_context_colors_jsx = 1
572-
572+
573-
573+
574-
"_____ Mappings _____
574+
"_____ Mappings _____
575-
autocmd FileType javascript,typescript nnoremap <buffer> <leader>h :JSContextColorToggle<CR>
575+
autocmd FileType javascript,typescript nnoremap <buffer> <leader>h :JSContextColorToggle<CR>
576-
576+
577-
"}}}
577+
"}}}
578-
578+
579-
" ALE -------------------------------------------------------------{{{
579+
" ALE -------------------------------------------------------------{{{
580-
"_____ Globals _____
580+
"_____ Globals _____
581-
let g:ale_sign_error = '✘'
581+
let g:ale_sign_error = '✘'
582-
let g:ale_statusline_format = ['X %d', '? %d', '']
582+
let g:ale_statusline_format = ['X %d', '? %d', '']
583-
" %linter% is the name of the linter that provided the message
583+
" %linter% is the name of the linter that provided the message
584-
" %s is the error or warning message
584+
" %s is the error or warning message
585-
let g:ale_echo_msg_format = '%linter% says %s'
585+
let g:ale_echo_msg_format = '%linter% says %s'
586-
" Limit linters used for JavaScript.
586+
" Limit linters used for JavaScript.
587-
"let g:ale_linters = {
587+
"let g:ale_linters = {
588-
"\  'javascript': ['flow', 'eslint']
588+
"\  'javascript': ['flow', 'eslint']
589-
"\}
589+
"\}
590-
590+
591-
591+
592-
"_____ Mappings _____
592+
"_____ Mappings _____
593-
" Next and previous error msg
593+
" Next and previous error msg
594-
nnoremap <leader>an :ALENextWrap<CR>
594+
nnoremap <leader>an :ALENextWrap<CR>
595-
nnoremap <leader>ap :ALEPreviousWrap<CR>
595+
nnoremap <leader>ap :ALEPreviousWrap<CR>
596-
596+
597-
597+
598-
"}}}
598+
"}}}
599-
599+
600-
" EMMET -----------------------------------------------------------{{{
600+
" EMMET -----------------------------------------------------------{{{
601-
"_____ Globals _____
601+
"_____ Globals _____
602-
" Replace class with className.
602+
" Replace class with className.
603-
let g:user_emmet_settings = {
603+
let g:user_emmet_settings = {
604-
\  'javascript.jsx' : {
604+
\  'javascript.jsx' : {
605-
\      'extends' : 'jsx',
605+
\      'extends' : 'jsx',
606-
\  },
606+
\  },
607-
\}
607+
\}
608-
608+
609-
609+
610-
"}}}
610+
"}}}
611-
611+
612-
" DELIMITMATE -----------------------------------------------------{{{
612+
" DELIMITMATE -----------------------------------------------------{{{
613-
"_____ Globals _____
613+
"_____ Globals _____
614-
let delimitMate_expand_cr = 1 " Expand pairs into block.
614+
let delimitMate_expand_cr = 1 " Expand pairs into block.
615-
let delimitMate_expand_space = 1 " Space pairs evenly.
615+
let delimitMate_expand_space = 1 " Space pairs evenly.
616-
616+
617-
617+
618-
"_____ Mappings _____
618+
"_____ Mappings _____
619-
" Fix delimitMate_expand_cr functionality
619+
" Fix delimitMate_expand_cr functionality
620-
imap <expr> <CR> delimitMate#WithinEmptyPair() ?
620+
imap <expr> <CR> delimitMate#WithinEmptyPair() ?
621-
			 \ "<Plug>delimitMateCR" :
621+
			 \ "<Plug>delimitMateCR" :
622-
			 \ "<CR>"
622+
			 \ "<CR>"
623-
623+
624-
624+
625-
"}}}
625+
"}}}
626-
626+
627-
" VIM NOTES -------------------------------------------------------{{{
627+
" VIM NOTES -------------------------------------------------------{{{
628-
"_____ Globals _____
628+
"_____ Globals _____
629-
let g:notes_suffix = '.notes'
629+
let g:notes_suffix = '.notes'
630-
let g:notes_directories = ['~/Documents/Notes']
630+
let g:notes_directories = ['~/Documents/Notes']
631-
631+
632-
632+
633-
"}}}
633+
"}}}
634-
634+
635-
635+
636-
"}}}
636+
"}}}
637-
" TODOS -----------------------------------------------------------{{{
637+
" TODOS -----------------------------------------------------------{{{
638-
638+
639-
" Opens a files using gf (does not curently work)
639+
" Opens a files using gf (does not curently work)
640-
"set path+=**/src/main/**,**
640+
"set path+=**/src/main/**,**
641-
"set suffixesadd+=.js
641+
"set suffixesadd+=.js
642-
642+
643-
643+
644-
"turn off line wrapping when working on html files.
644+
"turn off line wrapping when working on html files.
645-
"autocmd BufNewFile,BufRead *.html setlocal nowrap
645+
"autocmd BufNewFile,BufRead *.html setlocal nowrap
646-
646+
647
" }}}