" " ~/.config/nvim/init.vim " let mapleader=',' set showcmd ""---Auto installs vim-plug---"" " let autoload_plug_path='~/.config/nvim/autoload/plug.vim' " if !filereadable(autoload_plug_path) " echo "Downloading junegunn/vim-plug to manage plugins..." " silent execute '!curl -fLo ' . autoload_plug_path . ' --create-dirs " \ "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"' " autocmd VimEnter * PlugInstall " endif " unlet autoload_plug_path ""---Loads plugins---"" call plug#begin('~/.config/nvim/plugged') " Colorscheme Plug 'altercation/vim-colors-solarized' " Other Plug 'mboughaba/i3config.vim' Plug 'junegunn/goyo.vim' Plug 'preservim/nerdtree' let g:NERDTreeShowHidden=1 autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif "Airline Plug 'vim-airline/vim-airline' let g:airline_powerline_fonts=1 Plug 'vim-airline/vim-airline-themes' let g:airline_theme='solarized' " Git Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'mhinz/vim-signify' set updatetime=100 " Auto completion Plug 'Valloric/YouCompleteMe' let g:ycm_autoclose_preview_window_after_completion=1 " TeX Plug 'lervag/vimtex' let g:tex_flavor='latex' let g:vimtex_view_method=$READER let g:vimtex_quickfix_mode=0 Plug 'KeitaNakamura/tex-conceal.vim' set conceallevel=2 let g:tex_conceal="abdgm" " Python Plug 'tmhedberg/SimpylFold' let g:SympylFold_docstring_preview=1 Plug 'vim-scripts/indentpython.vim' Plug 'jmcantrell/vim-virtualenv' Plug 'Yggdroot/indentLine' Plug 'vim-syntastic/syntastic' " set statusline+=%#warningmsg# " set statusline+=%{SyntasticStatuslineFlag()} " set statusline+=%* let g:syntastic_always_populate_loc_list=1 let g:syntastic_auto_loc_list=1 let g:syntastic_check_on_open=1 let g:syntastic_check_on_wq=0 Plug 'nvie/vim-flake8' call plug#end() "" Commands for plug. " PlugInstall [name ...] [#threads] Install plugins " PlugUpdate [name ...] [#threads] Install or update plugins " PlugClean[!] Remove unlisted plugins (bang version will clean without prompt) " PlugUpgrade Upgrade vim-plug itself " PlugStatus Check the status of plugins " PlugDiff Examine changes from the previous update and the pending changes " PlugSnapshot[!] [output path] Generate script for restoring the current snapshot of the plugins ""---Basic configuration---"" syntax enable set background=dark colorscheme solarized " Just so alacritty can use transparency. hi Normal ctermbg=NONE set encoding=utf-8 set number relativenumber set clipboard+=unnamedplus " Custom colors/highlights highlight BadWhitespace ctermbg=red " Indentation filetype plugin indent on set tabstop=4 set shiftwidth=4 " Spell checking autocmd FileType tex setlocal spell set spelllang=es_mx,en_us " Folding set foldmethod=indent set foldlevel=99 " Exclusively for python au BufNewFile,BufRead *.py \ set tabstop=4 | \ set softtabstop=4 | \ set shiftwidth=4 | \ set textwidth=79 | \ set expandtab | \ set fileformat=unix au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/ " Listchars set showbreak=↪\ set listchars=eol:↲,nbsp:␣,tab:»\ ,trail:•,precedes:⟨,extends:⟩ ""---Custom functions---"" " Toggle spellchecking function! ToggleSpellCheck() set spell! if &spell echo "Spellcheck ON" else echo "Spellcheck OFF" endif endfunction " Toggle listchars function! ToggleListChars() set list! if &list echo "Listchars ON" else echo "Listchars OFF" endif endfunction ""---Vanilla vim keybindings---"" " Reload vim nmap :source ~/.config/nvim/init.vim " Toggle relative line number nmap :set number invrelativenumber " Split navigation nmap h nmap j nmap k nmap l " Enable folding with the spacebar nnoremap za " Spell checking nmap s :call ToggleSpellCheck() " List chars nmap c :call ToggleListChars() " Buffers. nnoremap gb :ls:buffer nmap a :badd nmap l :ls ""---Plugin keybindings---"" " Toggle NERDTree nmap :NERDTreeToggle " Goyo nmap :Goyo " YouCompleteMe map g :YcmCompleter GoToDefinitionElseDeclaration