-
Notifications
You must be signed in to change notification settings - Fork 5
/
vimrc
141 lines (103 loc) · 2.93 KB
/
vimrc
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
" Plug for plugins
call plug#begin('~/.vim/plugged')
" Ruby/Rails highlighting + helpers
Plug 'vim-ruby/vim-ruby', { 'for': 'ruby' }
Plug 'thoughtbot/vim-rspec', { 'for': 'ruby' }
" All the colorschemes
Plug 'flazz/vim-colorschemes'
" File navigation
Plug 'ctrlpvim/ctrlp.vim'
" Git Commands
Plug 'tpope/vim-fugitive'
" Lets do go development
Plug 'fatih/vim-go'
" Nevoim specific plugins
Plug 'benekastah/neomake'
" Pairs of handy bracket mappings
Plug 'tpope/vim-unimpaired'
" Make commenting easier
Plug 'tpope/vim-commentary'
" improved Javascript indentation and syntax
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
" make netrw way better
Plug 'tpope/vim-vinegar'
" adds airline for bottom status bar
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" the git gutter for changes
Plug 'airblade/vim-gitgutter'
" hcl syntax
Plug 'fatih/vim-hclfmt'
" ultisnips
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" fzf
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
call plug#end()
" Syntax highlighting FTW
syntax on
" Set background to dark for base16
set background=dark
" Set colorscheme to hybrid
colorscheme hybrid
" Move swp to a standard location
set directory=/tmp
" Setting Spacing and Indent (plus line no)
set nu
set tabstop=2 shiftwidth=2 expandtab
set ts=2
set nowrap
" Remap the leader key
:let mapleader = ','
" Run neomake, it's like syntastic
autocmd! BufWritePost * Neomake
" yank to clipboard alias
vnoremap <leader>y "*y
" Set 256 colors
set t_Co=256
set guifont=Inconsolata:h16
set listchars=tab:\ \ ,trail:█
set list
" Go Declaration
au FileType go nmap gd <Plug>(go-def)
let g:go_fmt_command = "goimports"
" Turn on go-implements
au FileType go nmap <Leader>s <Plug>(go-implements)
" Turn on go-rename
au FileType go nmap <Leader>e <Plug>(go-rename)
" Open test file in new window
au FileType go nmap <Leader>a :vsp<CR>:GoAlternate<CR>
" Make YAML Great Again
autocmd FileType yaml setlocal indentexpr=
" Amp up the syntax highlighting in vim-go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
inoremap <s-tab> <c-n>
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
set runtimepath+=~/.vim
" Clear search results
nnoremap <silent> <space> :nohlsearch<CR>
" fzf
nnoremap <leader>f :FZF<CR>
" Yank to system clipboard
nnoremap <leader>y "*y