configs/init.vim
init.vimRaw
1call plug#begin(expand('~/.config/nvim/plugged'))
2
3Plug 'scrooloose/nerdtree'
4Plug 'jistr/vim-nerdtree-tabs'
5Plug 'vim-airline/vim-airline'
6Plug 'vim-airline/vim-airline-themes'
7Plug 'airblade/vim-gitgutter'
8Plug 'Raimondi/delimitMate'
9Plug 'scrooloose/syntastic'
10Plug 'scrooloose/nerdcommenter'
11Plug 'majutsushi/tagbar'
12
13" go
14Plug 'fatih/vim-go' " Amazing combination of features.
15Plug 'godoctor/godoctor.vim' " Some refactoring tools
16
17" rust
18"" will need to install https://github.com/racer-rust/racer
19Plug 'racer-rust/vim-racer'
20Plug 'rust-lang/rust.vim'
21set hidden
22let g:racer_cmd = "/home/user/.cargo/bin/racer"
23let g:racer_experimental_completer = 1
24
25
26" javascript
27Plug 'jelera/vim-javascript-syntax'
28
29" python
30Plug 'davidhalter/jedi-vim'
31Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
32
33Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
34Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
35
36" colors
37Plug 'tomasr/molokai'
38Plug 'srcery-colors/srcery-vim'
39Plug 'rakr/vim-one'
40Plug 'morhetz/gruvbox'
41
42call plug#end()
43
44" setup
45
46" visual
47syntax on
48set ruler
49set number
50set title
51set titlestring=nvim-%F
52set t_Co=256
53set cursorline
54" colorscheme one
55" set background=dark
56
57"Credit joshdick
58"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
59"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
60"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
61if (empty($TMUX))
62 if (has("nvim"))
63 "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
64 let $NVIM_TUI_ENABLE_TRUE_COLOR=1
65 endif
66 "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
67 "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
68 " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
69 if (has("termguicolors"))
70 set termguicolors
71 endif
72endif
73
74set background=dark " for the dark version
75" set background=light " for the light version
76" colorscheme one
77colorscheme molokai
78
79if $COLORTERM == 'gnome-terminal'
80 set term=gnome-256color
81else
82 if $TERM == 'xterm'
83 set term=xterm-256color
84 endif
85endif
86
87set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
88
89" go
90let g:go_auto_sameids = 1
91
92" vim-airline
93"" let g:airline_theme = 'powerlineish'
94let g:airline_theme='one'
95let g:airline#extensions#syntastic#enabled = 1
96let g:airline#extensions#branch#enabled = 1
97let g:airline#extensions#tabline#enabled = 1
98let g:airline#extensions#tabline#buffer_nr_show = 1
99let g:airline#extensions#tagbar#enabled = 1
100let g:airline_skip_empty_sections = 1
101
102" abbreviations
103cnoreabbrev W! w!
104cnoreabbrev Q! q!
105cnoreabbrev Qall! qall!
106cnoreabbrev Wq wq
107cnoreabbrev Wa wa
108cnoreabbrev wQ wq
109cnoreabbrev WQ wq
110cnoreabbrev W w
111cnoreabbrev Q q
112cnoreabbrev Qall qall
113
114let g:deoplete#enable_at_startup = 1
115let g:srcery_italic = 1
116
117" NERDTree
118let NERDTreeShowHidden=1
119autocmd vimenter * NERDTree
120map <C-n> :NERDTreeToggle<CR>
121
122" NERDCommenter
123let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
124let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
125let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
126
127"" Switching windows
128noremap <C-j> <C-w>j
129noremap <C-k> <C-w>k
130noremap <C-l> <C-w>l
131noremap <C-h> <C-w>h
132
133" scroll
134set scrolloff=5 " keep at least 5 lines above/below
135set sidescrolloff=5 " keep at least 5 lines left/right
136
137
138" syntastic
139let g:syntastic_always_populate_loc_list=1
140let g:syntastic_error_symbol='✗'
141let g:syntastic_warning_symbol='⚠'
142let g:syntastic_style_error_symbol = '✗'
143let g:syntastic_style_warning_symbol = '⚠'
144let g:syntastic_auto_loc_list=1
145let g:syntastic_aggregate_errors = 1
146
147"" go config
148
149function! s:build_go_files()
150 let l:file = expand('%')
151 if l:file =~# '^\f\+\.go$'
152 call go#cmd#Build(0)
153 endif
154endfunction
155
156
157let g:go_list_type = "quickfix"
158let g:go_fmt_command = "goimports"
159let g:go_fmt_fail_silently = 1
160let g:syntastic_go_checkers = ['golint', 'govet']
161let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
162
163let g:go_highlight_types = 1
164let g:go_highlight_fields = 1
165let g:go_highlight_functions = 1
166let g:go_highlight_methods = 1
167let g:go_highlight_operators = 1
168let g:go_highlight_build_constraints = 1
169let g:go_highlight_structs = 1
170let g:go_highlight_generate_tags = 1
171let g:go_highlight_space_tab_error = 0
172let g:go_highlight_array_whitespace_error = 0
173let g:go_highlight_trailing_whitespace_error = 0
174let g:go_highlight_extra_types = 1
175
176"" esc mapping
177inoremap jk <ESC>
178tnoremap jk <C-\><C-n>