-
Notifications
You must be signed in to change notification settings - Fork 0
/
_vimrc
211 lines (169 loc) · 5.57 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
set nocompatible " be iMproved, required
filetype on
filetype off " required
autocmd BufEnter * silent! lcd %:p:h " automatically sets up the pwd for a file
" set the runtime path to include Vundle and initialize
call plug#begin('~/.vim/plugged')
" ready and stable
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'xuyuanp/nerdtree-git-plugin'
Plug 'junegunn/goyo.vim'
Plug 'pangloss/vim-javascript'
Plug 'vim-syntastic/syntastic'
Plug 'dracula/vim', { 'as': 'dracula' }
" neovim
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/playground'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe'
" dependencies
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
" telescope
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }
" testing new
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'rust-lang/rust.vim'
Plug 'junegunn/vim-easy-align'
Plug 'nvim-tree/nvim-tree.lua'
Plug 'nvim-tree/nvim-web-devicons'
" nice glyphs
" Plug 'ryanoasis/vim-devicons'
"new plugins testing
"Plug 'airblade/vim-rooter'
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
"Plug 'junegunn/fzf.vim'
"Plug 'shougo/vimproc.vim', {'do' : 'make'}
"Plug 'xolox/vim-misc'
"Plug 'xolox/vim-session'
"Plug 'OrangeT/vim-csharp'
"Plug 'ervandew/supertab'
"Plug 'tpope/vim-dispatch'
"Plug 'moll/vim-node'
"Plug 'majutsushi/tagbar'
"Plug 'scrooloose/nerdcommenter'
"Plug 'easymotion/vim-easymotion'
"Plug 'tpope/vim-repeat'
"Plug 'raimondi/delimitmate'
"Plug 'plasticboy/vim-markdown'
"Plug 'derekwyatt/vim-scala'
"Plug 'Shougo/unite.vim'
"Plug 'elzr/vim-json'
"Plug 'tpope/vim-fugitive'
"Plug 'pangloss/vim-javascript'
"Plug 'mxw/vim-jsx'
"Plug 'jistr/vim-nerdtree-tabs'
"Plug 'wincent/command-t'
"Plug 'christoomey/vim-tmux-navigator'
"Plug 'tpope/vim-sensible'
"Plug 'yggdroot/indentline'
"Plug 'mhinz/vim-startify'
"Plug 'parkr/vim-jekyll'
" test todo plugin http://vimawesome.com/?q=todo
"snippets
"Plug 'justingj/vim-react-snippets'
"Plug 'SirVer/ultisnips'
"Plug 'honza/vim-snippets'
"Not working yet
"Plug 'OmniSharp/omnisharp-vim'
"
"autocomplete
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
" For vsnip users.
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
call plug#end()
colorscheme dracula
" autocmd! BufWritePost * Neomake
" autocmd InsertChange,TextChanged * update | Neomake
" setting leader as space
let mapleader="\<Space>"
set encoding=utf8
set guifont=Monoscape:h11
"Airline setting theme
let g:airline_theme='bubblegum'
let g:airline_powerline_fonts = 1
" just to make sure that proper background from theme is used
set background=dark
"jsx plugin
let g:jsx_ext_required=0
imap kk <esc>
" vim-go
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_format_strings = 1
set clipboard=unnamedplus
" enables vim switch pane using CTRL hjkl which is in line with the tmux
" plugin to integrate vim and and i3wm
nnoremap <silent> <c-l> :call Focus('right', 'l')<CR>
nnoremap <silent> <c-h> :call Focus('left', 'h')<CR>
nnoremap <silent> <c-k> :call Focus('up', 'k')<CR>
nnoremap <silent> <c-j> :call Focus('down', 'j')<CR>
"telescope config
nnoremap <s-f>j <cmd>Telescope find_files<cr>
nnoremap <s-f>k <cmd>Telescope live_grep<cr>
nnoremap <s-f>b <cmd>Telescope buffers<cr>
"nvim tree
nnoremap <s-f>h <cmd>NvimTreeFocus<cr>
" NERDTree show hidden files like .babelrc .gitignore
let NERDTreeShowHidden=1
" open NERDTree automatically
" add shortcut to open NERDTree something like CTRL+TAB NERDTreeToogle
" doesnt work het with startify
" autocmd VimEnter * NERDTree
"
"" Align GitHub-flavored Markdown tables
au FileType markdown vmap <Leader><Bslash> :EasyAlign*<Bar><Enter>
set backspace=indent,eol,start
set tabstop=2 softtabstop=0 expandtab shiftwidth=2
" syntax ptions
syntax on
filetype plugin indent on
set noswapfile
" enabling line numbers and setting nice color which is non invasive
set number relativenumber
highlight LineNr ctermfg=239
"you need to specify args eslint default config is broken and doesnt read the
"errors properly
let g:neomake_javascript_eslint_maker = {
\ 'args':['--no-color', '--format', 'compact'],
\ 'exe': 'eslint',
\ 'errorformat': '%f: line %l\, col %c\, %m',
\ }
let g:neomake_javascript_enabled_makers = ['eslint']
let g:neomake_place_signs= 1
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --follow --color "always" '.shellescape(<q-args>), 1, <bang>0)
"golint
set rtp+=$GOPATH/src/golang.org/x/lint/misc/vim
autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow
"ctrlp
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_root_markers = ['.ctrlp']
let g:rooter_patterns = ['Rakefile', '.git/', 'DockerFile']
" dont spam echo
let g:rooter_silent_chdir = 1
"worth adding?
"https://github.com/junegunn/fzf.vim/issues/123
function! s:fzf_statusline()
" Override statusline as you like
highlight fzf1 ctermfg=161 ctermbg=251
highlight fzf2 ctermfg=23 ctermbg=251
highlight fzf3 ctermfg=237 ctermbg=251
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
endfunction
autocmd! User FzfStatusLine call <SID>fzf_statusline()
nmap gx :silent execute "!xdg-open " . shellescape("<cWORD>")<CR>