View difference between Paste ID: KQ7psYqB and V95HbSQ5
SHOW: | | - or go back to the newest paste.
1-
" -----------------------------------------------------------------------------
1+
" -----------------------------------------------------------------------------
2-
" Standard Vim settings
2+
" Standard Vim settings
3-
" -----------------------------------------------------------------------------
3+
" -----------------------------------------------------------------------------
4-
4+
5-
"
5+
"
6-
" General settings
6+
" General settings
7-
" -----------------------------------------------------------------------------
7+
" -----------------------------------------------------------------------------
8-
set nocompatible
8+
set nocompatible
9-
set ttyfast
9+
set ttyfast
10-
set lazyredraw
10+
set lazyredraw
11-
" Write files on make/GoBuild etc
11+
" Write files on make/GoBuild etc
12-
set autowrite
12+
set autowrite
13-
13+
14-
" Accept ^? as backspace char (allows remapping of C-h for moving to a left
14+
" Accept ^? as backspace char (allows remapping of C-h for moving to a left
15-
" split) - NOTE: Must set up terminal emulator to emit ^? when backspace is
15+
" split) - NOTE: Must set up terminal emulator to emit ^? when backspace is
16-
" pressed
16+
" pressed
17-
set t_kb=
17+
set t_kb=
18-
18+
19-
" vim-plug - handle required plugins
19+
" vim-plug - handle required plugins
20-
call plug#begin('~/.config/nvim/plugged')
20+
call plug#begin('~/.config/nvim/plugged')
21-
" Ui & theming
21+
" Ui & theming
22-
Plug 'altercation/vim-colors-solarized'
22+
Plug 'altercation/vim-colors-solarized'
23-
Plug 'itchyny/lightline.vim'
23+
Plug 'itchyny/lightline.vim'
24-
" Development
24+
" Development
25-
Plug 'airblade/vim-gitgutter'
25+
Plug 'airblade/vim-gitgutter'
26-
Plug 'fatih/vim-go'
26+
Plug 'fatih/vim-go'
27-
Plug 'elzr/vim-json'
27+
Plug 'elzr/vim-json'
28-
Plug 'tpope/vim-fugitive'
28+
Plug 'tpope/vim-fugitive'
29-
"Plug 'ekalinin/Dockerfile.vim'
29+
"Plug 'ekalinin/Dockerfile.vim'
30-
Plug 'majutsushi/tagbar'
30+
Plug 'majutsushi/tagbar'
31-
Plug 'tpope/vim-dispatch'
31+
Plug 'tpope/vim-dispatch'
32-
Plug 'radenling/vim-dispatch-neovim'
32+
Plug 'radenling/vim-dispatch-neovim'
33-
Plug 'w0rp/ale'
33+
Plug 'w0rp/ale'
34-
" Filetypes
34+
" Filetypes
35-
Plug 'elzr/vim-json'
35+
Plug 'elzr/vim-json'
36-
" Misc
36+
" Misc
37-
Plug 'SirVer/ultisnips'
37+
Plug 'SirVer/ultisnips'
38-
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
38+
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
39-
Plug 'zchee/deoplete-go', { 'do': 'make' }
39+
Plug 'zchee/deoplete-go', { 'do': 'make' }
40-
Plug 'ervandew/supertab'
40+
Plug 'ervandew/supertab'
41-
Plug 'junegunn/fzf', { 'dir': '~/.config/.fzf', 'do': './install --all' }
41+
Plug 'junegunn/fzf', { 'dir': '~/.config/.fzf', 'do': './install --all' }
42-
Plug 'junegunn/fzf.vim'
42+
Plug 'junegunn/fzf.vim'
43-
Plug 'jiangmiao/auto-pairs'
43+
Plug 'jiangmiao/auto-pairs'
44-
call plug#end()
44+
call plug#end()
45-
45+
46-
" Speed up update interval 
46+
" Speed up update interval 
47-
set updatetime=100
47+
set updatetime=100
48-
48+
49-
" Set new leader
49+
" Set new leader
50-
let mapleader=","
50+
let mapleader=","
51-
51+
52-
" Allow backspacing over everything in insert mode
52+
" Allow backspacing over everything in insert mode
53-
set backspace=indent,eol,start
53+
set backspace=indent,eol,start
54-
54+
55-
" Highlight searches & set incremental searching 
55+
" Highlight searches & set incremental searching 
56-
set hlsearch incsearch 
56+
set hlsearch incsearch 
57-
57+
58-
" Disable backups & swaps 
58+
" Disable backups & swaps 
59-
set nobackup
59+
set nobackup
60-
set noswapfile
60+
set noswapfile
61-
61+
62-
" indent by multiples of tabstop
62+
" indent by multiples of tabstop
63-
set shiftround
63+
set shiftround
64-
64+
65-
" Tree-style listing in netrw
65+
" Tree-style listing in netrw
66-
let g:netrw_liststyle=3
66+
let g:netrw_liststyle=3
67-
67+
68-
"
68+
"
69-
" Key (re)mappings
69+
" Key (re)mappings
70-
" -----------------------------------------------------------------------------
70+
" -----------------------------------------------------------------------------
71-
71+
72-
" Move up/down per terminal line, not file line (for wrapped lines)
72+
" Move up/down per terminal line, not file line (for wrapped lines)
73-
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
73+
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
74-
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
74+
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
75-
" Disable cursor keys in normal & insert mode
75+
" Disable cursor keys in normal & insert mode
76-
"noremap <up> <nop>
76+
"noremap <up> <nop>
77-
"noremap <down> <nop>
77+
"noremap <down> <nop>
78-
"noremap <left> <nop>
78+
"noremap <left> <nop>
79-
"noremap <right> <nop>
79+
"noremap <right> <nop>
80-
"inoremap <up> <nop>
80+
"inoremap <up> <nop>
81-
"inoremap <down> <nop>
81+
"inoremap <down> <nop>
82-
"inoremap <left> <nop>
82+
"inoremap <left> <nop>
83-
"inoremap <right> <nop>
83+
"inoremap <right> <nop>
84-
84+
85-
" Change window movement keys slightly
85+
" Change window movement keys slightly
86-
map <C-H> <C-W><C-H>
86+
map <C-H> <C-W><C-H>
87-
map <C-J> <C-W><C-J>
87+
map <C-J> <C-W><C-J>
88-
map <C-K> <C-W><C-K>
88+
map <C-K> <C-W><C-K>
89-
map <C-L> <C-W><C-L>
89+
map <C-L> <C-W><C-L>
90-
tnoremap <C-h> <C-\><C-N><C-w>h
90+
tnoremap <C-h> <C-\><C-N><C-w>h
91-
tnoremap <C-j> <C-\><C-N><C-w>j
91+
tnoremap <C-j> <C-\><C-N><C-w>j
92-
tnoremap <C-k> <C-\><C-N><C-w>k
92+
tnoremap <C-k> <C-\><C-N><C-w>k
93-
tnoremap <C-l> <C-\><C-N><C-w>l
93+
tnoremap <C-l> <C-\><C-N><C-w>l
94-
94+
95-
" Highlight terminal cursor differently to editing cursor
95+
" Highlight terminal cursor differently to editing cursor
96-
highlight TermCursor ctermfg=red guifg=red
96+
highlight TermCursor ctermfg=red guifg=red
97-
set splitbelow
97+
set splitbelow
98-
set splitright
98+
set splitright
99-
99+
100-
" jj to ESC back to Normal mode; quicker than reaching for ESC 
100+
" jj to ESC back to Normal mode; quicker than reaching for ESC 
101-
inoremap jj <ESC>
101+
inoremap jj <ESC>
102-
102+
103-
" Alt-[jk] for move current line up/down (also in visual block mode)
103+
" Alt-[jk] for move current line up/down (also in visual block mode)
104-
nnoremap <A-j> :m+<CR>==
104+
nnoremap <A-j> :m+<CR>==
105-
nnoremap <A-k> :m-2<CR>==
105+
nnoremap <A-k> :m-2<CR>==
106-
vnoremap <A-j> :m'>+<CR>gv=gv
106+
vnoremap <A-j> :m'>+<CR>gv=gv
107-
vnoremap <A-k> :m-2<CR>gv=gv
107+
vnoremap <A-k> :m-2<CR>gv=gv
108-
108+
109-
" Alt-[hl] for indenting in and back (also in visual block mode)
109+
" Alt-[hl] for indenting in and back (also in visual block mode)
110-
nnoremap <A-h> <<
110+
nnoremap <A-h> <<
111-
nnoremap <A-l> >>
111+
nnoremap <A-l> >>
112-
vnoremap <A-h> <gv
112+
vnoremap <A-h> <gv
113-
vnoremap <A-l> >gv
113+
vnoremap <A-l> >gv
114-
114+
115-
"
115+
"
116-
" General UI settings
116+
" General UI settings
117-
" -----------------------------------------------------------------------------
117+
" -----------------------------------------------------------------------------
118-
set number
118+
set number
119-
"set relativenumber
119+
"set relativenumber
120-
"autocmd InsertEnter * :set number
120+
"autocmd InsertEnter * :set number
121-
"autocmd InsertLeave * :set relativenumber
121+
"autocmd InsertLeave * :set relativenumber
122-
set laststatus=2
122+
set laststatus=2
123-
set ruler
123+
set ruler
124-
set tabstop=2
124+
set tabstop=2
125-
set shiftwidth=2
125+
set shiftwidth=2
126-
set expandtab
126+
set expandtab
127-
set cursorline
127+
set cursorline
128-
set fillchars+=vert:\ 
128+
set fillchars+=vert:\ 
129-
129+
130-
" Highlight all chars past col 100 to encourage line breaks; "Float" defaults
130+
" Highlight all chars past col 100 to encourage line breaks; "Float" defaults
131-
" to red in neodark theme
131+
" to red in neodark theme
132-
"call matchadd('Float', '\%101v.\+', 100)
132+
"call matchadd('Float', '\%101v.\+', 100)
133-
133+
134-
"
134+
"
135-
" Theme settings 
135+
" Theme settings 
136-
" -----------------------------------------------------------------------------
136+
" -----------------------------------------------------------------------------
137-
"set background=dark
137+
"set background=dark
138-
colorscheme solarized
138+
colorscheme solarized
139-
syntax on
139+
syntax on
140-
140+
141-
"
141+
"
142-
" Vim-go 
142+
" Vim-go 
143-
" -----------------------------------------------------------------------------
143+
" -----------------------------------------------------------------------------
144-
let g:go_highlight_functions=1  
144+
let g:go_highlight_functions=1  
145-
let g:go_highlight_methods=0  
145+
let g:go_highlight_methods=0  
146-
let g:go_highlight_structs=1  
146+
let g:go_highlight_structs=1  
147-
let g:go_highlight_operators=0
147+
let g:go_highlight_operators=0
148-
let g:go_highlight_interfaces=1
148+
let g:go_highlight_interfaces=1
149-
let g:go_highlight_build_constraints=1
149+
let g:go_highlight_build_constraints=1
150-
let g:go_fmt_command="goimports"
150+
let g:go_fmt_command="goimports"
151-
let g:go_auto_sameids=1
151+
let g:go_auto_sameids=1
152-
let g:go_metalinter_autosave=1
152+
let g:go_metalinter_autosave=1
153-
let g:go_auto_type_info=1
153+
let g:go_auto_type_info=1
154-
"let g:go_snippet_engine='neosnippet'
154+
"let g:go_snippet_engine='neosnippet'
155-
let g:go_list_height=10
155+
let g:go_list_height=10
156-
"let g:go_list_type="quickfix"
156+
"let g:go_list_type="quickfix"
157-
"let g:go_fmt_fail_silently=1
157+
"let g:go_fmt_fail_silently=1
158-
158+
159-
" Map <leader>t to GoTest
159+
" Map <leader>t to GoTest
160-
autocmd FileType go nmap <leader>t  <Plug>(go-test)
160+
autocmd FileType go nmap <leader>t  <Plug>(go-test)
161-
" Map <leader>c to GoCoverageToggle
161+
" Map <leader>c to GoCoverageToggle
162-
autocmd FileType go nmap <leader>c  <Plug>(go-coverage-toggle)
162+
autocmd FileType go nmap <leader>c  <Plug>(go-coverage-toggle)
163-
" Map <leader>a to GoAlternate
163+
" Map <leader>a to GoAlternate
164-
autocmd FileType go nmap <leader>a  <Plug>(go-alternate) 
164+
autocmd FileType go nmap <leader>a  <Plug>(go-alternate) 
165-
165+
166-
let g:go_metalinter_enabled = ['vet', 'golint', 'gosimple', 'errcheck']
166+
let g:go_metalinter_enabled = ['vet', 'golint', 'gosimple', 'errcheck']
167-
167+
168-
"
168+
"
169-
" lightline 
169+
" lightline 
170-
" -----------------------------------------------------------------------------
170+
" -----------------------------------------------------------------------------
171-
let g:lightline = {
171+
let g:lightline = {
172-
  \ 'colorscheme': 'solarized',
172+
  \ 'colorscheme': 'solarized',
173-
  \ 'active': {
173+
  \ 'active': {
174-
  \    'left': [ ['mode', 'paste'],
174+
  \    'left': [ ['mode', 'paste'],
175-
  \              ['gitbranch', 'readonly', 'filename', 'modified'] ]
175+
  \              ['gitbranch', 'readonly', 'filename', 'modified'] ]
176-
  \  },
176+
  \  },
177-
  \  'component_function': {
177+
  \  'component_function': {
178-
  \    'gitbranch': 'fugitive#head'
178+
  \    'gitbranch': 'fugitive#head'
179-
  \  },
179+
  \  },
180-
  \ }
180+
  \ }
