-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
executable file
·145 lines (121 loc) · 3.8 KB
/
init.vim
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
" Mostly stolen from https://github.com/ElmCast/.vim
" Plugins
call plug#begin()
Plug 'altercation/vim-colors-solarized'
Plug 'vim-airline/vim-airline'
Plug 'elmcast/elm-vim'
Plug 'jszakmeister/vim-togglecursor'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'Yggdroot/indentLine'
Plug 'ntpeters/vim-better-whitespace'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'tpope/vim-fugitive'
Plug 'shumphrey/fugitive-gitlab.vim'
Plug 'scrooloose/nerdcommenter'
" Leap
Plug 'tpope/vim-repeat'
Plug 'ggandor/leap.nvim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'wokalski/autocomplete-flow'
" For func argument completion
Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets'
Plug 'takkii/Bignyanco'
Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-rails'
Plug 'w0rp/ale'
Plug 'kchmck/vim-coffee-script'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-endwise'
Plug 'janko-m/vim-test'
Plug 'mattn/emmet-vim'
Plug 'mxw/vim-jsx'
Plug 'pangloss/vim-javascript'
Plug 'tpope/vim-eunuch'
Plug 'editorconfig/editorconfig-vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'mhartington/nvim-typescript', { 'do': './install.sh' }
Plug 'posva/vim-vue'
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'tpope/vim-rhubarb'
call plug#end()
" General
let mapleader=" "
let maplocalleader=" "
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
set fillchars+=vert:\
set number
set ignorecase
set noswapfile
set completeopt=longest,menuone
set hidden " So that we can easily switch buffers without the bang when there are unsaved changes.
" Solorize
set background=dark
colorscheme solarized
" FZF settings
nnoremap <c-p> :FZF<cr>
nnoremap <leader>b :Buffers<cr>
" Taken from https://github.com/junegunn/fzf.vim/issues/27#issuecomment-185761539
function! s:ag_in(...)
call fzf#vim#ag(join(a:000[1:], ' '), {'dir': a:1})
endfunction
command! -nargs=+ -complete=dir AgIn call s:ag_in(<f-args>)
" tab navigation like firefox
map <C-X> <ESC>:tabnext<CR>
map <C-Z> <ESC>:tabprevious<CR>
" Fix for proper copying to clipboard
" https://vi.stackexchange.com/questions/14486/what-does-it-mean-to-set-clipboard-unnamed#comment51393_17058
set clipboard+=unnamedplus
" Copy to system clipboard
vnoremap <leader>y "+y
" Airline
let g:airline_left_sep= '░'
let g:airline_right_sep= '░'
" NerdTree
map <LEADER>f :NERDTreeTabsToggle<CR>
let g:NERDTreeWinSize = 24
let g:NERDTreeMinimalUI = 1
" Deoplete
let g:deoplete#enable_at_startup = 1
let g:neosnippet#enable_completed_snippet = 1
" Make sure to point this to the latest installed python version
let g:python3_host_prog = '~/.asdf/shims/python'
call deoplete#custom#option('omni_patterns', {
\ 'go': '[^. *\t]\.\w*',
\})
" Vim Test
let test#strategy = "neovim"
nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>l :TestLast<CR>
nmap <silent> <leader>g :TestVisit<CR>
" ale
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
nmap <silent> <leader>ad <Plug>(ale_detail)
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['eslint'],
\}
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'ruby': ['rubocop'],
\ 'markdown': ['vale', 'mardownlint'],
\}
let g:ale_linters_explicit = 1
let g:ale_fix_on_save = 1
" Ruby
let g:ale_ruby_rubocop_executable = 'bundle'
" Vim JSX and JavaScript
let g:jsx_ext_required = 0
let g:javascript_plugin_flow = 1
" Vim Go
let g:go_fmt_command = 'goimports' " Run goimports along gofmt on each save
let g:go_auto_type_info = 1 " Automatically get signature/type info for object under cursor
" Leap
lua require('leap').add_default_mappings()