-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
163 lines (130 loc) · 4.05 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
syntax on
filetype plugin indent on
set autoindent
set encoding=utf-8
set nofixendofline
set clipboard=unnamed " Use the default OS Clipboard
set pastetoggle=<F2>
set ruler
set cursorline
set cursorcolumn
set relativenumber " Show in column relative number of line
set number " Show current line number
set tabstop=2
set shiftwidth=2 expandtab
"" Colors
set termguicolors
"" Highlight found search patterns
"set hlsearch
" Press jj to escape of insert mode
inoremap jj <Esc>
" vv to generate new vertical split
nnoremap <silent> vv <C-w>v
" ss to generate new horizontal split
nnoremap <silent> ss <C-w>s
" split sanity
set splitbelow
set splitright
"fzf Ag
nnoremap <C-g>g :Ag<CR>
"fzf Find
nnoremap <C-p> :Files<CR>
" on osx the <leader> key is \
nnoremap <leader><leader> :w<cr>
inoremap <leader><leader> <ESC>:w<cr>
nnoremap <tab><tab> :NERDTreeToggle<cr>
nnoremap <tab>m :NERDTreeFind<cr>
inoremap ;; <C-o>A;
inoremap ;;; <C-o>A;<cr>
inoremap ,, <C-o>A,
"ref: https://stackoverflow.com/questions/21888869/how-to-make-ctrlps-search-directory-change-according-to-nerdtrees-root
let g:NERDTreeChDirMode = 2
let g:ctrlp_working_path_mode = 'rw'
nnoremap <Leader>= :vertical resize +15<cr>
nnoremap <Leader>- :vertical resize -15<cr>
set backspace=indent,eol,start
let g:ctrlp_working_path_mode = 'w'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](bower_components|node_modules|mirage|tmp|_build|dist|deps)$',
\ }
""
"" Backup and swap files
""
set backupdir=~/.vim/_backup// " where to put backup files.
set directory=~/.vim/_temp// " where to put swap files.
""
"" mustache
""
let g:mustache_abbreviations = 1
""
"" htmlbars
""
""autocmd BufRead,BufNewFile *.js HighlightInlineHbs
let g:AutoPairsShortcutFastWrap = '<C-e>'
let g:mustache_abbreviations = 1
let g:vim_javascript_imports_map = '<Leader>e'
" ----------------------------------------------------------------------------
" ALE
" ----------------------------------------------------------------------------
nnoremap <Leader>ln :ALENextWrap<CR>
nnoremap <Leader>lp :ALEPreviousWrap<CR>
nnoremap <leader>p :ALEFix<CR>
autocmd FileType html.handlebars let g:ale_javascript_prettier_options = '--parser=glimmer'
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['eslint'],
\ 'css': ['stylelint'],
\ 'scss': ['stylelint'],
\ 'html': ['prettier'],
\ 'html.handlebars': ['prettier'],
\ 'markdown': ['prettier'],
\}
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'css': ['stylelint'],
\ 'scss': ['stylelint'],
\ 'html': [''],
\ 'html.handlebars': ['ember-template-lint'],
\}
" Set flags for gcc/clang
let cpp_opts = '-std=c++20 -Wall -Wextra'
let g:ale_linters = { 'cpp': ['cc', 'gcc', 'clang'] }
let g:ale_cpp_cc_options = cpp_opts
let g:ale_cpp_gcc_options = cpp_opts
let g:ale_cpp_clang_options = cpp_opts
let g:ale_sign_error = '🍄'
let g:ale_sign_warning = '🙀'
let g:fugitive_gitlab_domains = ['https://gitlab.qonto.co']
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o "Disable automatic comment insertion
"Start of vim-plug manager
call plug#begin()
Plug 'w0rp/ale'
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-surround'
Plug 'pangloss/vim-javascript'
Plug 'alexlafroscia/vim-ember-cli'
Plug 'vim-scripts/matchit.zip'
Plug 'mustache/vim-mustache-handlebars'
Plug 'joukevandermaas/vim-ember-hbs'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'jiangmiao/auto-pairs'
Plug 'mattn/emmet-vim'
Plug 'tomtom/tcomment_vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'slashmili/alchemist.vim'
Plug 'elixir-lang/vim-elixir'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'ap/vim-css-color'
Plug 'hail2u/vim-css3-syntax'
Plug 'heartsentwined/vim-emblem'
Plug 'tpope/vim-fugitive'
Plug 'shumphrey/fugitive-gitlab.vim'
Plug 'tpope/vim-rhubarb'
Plug 'junegunn/gv.vim'
Plug 'sukima/vim-javascript-imports'
Plug 'terryma/vim-multiple-cursors'
Plug 'dracula/vim'
Plug 'octol/vim-cpp-enhanced-highlight'
call plug#end()
"End vim-plug manager