From 88a8603d999864c23cacd84d1e26d01898e437f3 Mon Sep 17 00:00:00 2001
From: Ekaitz Zárraga <ekaitz.zarraga@gmail.com>
Date: Mon, 24 Oct 2016 13:46:42 +0200
Subject: Refurbish the init.vim

---
 nvim/nvim/init.vim | 82 ++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 52 insertions(+), 30 deletions(-)

diff --git a/nvim/nvim/init.vim b/nvim/nvim/init.vim
index 099a7c5..40eb36b 100644
--- a/nvim/nvim/init.vim
+++ b/nvim/nvim/init.vim
@@ -1,4 +1,5 @@
-" Vundle stuff ----------------------------------------------
+" VUNDLE:
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 set nocompatible
 filetype off
 set rtp+=$XDG_CONFIG_HOME/nvim/bundle/Vundle.vim
@@ -16,20 +17,45 @@ Plugin 'kchmck/vim-coffee-script'
 " Add plugins here
 
 call vundle#end()            " required
-" / Vundle stuff end ----------------------------------------
-
-" Allow backspace always
-set backspace=indent,eol,start
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
+" GUI:
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Activate syntax highlighting by default
 syntax on
 
-" Different config for each filetype
-filetype plugin on
+" Enable TRUE COLORS
+let $NVIM_TUI_ENABLE_TRUE_COLOR=1
+
+" Set default colorscheme but dark comments -> Torte
+colorscheme torte
 
 " Show trailing spaces
 set list lcs=trail:·,tab:»·
 
+" Always show tabline (0=never, 1=when there are at least 2 tabs, 2=always)
+set showtabline=1
+
+" Explore configured to show tree
+let g:netrw_liststyle= 3
+
+" Mouse support
+set mouse=a
+
+" Fold
+set foldmethod=indent
+set foldlevelstart=99
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" EDITION:
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" Allow backspace always
+set backspace=indent,eol,start
+
+" Change buffers without needing to save
+set hidden
+
 " Clear trailing spaces on <F2>
 function TrimWhiteSpace()
   %s/\s*$//
@@ -37,9 +63,12 @@ function TrimWhiteSpace()
 :endfunction
 nnoremap <F2> :call TrimWhiteSpace()<CR>
 
-" Fold
-set foldmethod=indent
-set foldlevelstart=99
+" Default tabs
+set tabstop=4 softtabstop=0 expandtab shiftwidth=4
+set autoindent
+
+
+" SEARCH
 
 " HighLight search and map CarrierReturn to remove highlight
 set hlsearch
@@ -49,32 +78,25 @@ nnoremap <CR> :noh<CR><CR>
 set ignorecase
 set smartcase
 
-" Always show tabline (0=never, 1=when there are at least 2 tabs, 2=always)
-set showtabline=1
-
-" Mouse support
-set mouse=a
-
-" Enable TRUE COLORS
-let $NVIM_TUI_ENABLE_TRUE_COLOR=1
 
-" Set default colorscheme but dark comments -> Torte
-colorscheme torte
+" TEXT WIDTH
 
-" Default tabs
-set tabstop=4 softtabstop=0 expandtab shiftwidth=4
-set autoindent
+" Textwidth for automatic wrap, `gq` is formatting operation
+set textwidth=79
+set formatoptions=tcqj
 
-" Change buffers without needing to save
-set hidden
+" Highlight where the lines are more than 80 characters wide
+set colorcolumn=80
+highlight ColorColumn ctermbg=DarkGrey
 
-" Explore configured to show tree
-let g:netrw_liststyle= 3
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
+" TERMINAL:
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Make terminal remap to go out of insert mode
 :tnoremap <Esc> <C-\><C-n>
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
-" Highlight where the lines are more than 80 characters wide
-setlocal colorcolumn=80
-highlight ColorColumn ctermbg=DarkGrey
 
+" Different config for each filetype
+filetype plugin on
-- 
cgit v1.2.3