181-
181+
182-
" Disable mode display, as it's part of the status bar in standard themes
182+
" Disable mode display, as it's part of the status bar in standard themes
183-
set noshowmode
183+
set noshowmode
184-
184+
185-
"
185+
"
186-
" Tagbar
186+
" Tagbar
187-
" -----------------------------------------------------------------------------
187+
" -----------------------------------------------------------------------------
188-
"nmap <leader>b :TagbarToggle<CR>
188+
"nmap <leader>b :TagbarToggle<CR>
189-
189+
190-
" General UI config
190+
" General UI config
191-
let g:tagbar_left=1
191+
let g:tagbar_left=1
192-
let g:tagbar_width = 35
192+
let g:tagbar_width = 35
193-
193+
194-
" Configuration for Golang, using gotags
194+
" Configuration for Golang, using gotags
195-
let g:tagbar_type_go = {
195+
let g:tagbar_type_go = {
196-
    \ 'ctagstype' : 'go',
196+
    \ 'ctagstype' : 'go',
197-
    \ 'kinds'     : [
197+
    \ 'kinds'     : [
198-
        \ 'p:package',
198+
        \ 'p:package',
199-
        \ 'i:imports:1',
199+
        \ 'i:imports:1',
200-
        \ 'c:constants',
200+
        \ 'c:constants',
201-
        \ 'v:variables',
201+
        \ 'v:variables',
202-
        \ 't:types',
202+
        \ 't:types',
203-
        \ 'n:interfaces',
203+
        \ 'n:interfaces',
204-
        \ 'w:fields',
204+
        \ 'w:fields',
205-
        \ 'e:embedded',
205+
        \ 'e:embedded',
206-
        \ 'm:methods',
206+
        \ 'm:methods',
207-
        \ 'r:constructor',
207+
        \ 'r:constructor',
208-
        \ 'f:functions'
208+
        \ 'f:functions'
209-
    \ ],
209+
    \ ],
210-
    \ 'sro' : '.',
210+
    \ 'sro' : '.',
211-
    \ 'kind2scope' : {
211+
    \ 'kind2scope' : {
212-
        \ 't' : 'ctype',
212+
        \ 't' : 'ctype',
213-
        \ 'n' : 'ntype'
213+
        \ 'n' : 'ntype'
214-
    \ },
214+
    \ },
215-
    \ 'scope2kind' : {
215+
    \ 'scope2kind' : {
216-
        \ 'ctype' : 't',
216+
        \ 'ctype' : 't',
217-
        \ 'ntype' : 'n'
217+
        \ 'ntype' : 'n'
218-
    \ },
218+
    \ },
219-
    \ 'ctagsbin'  : 'gotags',
219+
    \ 'ctagsbin'  : 'gotags',
220-
    \ 'ctagsargs' : '-sort -silent'
220+
    \ 'ctagsargs' : '-sort -silent'
221-
\ }
221+
\ }
222-
222+
223-
autocmd VimEnter * nested :call tagbar#autoopen(1)
223+
autocmd VimEnter * nested :call tagbar#autoopen(1)
224-
autocmd FileType * nested :call tagbar#autoopen(0)
224+
autocmd FileType * nested :call tagbar#autoopen(0)
225-
225+
226-
"
226+
"
227-
" Deoplete
227+
" Deoplete
228-
" -----------------------------------------------------------------------------
228+
" -----------------------------------------------------------------------------
229-
let g:deoplete#enable_at_startup = 1
229+
let g:deoplete#enable_at_startup = 1
230-
let g:deoplete#max_list = 10
230+
let g:deoplete#max_list = 10
231-
let g:deoplete#max_menu_width = 20
231+
let g:deoplete#max_menu_width = 20
232-
232+
233-
" Switch tab ordering, so from top of completion list down; map to tab/shift-tab
233+
" Switch tab ordering, so from top of completion list down; map to tab/shift-tab
234-
234+
235-
"
235+
"
236-
" Deoplete-go
236+
" Deoplete-go
237-
" -----------------------------------------------------------------------------
237+
" -----------------------------------------------------------------------------
238-
let g:deoplete#sources#go#gocode_binary=$GOPATH.'/bin/gocode'
238+
let g:deoplete#sources#go#gocode_binary=$GOPATH.'/bin/gocode'
239-
239+
240-
"
240+
"
241-
" Neosnippets 
241+
" Neosnippets 
242-
" -----------------------------------------------------------------------------
242+
" -----------------------------------------------------------------------------
243-
" Use Tab to jump between placehoders
243+
" Use Tab to jump between placehoders
244-
"imap <Tab> <Plug>(neosnippet_expand_or_jump)
244+
"imap <Tab> <Plug>(neosnippet_expand_or_jump)
245-
"smap <Tab> <Plug>(neosnippet_expand_or_jump)
245+
"smap <Tab> <Plug>(neosnippet_expand_or_jump)
246-
"xmap <Tab> <Plug>(neosnippet_expand_target)
246+
"xmap <Tab> <Plug>(neosnippet_expand_target)
247-
247+
248-
"
248+
"
249-
" ale
249+
" ale
250-
" -----------------------------------------------------------------------------
250+
" -----------------------------------------------------------------------------
251-
" Error and warning signs.
251+
" Error and warning signs.
252-
let g:ale_sign_error = '▶▶'
252+
let g:ale_sign_error = '▶▶'
253-
let g:ale_sign_warning = '▶▶'
253+
let g:ale_sign_warning = '▶▶'
254-
let g:ale_sign_column_always = 1
254+
let g:ale_sign_column_always = 1
255-
let g:ale_lint_on_text_changed = 'always'
255+
let g:ale_lint_on_text_changed = 'always'
256-
"
256+
"
257-
" fzf-vim
257+
" fzf-vim
258-
" -----------------------------------------------------------------------------
258+
" -----------------------------------------------------------------------------
259-
imap <c-x><c-o> <plug>(fzf-complete-line)
259+
imap <c-x><c-o> <plug>(fzf-complete-line)
260-
map <leader>b :Buffers<cr>
260+
map <leader>b :Buffers<cr>
261-
map <leader>f :Files<cr>
261+
map <leader>f :Files<cr>
262-
map <leader>g :GFiles<cr>
262+
map <leader>g :GFiles<cr>
263-
"map <leader>t :Tags<cr>
263+
"map <leader>t :Tags<cr>
264-
264+
265-
let g:fzf_layout = { 'down': '~20%' }
265+
let g:fzf_layout = { 'down': '~20%' }
266-
266+
267-
" Customize fzf colors to match theme
267+
" Customize fzf colors to match theme
268-
let g:fzf_colors = {
268+
let g:fzf_colors = {
269-
    \ 'bg':          ['bg', 'CursorLine'],
269+
    \ 'bg':          ['bg', 'CursorLine'],
270-
    \ 'bg+':         ['bg', 'CursorLine'],
270+
    \ 'bg+':         ['bg', 'CursorLine'],
271-
    \ 'info':        ['fg', 'Keyword'],
271+
    \ 'info':        ['fg', 'Keyword'],
272-
    \ 'prompt':      ['fg', 'Function', 'Bold'],
272+
    \ 'prompt':      ['fg', 'Function', 'Bold'],
273-
    \ 'marker':      ['fg', 'Float', 'Bold'],
273+
    \ 'marker':      ['fg', 'Float', 'Bold'],
274-
    \ 'hl':          ['fg', 'Float', 'Bold'],
274+
    \ 'hl':          ['fg', 'Float', 'Bold'],
275-
    \ 'hl+':         ['fg', 'Float', 'Bold'],
275+
    \ 'hl+':         ['fg', 'Float', 'Bold'],
276-
    \ 'header':      ['bg', 'CursorLine']
276+
    \ 'header':      ['bg', 'CursorLine']
277-
\ }
277+
\ }
278-
278+
279-
"
279+
"
280-
" gitgutter
280+
" gitgutter
281-
" -----------------------------------------------------------------------------
281+
" -----------------------------------------------------------------------------
282-
let g:gitgutter_sign_added = '┃'
282+
let g:gitgutter_sign_added = '┃'
283-
let g:gitgutter_sign_modified = '┃'
283+
let g:gitgutter_sign_modified = '┃'
284
let g:gitgutter_sign_removed = '┃'