-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
148 lines (112 loc) · 3.2 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
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
" Syntax
set number
syntax enable
set noshowmode
set laststatus=2
set noswapfile
highlight Comment cterm=italic
" Indent
set expandtab
set shiftwidth=2
set softtabstop=2
" habilitar copy-paste
" -------------------
set clipboard=unnamed
" Unset the "last search pattern"
nnoremap <CR> :noh<CR><CR>
" configurar split
" ---------------
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
" Backspace
set nocompatible
set backspace=2
" Leader
let mapleader = ","
" Folding
" set fdm=syntax
" autocmd BufWinLeave *.* mkview
" autocmd BufWinEnter *.* silent loadview
" augroup vimrc
" au BufReadPre * setlocal foldmethod=indent
" au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif
" augroup END
" Autogroups
filetype plugin on
autocmd FileType tex set spell spelllang=es
" Begin Plug
" ==============================================================================
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.local/share/nvim/plugged')
" Easy aling
Plug 'junegunn/vim-easy-align'
" NERDCommeter
Plug 'scrooloose/nerdcommenter'
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" NERDTree
Plug 'scrooloose/nerdtree'
" EasyMotion
Plug 'easymotion/vim-easymotion'
" Ctrl-P - Fuzzy file search
Plug 'kien/ctrlp.vim'
" Tab completion
Plug 'ervandew/supertab'
let g:SuperTabClosePreviewOnPopupClose = 1
" Remove extraneous whitespace when edit mode is exited
Plug 'thirtythreeforty/lessspace.vim'
" Autopep8
Plug 'tell-k/vim-autopep8'
let g:autopep8_disable_show_diff=1
autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" Colorscheme
Plug 'flazz/vim-colorschemes'
" colorscheme elflord
" VimTeX
Plug 'lervag/vimtex'
" YCM
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
let g:python_host_prog = '/home/mendezr/miniconda3/envs/pdf/bin/python'
let g:ycm_server_python_interpreter = '/home/mendezr/miniconda3/envs/pdf/bin/python'
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 1
" Vim-airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline_powerline_fonts = 1
let g:airline_theme='jellybeans'
" Clever-f
Plug 'rhysd/clever-f.vim'
" Colorschemes
Plug 'dracula/vim'
Plug 'arcticicestudio/nord-vim'
Plug 'zanglg/nova.vim'
Plug 'junegunn/seoul256.vim'
Plug 'morhetz/gruvbox'
call plug#end()
" End Plug
" =========================================================
" Load colorscheme
colorscheme gruvbox
set background=dark
" Highlight
hi MatchParen cterm=none ctermbg=none ctermfg=blue
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=red
" Parenthesis
vnoremap _( <Esc>`>a)<Esc>`<i(<Esc>
vnoremap _' <Esc>`>a'<Esc>`<i'<Esc>
inoremap ( ()<Esc>:let leavechar=")"<CR>i
inoremap [ []<Esc>:let leavechar="]"<CR>i
inoremap ' ''<Esc>:let leavechar="'"<CR>i
inoremap { {}<Esc>:let leavechar="}"<CR>i
inoremap " ""<Esc>i
inoremap <C-s> <Esc>/[)}"'\]>]<CR>:nohl<CR>a