2019-07-11 16:09:05 +02:00
|
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
|
|
|
|
" For LaTeX
|
|
|
|
Plug 'vim-latex/vim-latex'
|
|
|
|
|
|
|
|
" The following are examples of different formats supported.
|
|
|
|
" Keep Plugin commands between vundle#begin/end.
|
|
|
|
" plugin on GitHub repo
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
Plug 'tpope/vim-commentary' " Commentary.vim
|
|
|
|
Plug 'tpope/vim-surround'
|
|
|
|
Plug 'tpope/vim-unimpaired'
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes' " Airline Themes
|
|
|
|
Plug 'michaeljsmith/vim-indent-object'
|
2019-10-09 14:47:30 +02:00
|
|
|
|
|
|
|
" NerdTree
|
|
|
|
" Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
|
|
|
" Plug 'scrooloose/nerdtree'
|
|
|
|
|
2019-07-11 16:09:05 +02:00
|
|
|
" Plug 'Reewr/vim-monokai-phoenix'
|
|
|
|
" Plug 'rafi/awesome-vim-colorschemes'
|
|
|
|
" Plug 'terryma/vim-multiple-cursors'
|
|
|
|
Plug 'hdima/python-syntax'
|
|
|
|
Plug 'mileszs/ack.vim'
|
2019-09-12 10:35:51 +02:00
|
|
|
Plug 'gregsexton/MatchTag'
|
2019-07-11 16:09:05 +02:00
|
|
|
Plug 'xolox/vim-misc'
|
|
|
|
Plug 'xolox/vim-easytags'
|
|
|
|
Plug 'jceb/vim-orgmode'
|
|
|
|
Plug 'joshdick/onedark.vim'
|
2019-11-27 21:48:59 +01:00
|
|
|
Plug 'gruvbox-community/gruvbox'
|
2019-07-11 16:09:05 +02:00
|
|
|
Plug 'vim-scripts/ReplaceWithRegister'
|
|
|
|
Plug 'christoomey/vim-system-copy'
|
2019-09-20 10:36:41 +02:00
|
|
|
" Plug 'python-mode/python-mode', { 'branch': 'develop' }
|
|
|
|
" Plug 'tikhomirov/vim-glsl'
|
2019-07-26 18:35:50 +02:00
|
|
|
" Plug 'vim-scripts/clips.vim'
|
2019-07-11 16:09:05 +02:00
|
|
|
Plug 'justinmk/vim-syntax-extra'
|
2019-09-20 10:36:41 +02:00
|
|
|
" " Pending tasks list
|
2019-07-11 16:09:05 +02:00
|
|
|
" Plug 'fisadev/FixedTaskList.vim' ", { 'for': 'python' }
|
2019-09-20 10:36:41 +02:00
|
|
|
" " " Python and other languages code checker
|
|
|
|
" Plug 'scrooloose/syntastic' , { 'for': 'python' }
|
2019-07-11 16:09:05 +02:00
|
|
|
" " Indent text object
|
2019-09-20 10:36:41 +02:00
|
|
|
" Plug 'michaeljsmith/vim-indent-object' , { 'for': 'python' }
|
2019-07-11 16:09:05 +02:00
|
|
|
" " Indentation based movements
|
2019-09-20 10:36:41 +02:00
|
|
|
" Plug 'jeetsukumaran/vim-indentwise' , { 'for': 'python' }
|
|
|
|
" " Python autocompletion, go to definition.
|
|
|
|
" Plug 'davidhalter/jedi-vim', { 'for': 'python' }
|
2019-07-11 16:09:05 +02:00
|
|
|
" " Better autocompletion
|
2019-09-20 10:36:41 +02:00
|
|
|
" Plug 'Shougo/neocomplcache.vim' , { 'for': 'python' }
|
|
|
|
|
2019-10-01 16:20:43 +02:00
|
|
|
" " Haskell prettifiers
|
|
|
|
" Plug 'jaspervdj/stylish-haskell'
|
|
|
|
" Plug 'nbouscal/vim-stylish-haskell'
|
|
|
|
Plug 'sheerun/vim-polyglot' , { 'for': 'haskell' }
|
|
|
|
" Plug 'chrisdone/hindent' , { 'for': 'haskell' }
|
|
|
|
Plug 'alx741/vim-hindent' , { 'for': 'haskell' }
|
|
|
|
" " Errors highlighting
|
|
|
|
Plug 'dense-analysis/ale' , { 'for': 'haskell' }
|
|
|
|
" " Syntax highlighting
|
|
|
|
Plug 'neovimhaskell/haskell-vim' , { 'for': 'haskell' }
|
|
|
|
" " noseke de que se actualiza solo haskell
|
|
|
|
" Plug 'bitc/vim-hdevtools'
|
2019-07-11 16:09:05 +02:00
|
|
|
|
2019-10-04 12:07:26 +02:00
|
|
|
" HTML + php
|
|
|
|
Plug 'captbaritone/better-indent-support-for-php-with-html'
|
|
|
|
|
2019-11-27 21:48:59 +01:00
|
|
|
" Vim Orgmode
|
|
|
|
Plug 'jceb/vim-orgmode'
|
|
|
|
Plug 'dhruvasagar/vim-table-mode'
|
|
|
|
Plug 'tpope/vim-speeddating'
|
|
|
|
|
2019-07-11 16:09:05 +02:00
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
let g:airline_theme='violet'
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => NERDTree
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Uncomment to autostart the NERDTree
|
|
|
|
" autocmd vimenter * NERDTree
|
|
|
|
map <C-n> :NERDTreeToggle<CR>
|
|
|
|
let g:NERDTreeDirArrowExpandable = '▸'
|
|
|
|
let g:NERDTreeDirArrowCollapsible = '▾'
|
|
|
|
let NERDTreeShowLineNumbers=1
|
|
|
|
let NERDTreeShowHidden=1
|
|
|
|
let NERDTreeMinimalUI = 1
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Colors
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
hi LineNr ctermfg=242
|
|
|
|
hi CursorLineNr ctermfg=15
|
|
|
|
hi VertSplit ctermfg=8 ctermbg=0
|
|
|
|
hi Statement ctermfg=3
|
|
|
|
|
|
|
|
" Settings
|
|
|
|
|
|
|
|
" LaTeX
|
|
|
|
let g:tex_flavor='latex'
|
|
|
|
|
|
|
|
" Numbers
|
|
|
|
:set number
|
|
|
|
:set relativenumber
|
|
|
|
|
|
|
|
" Color scheme + syntax
|
|
|
|
syntax on
|
2019-11-27 21:48:59 +01:00
|
|
|
colorscheme gruvbox
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
" CUSTOM CONFIG
|
|
|
|
" Search down in subforlders
|
|
|
|
set path+=**
|
|
|
|
set nocompatible
|
|
|
|
set encoding=utf-8
|
2019-11-27 21:48:59 +01:00
|
|
|
" syntax enable
|
2019-07-11 16:09:05 +02:00
|
|
|
filetype on
|
|
|
|
filetype plugin indent on
|
|
|
|
set autoindent
|
|
|
|
set laststatus=2
|
|
|
|
set incsearch
|
|
|
|
set hlsearch
|
|
|
|
set cursorline
|
|
|
|
|
|
|
|
" Didsplay all atvhing files when we tab complete
|
|
|
|
set wildmenu
|
|
|
|
|
|
|
|
" map <C-p> <C-]>
|
|
|
|
|
|
|
|
" TAGS
|
|
|
|
" Create the 'tags' file (may need to install ctags first)
|
|
|
|
let g:autotagTagsFile=".tags"
|
|
|
|
" JAVA
|
|
|
|
command! MakeTags !ctags -R .
|
|
|
|
|
2019-09-20 10:36:41 +02:00
|
|
|
" Recompile groff document on write
|
|
|
|
autocmd BufWritePost *.ms | :!groff -ms %:p -ep -T pdf > %:r.pdf
|
|
|
|
|
2019-07-11 16:09:05 +02:00
|
|
|
" C
|
|
|
|
" set termguicolors
|
|
|
|
set t_Co=256
|
|
|
|
let mapleader=","
|
|
|
|
|
2019-09-12 10:35:51 +02:00
|
|
|
|
|
|
|
" Folds
|
2019-10-07 11:08:55 +02:00
|
|
|
set foldlevelstart=0
|
|
|
|
" set nofoldenable
|
|
|
|
set foldmethod=indent
|
|
|
|
set foldnestmax=10
|
2019-09-12 10:35:51 +02:00
|
|
|
|
|
|
|
" XML/HTML
|
|
|
|
imap <silent> <C-c> </<C-X><C-O><C-X><Esc>xa
|
|
|
|
nmap <silent> <leader>c a</<C-X><C-O><C-X><Esc>x
|
|
|
|
|
|
|
|
|
2019-07-11 16:09:05 +02:00
|
|
|
""Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
|
|
|
""If you're using tmux version 2.2 or later, you can remove the outermost
|
|
|
|
""$TMUX check and use tmux's 24-bit color support
|
|
|
|
""(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more
|
|
|
|
""information.)
|
|
|
|
"if (empty($TMUX))
|
|
|
|
" if (has("nvim"))
|
|
|
|
" "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
|
|
|
" let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
|
|
|
" endif
|
|
|
|
" "For Neovim > 0.1.5 and Vim > patch 7.4.1799 <
|
|
|
|
" "https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
|
|
|
" "Based on Vim patch 7.4.1770 (`guicolors` option) <
|
|
|
|
" "https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
|
|
|
" " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
|
|
|
|
" if (has("termguicolors"))
|
|
|
|
" set termguicolors
|
|
|
|
" endif
|
|
|
|
"endif
|
|
|
|
|
|
|
|
"Remap ESC to ii
|
|
|
|
:imap ii <Esc>
|
|
|
|
|
|
|
|
" tab navigation mappings
|
2019-07-26 18:35:50 +02:00
|
|
|
map gn :tabnew
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
" better backup, swap and undos storage
|
|
|
|
set directory=~/.vim/dirs/tmp " directory to place swap files in
|
|
|
|
set backup " make backup files
|
|
|
|
set backupdir=~/.vim/dirs/backups " where to put backup files
|
|
|
|
set undofile " persistent undos - undo after you re-open the file
|
|
|
|
set undodir=~/.vim/dirs/undos
|
|
|
|
set viminfo+=n~/.vim/dirs/viminfo
|
|
|
|
" store yankring history file there too
|
|
|
|
let g:yankring_history_dir = '~/.vim/dirs/'
|
|
|
|
|
|
|
|
" create needed directories if they don't exist
|
|
|
|
if !isdirectory(&backupdir)
|
|
|
|
call mkdir(&backupdir, "p")
|
|
|
|
endif
|
|
|
|
if !isdirectory(&directory)
|
|
|
|
call mkdir(&directory, "p")
|
|
|
|
endif
|
|
|
|
if !isdirectory(&undodir)
|
|
|
|
call mkdir(&undodir, "p")
|
|
|
|
endif
|
|
|
|
|
|
|
|
" toggle nerdtree display
|
|
|
|
map <F3> :NERDTreeToggle<CR>
|
|
|
|
" open nerdtree with the current file selected
|
2019-11-27 21:48:59 +01:00
|
|
|
" nmap <leader>t :NERDTreeFind<CR>
|
2019-07-11 16:09:05 +02:00
|
|
|
" don;t show these file types
|
|
|
|
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
|
|
|
|
|
|
|
|
|
|
|
|
" Lo de los brackets y parentesis
|
|
|
|
inoremap ( ()<Esc>i
|
|
|
|
inoremap [ []<Esc>i
|
|
|
|
inoremap { {}<Esc>i
|
|
|
|
autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR>
|
|
|
|
inoremap ) <c-r>=ClosePair(')')<CR>
|
|
|
|
inoremap ] <c-r>=ClosePair(']')<CR>
|
2019-07-26 18:35:50 +02:00
|
|
|
" inoremap } <c-r>=CloseBracket()<CR>
|
|
|
|
inoremap } <c-r>=ClosePair('}')<CR>
|
|
|
|
" inoremap " <c-r>=QuoteDelim('"')<CR>
|
|
|
|
" inoremap ' <c-r>=QuoteDelim("'")<CR>
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
function ClosePair(char)
|
|
|
|
if getline('.')[col('.') - 1] == a:char
|
|
|
|
return "\<Right>"
|
|
|
|
else
|
|
|
|
return a:char
|
|
|
|
endif
|
|
|
|
endf
|
|
|
|
|
|
|
|
function CloseBracket()
|
|
|
|
if match(getline(line('.') + 1), '\s*}') < 0
|
|
|
|
return "\<CR>}"
|
|
|
|
else
|
|
|
|
return "\<Esc>j0f}a"
|
|
|
|
endif
|
|
|
|
endf
|
|
|
|
|
|
|
|
function QuoteDelim(char)
|
|
|
|
let line = getline('.')
|
|
|
|
let col = col('.')
|
|
|
|
if line[col - 2] == "\\"
|
|
|
|
"Inserting a quoted quotation mark into the string
|
|
|
|
return a:char
|
|
|
|
elseif line[col - 1] == a:char
|
|
|
|
"Escaping out of the string
|
|
|
|
return "\<Right>"
|
|
|
|
else
|
|
|
|
"Starting a string
|
|
|
|
return a:char.a:char."\<Esc>i"
|
|
|
|
endif
|
|
|
|
endf
|
|
|
|
|
|
|
|
|
|
|
|
" tab length exceptions on some file types
|
2019-10-04 12:07:26 +02:00
|
|
|
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
|
|
|
autocmd FileType php setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
2019-10-09 14:47:30 +02:00
|
|
|
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
2019-07-11 16:09:05 +02:00
|
|
|
autocmd FileType htmldjango setlocal shiftwidth=4 tabstop=4 softtabstop=4
|
2019-10-01 16:20:43 +02:00
|
|
|
autocmd FileType haskell setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
let g:pymode_rope = 1
|
|
|
|
let g:pymode_rope_completion = 1
|
|
|
|
let g:pymode_indent = 1
|
|
|
|
let g:pymode_motion = 1
|
|
|
|
let g:pymode_run = 0
|
|
|
|
let g:pymode_syntax = 1
|
|
|
|
let g:pymode_syntax_all = 1
|
|
|
|
let g:pymode_syntax_print_as_function = 1
|
|
|
|
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
|
|
|
|
let g:pymode_syntax_space_errors = g:pymode_syntax_all
|
|
|
|
let g:pymode_syntax_highlight_exceptions = g:pymode_syntax_all
|
|
|
|
"let g:pymode_rope_project_root += %:p:h
|
|
|
|
""let g:pymode_rope_rename_bind = '<C-x><C-x>'
|
|
|
|
let g:pymode_python = 'python'
|
|
|
|
" nnoremap <leader>p let g:pymode_python = 'python'
|
|
|
|
" nnoremap <leader>P let g:pymode_python = 'python3'
|
2019-11-27 21:48:59 +01:00
|
|
|
" noremap <buffer> <leader>r :exec '!python' shellescape(@%, 1)<cr>
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
let g:gruvbox_contrast_dark='medium'
|
|
|
|
let g:gruvbox_contrast_light='medium'
|
|
|
|
set background=dark
|
|
|
|
|
|
|
|
nnoremap <silent> [oh :call gruvbox#hls_show()<CR>
|
|
|
|
nnoremap <silent> ]oh :call gruvbox#hls_hide()<CR>
|
|
|
|
nnoremap <silent> coh :call gruvbox#hls_toggle()<CR>
|
|
|
|
|
|
|
|
nnoremap * :let @/ = ""<CR>:call gruvbox#hls_show()<CR>*
|
|
|
|
nnoremap / :let @/ = ""<CR>:call gruvbox#hls_show()<CR>/
|
|
|
|
nnoremap ? :let @/ = ""<CR>:call gruvbox#hls_show()<CR>?
|
|
|
|
|
|
|
|
|
|
|
|
" set tabstop=4
|
|
|
|
" set shiftwidth=4
|
|
|
|
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
|
|
|
|
|
|
|
|
|
|
|
|
" mapping to make movements operate on 1 screen line in wrap mode
|
|
|
|
let b:gmove = "yes"
|
|
|
|
function! ScreenMovement(movement)
|
|
|
|
if exists("b:gmove") && &wrap && b:gmove == 'yes'
|
|
|
|
return "g" . a:movement
|
|
|
|
else
|
|
|
|
return a:movement
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
onoremap <silent> <expr> j ScreenMovement("j")
|
|
|
|
onoremap <silent> <expr> k ScreenMovement("k")
|
|
|
|
onoremap <silent> <expr> 0 ScreenMovement("0")
|
|
|
|
onoremap <silent> <expr> ^ ScreenMovement("^")
|
|
|
|
onoremap <silent> <expr> $ ScreenMovement("$")
|
|
|
|
nnoremap <silent> <expr> j ScreenMovement("j")
|
|
|
|
nnoremap <silent> <expr> k ScreenMovement("k")
|
|
|
|
nnoremap <silent> <expr> 0 ScreenMovement("0")
|
|
|
|
nnoremap <silent> <expr> ^ ScreenMovement("^")
|
|
|
|
nnoremap <silent> <expr> $ ScreenMovement("$")
|
|
|
|
vnoremap <silent> <expr> j ScreenMovement("j")
|
|
|
|
vnoremap <silent> <expr> k ScreenMovement("k")
|
|
|
|
vnoremap <silent> <expr> 0 ScreenMovement("0")
|
|
|
|
vnoremap <silent> <expr> ^ ScreenMovement("^")
|
|
|
|
vnoremap <silent> <expr> $ ScreenMovement("$")
|
|
|
|
vnoremap <silent> <expr> j ScreenMovement("j")
|
|
|
|
" toggle showbreak
|
|
|
|
function! TYShowBreak()
|
|
|
|
if &showbreak == ''
|
|
|
|
set showbreak=>
|
|
|
|
else
|
|
|
|
set showbreak=
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
function! TYToggleBreakMove()
|
|
|
|
if exists("b:gmove") && b:gmove == "yes"
|
|
|
|
let b:gmove = "no"
|
|
|
|
else
|
|
|
|
let b:gmove = "yes"
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
nmap <expr> ,b TYShowBreak()
|
|
|
|
nmap <expr> ,bb TYToggleBreakMove()
|
|
|
|
|
|
|
|
|
2019-12-04 13:15:35 +01:00
|
|
|
nmap <leader>u :w<CR>:!dos2unix %:p<CR>:edit<CR>
|
|
|
|
nmap <leader>d :w<CR>:!unix2dos %:p<CR>:edit<CR>
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
if exists('+colorcolumn')
|
|
|
|
set colorcolumn=80
|
|
|
|
endif
|
2019-11-27 21:48:59 +01:00
|
|
|
|
|
|
|
set textwidth=80
|
|
|
|
|
|
|
|
" Red after 80th character
|
|
|
|
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
|
2019-07-11 16:09:05 +02:00
|
|
|
|
2019-07-26 18:35:50 +02:00
|
|
|
set tabpagemax=64
|
2019-07-11 16:09:05 +02:00
|
|
|
|
|
|
|
au BufNewFile,BufRead *.ms set filetype=groff
|
|
|
|
|
|
|
|
if &term =~ '256color'
|
|
|
|
" disable Background Color Erase (BCE) so that color schemes
|
|
|
|
" render properly when inside 256-color tmux and GNU screen.
|
|
|
|
" see also http://sunaku.github.io/vim-256color-bce.html
|
|
|
|
set t_ut=
|
|
|
|
endif
|
2019-10-01 16:20:43 +02:00
|
|
|
|
2019-10-09 14:47:30 +02:00
|
|
|
" File browser built-in configs
|
|
|
|
let g:netrw_banner=0
|
|
|
|
let g:netrw_browse_split=0
|
|
|
|
let g:netrw_altv=1
|
|
|
|
let g:netrw_liststyle=3
|
|
|
|
let g:netrw_list_hide=netrw_gitignore#Hide()
|
|
|
|
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
|
|
|
|
|
|
|
|
" Show commands
|
|
|
|
set showcmd
|
2019-10-16 00:35:49 +02:00
|
|
|
|
|
|
|
" Haskell
|
|
|
|
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
|
2019-12-02 14:07:44 +01:00
|
|
|
let g:haskell_classic_highlighting = 0 " Haskell classic highlighting
|
2019-11-27 21:48:59 +01:00
|
|
|
|
|
|
|
" Reload documents
|
|
|
|
nnoremap <silent> <leader>r :edit!<CR>
|