-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
218 lines (168 loc) · 5.51 KB
/
init.vim
File metadata and controls
218 lines (168 loc) · 5.51 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
" Make it simple...at least until I know how to config nvim
" My leader key
let mapleader = "\<Space>"
" Number of lines at the beginning and end of files checked for file-specific
" vars
set modelines=0
" Reload files changed outside of nvim
set autoread
" Plugins
filetype plugin on
" Encoding
set encoding=utf-8
set fenc=utf-8
" Make backspace work like delete
set backspace=indent,eol,start
" Don't create swap files
set noswapfile
" Line number and distance
set relativenumber
" set number
" Number of lines offset when jumping
set scrolloff=2
" Tab key enters 2 spaces
set expandtab tabstop=2 shiftwidth=2 softtabstop=2
" Indent new line the same as the preceding line
set autoindent
" Don't want to see the status line, vim-airline will do it
set noshowmode
" Status line indicates insert or normal mode
" set showmode showcmd
" Using vim-airline plug
let g:airline_theme='simple'
" Highlight matching parens, braces, brackets...
set showmatch
" TODO: Make this look pretty
" Show current line
set cursorline
" highlight cursorline ctermbg=black
" autocmd InsertEnter * highlight cursorline ctermbg=17 ctermfg=None
" autocmd InsertLeave * highlight cursorline ctermbg=None ctermfg=None
" Always show cursor position
set ruler
" Syntax color
syntax enable
" Set colors if TERM have colors
if $TERM == "termite"
set t_Co=256
endif
" Remap keys :: noremap <new_key> <old_key>
noremap j h
noremap k j
noremap l k
noremap ñ l
" Ignore case when searching
set ignorecase
" Incremental search that shows partial matches
set incsearch
" Change to case-sensitive search when swarch query contains an uppercase
" letter
set smartcase
" Don't update screen during macro and script execution
set lazyredraw
" Disable beep on errors
set noerrorbells
" Fold based on indention levels
" set foldmethod=indent
" Only fold up to three nested levels
" set foldnestmax=3
" Display a confirmation dialog when closing an unsaved file
set confirm
" Increase the undo limit
set history=1000
" To be in the same spot when oppening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" TODO make this work
" Fast window switching
nnoremap <silent> <M-left> <C-w>j
nnoremap <silent> <M-right> <C-w>ntile
nnoremap <silent> <M-down> <C-w>k
nnoremap <silent> <M-up> <C-w>l
" Edit and reload init.vim quickly
nnoremap <silent> <leader>ev :tabnew $MYVIMRC <bar> tcd %:h<cr>
nnoremap <silent> <leader>sv :silent update $MYVIMRC <bar> source $MYVIMRC <bar>
\ echomsg "Nvim configvsuccessfully reloaded!"<cr>
" Yank from current position to the end.
nnoremap Y y$
" Undo even after you close a file.
set undofile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set nvim config path and load your .vim scripts/files
let g:nvim_config_root = stdpath('config')
let g:config_file_list = ['pluginCall.vim']
" \ 'XXXXXXX.vim',
" \ 'XXXXXXXXXXXX.vim',
" \ 'XXXXXXXX.vim',
" \ 'XXXXXXX.vim',
" \ 'XX.vim'
" \ ]
for f in g:config_file_list
execute 'source ' . g:nvim_config_root . '/' . f
endfor
" Remap <C-e> to open nerdTree plugin
map <C-e> :NERDTreeToggle<CR>
" BEGIN - Rainbow Paren Pluggin
" :RainbowParenthesesToggle " Toggle it on/off
" :RainbowParenthesesLoadRound " (), the default when toggling
" :RainbowParenthesesLoadSquare " []
" :RainbowParenthesesLoadBraces " {}
" :RainbowParenthesesLoadChevrons " <>
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
" END - Rainbow Paren Pluggin
" BEGIN - Haskell Syntax Pluggin
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
let g:haskell_indent_if = 3
let g:haskell_indent_case = 2
let g:haskell_indent_let = 4
let g:haskell_indent_where = 6
let g:haskell_indent_before_where = 2
let g:haskell_indent_after_bare_where = 2
let g:haskell_indent_do = 3
let g:haskell_indent_in = 1
let g:haskell_indent_guard = 2
let g:haskell_indent_case_alternative = 1
" END - Haskell Syntax Pluggin
" If you have vim >=8.0 or Neovim >= 0.1.5
if (has("termguicolors"))
set termguicolors
endif
" File type detection ON
filetype on
" Theme
colorscheme gruvbox
set bg=dark
" Background color
set background=dark
" Para que si una linea es muy grande y no cabe en la panralla no me muestre @@@
set display+=lastline
" We want youCompleteMe plugin to close buffers with info after insert mode
let g:ycm_autoclose_preview_window_after_insertion = 1
" Emmet plug for html and css coding
" let g:user_emmet_install_global = 0
" instead of <Ctrl + y ,> now I use <,,>
let g:user_emmet_leader_key=','
autocmd FileType html,css,ejs EmmetInstall
" css autocomplete no plugin
set omnifunc=syntaxcomplete#Complete
" Save fold and unfold code
augroup remember_folds
autocmd!
au BufWinLeave ?* mkview 1
au BufWinEnter ?* silent! loadview 1
augroup END
" repe pero es que no me hace caso :(
set expandtab tabstop=2 shiftwidth=2 softtabstop=2