-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
187 lines (157 loc) · 5.09 KB
/
.vimrc
File metadata and controls
187 lines (157 loc) · 5.09 KB
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
so ~/.vim/plugins.vim
" GUI Settings -------------
set guifont=Hack\ 14
set guioptions=-m
set guioptions=-T
set guioptions=-r
" Interface Options ----------
vnoremap <leader>y "+y
map <leader>P "+P
set number relativenumber
set nu rnu
set wildmenu
set cursorline
set mouse=a
set title
set path=+**
set t_Co=256
" Change color Scheme --------
colorscheme gruvbox
set background=dark
let g:gruvbox_italic=1
let g:gruvbox_bold=1
let g:gruvbox_contrast_dark='medium'
let g:gruvbox_contrast_light='hard'
" Change the leader ------------
let mapleader=","
" Indentation Options --------------
set autoindent
set expandtab
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
" Search Options ---------------
set hlsearch
set incsearch
set smartcase
" Rendering Options --------------
set encoding=utf-8
set linebreak
syntax enable
set wrap
" VimGrep bindings -----------
nmap <silent> <C-N> :cn<CR>zv
nmap <silent> <C-P> :cp<CR>zv
" Folding Options ----------
set foldnestmax=3
set foldmethod=indent
set nofoldenable
let javascript_fold=1 " Javascript
let r_syntax_folding=1 " R
let sh_fold_enabled=1 " sh
let g:vim_markdown_folding_level=6
let g:vim_markdown_frontmatter=1
let g:vim_markdown_toml_frontmatter=1
let g:vim_markdown_new_item_indent=2
let g:pandoc#folding#fold_yaml=1
" Powerline status bar ------------
set laststatus=2
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#buffer_nr_show=1
let g:airline#extensions#branch#enabled=1
" Binding for nerdtree ----------
autocmd VimEnter * wincmd p
map <leader>f :NERDTreeToggle<CR>
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
autocmd bufenter * if (winnr("$")==1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let NERDTreeIgnore=['node_module*', '\.cache']
nnoremap <silent> <Leader>v :NERDTreeFind<CR>
" Ranger Setup ---------
map <leader>r :Ranger<CR>
let g:NERDTreeHijackNetrw=0
let g:ranger_replace_netrw=1
let g:ranger_map_keys=0
let g:ranger_command_override='ranger --cmd "set show_hidden=true"'
" Emmet redefine in all modes ----------
let g:user_emmet_mode='a'
" Easy Align Setup ---------------
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
" REPL Settings ----------------
nnoremap <leader>R :REPLToggle<Cr>
autocmd Filetype python nnoremap <C-F12> <Esc>:REPLDebugStopAtCurrentLine<Cr>
autocmd Filetype python nnoremap <C-F10> <Esc>:REPLPDBN<Cr>
autocmd Filetype python nnoremap <C-F11> <Esc>:REPLPDBS<Cr>
let g:repl_program={
\ 'python': 'ipython',
\ 'default': 'tmux',
\ 'r': 'R',
\ 'vim': 'vim -e'}
let g:repl_console_name='RimalayaREPL'
" Formatters ---------------
au FileType javascript setlocal formatprg=prettier
au FileType javascript.jsx setlocal formatprg=prettier
au FileType typescript setlocal formatprg=prettier\ --parser\ typescript
au FileType html setlocal formatprg=js-beautify\ --type\ html
au FileType scss setlocal formatprg=prettier\ --parser\ css
au FileType css setlocal formatprg=prettier\ --parser\ css
nnoremap <F5> mzgggqG`z
" LaTeX Configuration
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
let g:vim_jsx_pretty_colorful_config=1
let g:vim_jsx_pretty_template_tags=['html', 'jsx']
" Snippet Configuration ---------------------
let g:UltiSnipsSnippetDirectories=["UltiSnips"]
let g:UltiSnipsExpandTrigger="<TAB>"
let g:UltiSnipsJumpForwardTrigger="<C-n>"
let g:UltiSnipsJumpBackwardTrigger="<C-p>"
nnoremap <leader>es :UltiSnipsEdit<CR>
" LaTeX Configuration ----------------------
filetype plugin on
filetype indent on
let g:vimtex_quickfix_mode=0
let g:tex_conceal='abdmg'
set conceallevel=1
hi Conceal ctermbg=none
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_CompileRule_pdf = 'latexmk -pdf'
let g:TCLevel=4
let g:tex_flavor='latex'
let g:Tex_GotoError=0
" Easily moving between windows --------------
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
" Fuzzy Find Settings --------------
nnoremap <silent> <leader><leader> :Files<CR>
let g:fzf_preview_window='right:60%'
let g:fzf_buffers_jump=1
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
" Mapping selecting mappings
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-l> <plug>(fzf-complete-line)
" Custom shell script ----------------------------
" Rmarkdown build
" map <F5> :!R -e 'rmarkdown::render("%:t")'<CR><CR>
" Build using Makefile
nnoremap <F5> :w <CR> :!make <CR><CR>
map <F6> :w <CR> :!make NAME="%:t"<CR><CR> :!open "%:t:r.pdf"&<CR><CR>