-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
155 lines (136 loc) · 4.03 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
set nocompatible " be iMproved, required
set ttyfast
filetype plugin on " required
syntax on
set mouse=a
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Plugins
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-commentary' " gc to comment out
Plugin 'pangloss/vim-javascript'
Plugin 'ctrlpvim/ctrlp.vim'
let g:ctrlp_working_path_mode = 0 " make ctrlp work from current dir
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'luochen1990/rainbow'
Plugin 'kana/vim-textobj-user'
Plugin 'kana/vim-textobj-line'
Plugin 'kana/vim-textobj-entire'
Plugin 'szw/vim-g'
Plugin 'jiangmiao/auto-pairs'
Plugin 'fatih/vim-go' " golang development
Plugin 'jamesroutley/vim-logbook'
Plugin 'sheerun/vim-polyglot' " syntax highlighting in most languages
Plugin 'joshdick/onedark.vim' " Atom-style dark theme
Plugin 'scrooloose/nerdcommenter'
Plugin 'valloric/youcompleteme'
Plugin 'preservim/nerdtree'
Plugin 'dense-analysis/ale'
Plugin 'vimwiki/vimwiki'
Plugin 'hugolgst/vimsence'
Plugin 'powerline/powerline'
Plugin 'morhetz/gruvbox'
" All of your Plugins must be added before the following line
call vundle#end()
filetype plugin indent on
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|target\|dist'
" --------------------------------
" Pretty things
" --------------------------------
"autocmd VimEnter * NERDTree
" autocmd BufEnter * NERDTreeMirror
nmap <silent> <C-t> :NERDTreeToggle<CR>
nmap <silent> <F2> :NERDTreeFind<CR>
syntax on
set background=dark
colorscheme gruvbox
let g:ycm_python_binary_path = 'python3'
" Set Airline bar theme
let g:airline_theme='bubblegum'
"rainbow Plugin Options (luochen1990/rainbow)
let g:rainbow_active = 1 " 0 if you want to enable it later via :RainbowToggle
" Colour at column 80
set colorcolumn=80
" --------------------------------
" Basic stuff
" --------------------------------
let g:mapleader = " " " Set leader to spacebar
set spelllang=en_gb
set backspace=indent,eol,start " Bring backspace to life
set number " Line numbers
set relativenumber " Relative line numbers
set hlsearch " Highlight whole word when searching
set ignorecase " Ignore case when searching...
set smartcase " ...except when serach query contains a capital letter
set autoread " Auto load files if they change on disc
map <Leader>p :set paste<CR><esc>"*]p:set nopaste<cr>
map <Leader>y "*y )
map <Leader><Leader> :w<CR>
inoremap jj <ESC>:w<CR>
" Pasting - indent last pasted
nnoremap gz '[=']
let g:vue_pre_processors = []
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><ESC> :noh<cr>
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\ 'vue': ['eslint'],
\ 'typescript': ['tslint']
\ }
let g:ale_sign_error = '❌'
let g:ale_completion_tsserver_autoimport = 1
let g:ale_sign_warning = '⚠️'
let g:ale_fix_on_save = 1
"Cursor
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Open current file in a new vertical split with '='
nnoremap = :vsplit<cr>
" Easy split navigation
map <C-j> <C-w>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Simplify using tabs
nnoremap ˙ gT
nnoremap ¬ gt
nnoremap T :tabnew<cr>
" Open new splits to right and bottom
set splitbelow
set splitright
"Tab completion
set wildmenu
set wildmode=list:longest,list:full
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>
" Tab size
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set cc=
" Disable swap files
set noswapfile
" Disable arrow keys in Escape mode
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>