-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
114 lines (84 loc) · 2.28 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
" Plugins {
call plug#begin('~/.config/nvim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'edkolev/tmuxline.vim'
Plug 'tyrannicaltoucan/vim-quantum'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'ervandew/supertab'
Plug 'ianks/vim-tsx'
Plug 'hesselbom/vim-hsftp'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'jremmen/vim-ripgrep'
Plug 'posva/vim-vue'
" pug syntax
Plug 'digitaltoad/vim-pug'
call plug#end()
" }
" Color & Themes {
syntax enable
set background=dark
set termguicolors
" colorscheme Tomorrow-Night-Eighties
colorscheme quantum
" }
" Customizations {
filetype plugin on
filetype indent on
" show command on key bottom right
set showcmd
" show relative line number
set relativenumber number
" switch tab to 2 whitespaces
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set smartindent
" Horizontal split below current. Vertical split to right of current.
set splitbelow splitright
set noswapfile
set hidden
" Make searching case insensitive unless the query has capital letter
set ignorecase smartcase
" Show next 3 lines while scrolling
if !&scrolloff
set scrolloff=3
endif
" Show next 5 columns while moving off
if !&sidescrolloff
set sidescrolloff=5
endif
" add - to key word
set iskeyword+=-
" automatically remove all trailing whitespace before saving
autocmd BufWritePre * %s/\s\+$//e
" <enter>/<shift-enter> to add a line in normal mode
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
" <esc> to cancel search highlight
nnoremap <esc> :noh<return><esc>
" Map ; to :, one less ketstroke
nnoremap ; :
" leader + ew, es, ev, et to open a file in the same directory
cnoremap %% <C-R>=fnameescape(expand('%:h')).'/'<cr>
map <leader>ew :e %%
map <leader>es :sp %%
map <leader>ev :vsp %%
map <leader>et :tabe %%
map <leader>eew :e **/*
map <leader>eev :vsp **/*
map <leader>eet :tabe **/*
" nerdtreetoggle
" map <C-n> :NERDTreeToggle<CR>
" Don't offer to open certain files/directories
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png,*.ico
set wildignore+=*.pdf,*.psd
set wildignore+=node_modules/*,bower_components/*
autocmd BufNewFile,BufRead *.tsx set syntax=javascript.jsx
" Use deoplete.
let g:deoplete#enable_at_startup = 1
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" }