diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..17e75e1 --- /dev/null +++ b/init.vim @@ -0,0 +1,108 @@ +set nocompatible " be iMproved, required +filetype off " required + +" Plugins +" Load vim-plug +if empty(glob("~/.config/nvim/autoload/plug.vim")) + execute '!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +endif +call plug#begin() + +Plug 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required + +Plug 'tpope/vim-fugitive' " Git integration +Plug 'tpope/vim-sensible' " Defaults everyone can agree on +Plug 'tpope/vim-surround' " better handling of surrounding markers +Plug 'tpope/vim-ragtag' " Enhancement of surround for html +Plug 'tpope/vim-repeat' " repeat last command with . +Plug 'scrooloose/nerdcommenter' " better commenting +Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " completion engine +Plug 'Shougo/neosnippet.vim' " snippet engine +Plug 'Shougo/neosnippet-snippets' " snippets +Plug 'easymotion/vim-easymotion' " better motion with leader +Plug 'bling/vim-airline' " statusline +Plug 'w0rp/ale' " asynchronous linting engine +Plug 'godlygeek/tabular' " Align text on symbols +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " fuzzy file finder +Plug 'junegunn/fzf.vim' " vim integration for fzf +Plug 'airblade/vim-gitgutter' " git status in gutter column + +" All of your Plugins must be added before the following line +call plug#end() " required +filetype plugin indent on " required + +" SETTINGS +set number " line numbers +set autoread " reload file automatically + +set history=1000 + +set autoindent " automatically set indent of new line +set smartindent +set tabstop=4 +set shiftwidth=4 +set expandtab + +set ttyfast " faster redrawing +set diffopt+=vertical +set laststatus=2 " show the satus line all the time +set so=7 " set 7 lines to the cursors - when moving vertical +set wildmenu " enhanced command line completion +set hidden " current buffer can be put into background +set showcmd " show incomplete commands +set wildmode=list:longest " complete files like a shell +set scrolloff=3 " lines of text around cursor +set shell=$SHELL +set cmdheight=1 " command bar height +set title " set terminal title + +set foldmethod=marker" " folds are marked with {{{}}} + +" Uncomment the following to have Vim jump to the last position when +" reopening a file +if has("autocmd") + au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") + \| exe "normal! g'\"" | endif +endif + +" SETTINGS +let mapleader = "," + +" fzf bindings +nmap :Files +nmap :Tags + +" Allow saving of files as sudo when I forgot to start vim using sudo. +cmap w!! w !sudo tee > /dev/null % + +" Show Infos from ALE in Airline +let g:airline#extensions#ale#enabled = 1 + +" Completion settings +let g:deoplete#enable_at_startup = 1 + +" Use TAB to cycle between matches +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + +let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {}) +let g:deoplete#ignore_sources.php = ['omni'] + +" Neosnippet Settings +imap (neosnippet_expand_or_jump) +smap (neosnippet_expand_or_jump) +xmap (neosnippet_expand_target) + +" SuperTab like snippets behavior. +"imap +" \ pumvisible() ? "\" : +" \ neosnippet#expandable_or_jumpable() ? +" \ "\(neosnippet_expand_or_jump)" : "\" +smap neosnippet#expandable_or_jumpable() ? + \ "\(neosnippet_expand_or_jump)" : "\" + +" For conceal markers. +if has('conceal') + set conceallevel=2 concealcursor=niv +endif +let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'