1- " ##################### PLUG #########################
1+ " ### Plug ########################################
22if ! filereadable (expand (' ~/.local/share/nvim/site/autoload/plug.vim' ))
33 echo " Downloading junegunn/vim-plug to manage plugins..."
44 silent ! curl - fLo ~/.local/share/nvim/site/autoload/plug.vim -- create- dirs
@@ -17,16 +17,17 @@ Plug 'tpope/vim-fugitive'
1717Plug ' tomtom/tcomment_vim'
1818Plug ' /usr/local/opt/fzf'
1919Plug ' junegunn/fzf.vim'
20- Plug ' dense-analysis/ale'
2120Plug ' yggdroot/indentline'
21+ Plug ' easymotion/vim-easymotion'
22+ Plug ' junegunn/goyo.vim'
23+ Plug ' dense-analysis/ale'
2224Plug ' fatih/vim-go'
23- Plug ' vimwiki/vimwiki'
2425Plug ' rust-lang/rust.vim'
2526Plug ' racer-rust/vim-racer'
26- Plug ' easymotion/vim-easymotion '
27+ Plug ' vimwiki/vimwiki '
2728call plug#end ()
2829
29- " ##################### PLUGINS ######################
30+ " ### Plugins #####################################
3031let g: fzf_layout = { ' down' : ' ~70%' }
3132command ! - bang -nargs =? -complete =dir Files
3233 \ call fzf#vim#files (<q-args> , fzf#vim#with_preview (), <bang> 0 )
@@ -101,7 +102,7 @@ let g:indentLine_char = '│'
101102let g: racer_insert_paren = 1
102103let g: racer_experimental_completer = 1
103104
104- " ##################### SETTINGS #####################
105+ " ### Settings ####################################
105106set fileformats = unix,mac,dos
106107set wildmode = longest,list ,full
107108set clipboard += unnamedplus
@@ -121,21 +122,23 @@ set nohlsearch
121122set hidden
122123set background = dark
123124set iskeyword += -
125+ set nojoinspaces
124126colorscheme solarized
125127syntax enable
126128
127- " ##################### AUTOCMDS #####################
129+ " ### Autocmds ####################################
128130autocmd TermOpen * setlocal nonu nornu
129131autocmd TermOpen * IndentLinesDisable
130132autocmd TermOpen * startinsert
131133autocmd BufWritePre * % s: \s\+ $ ::e
132- autocmd BufNewFile ,BufRead * setlocal formatoptions -= o
134+ autocmd BufNewFile ,BufRead * set formatoptions -= o
133135autocmd BufNewFile ,BufRead Jenkinsfile setlocal filetype = groovy
136+ autocmd BufNewFile ,BufRead *.mom setlocal filetype = groff
134137autocmd FileType yaml,json set tabstop = 2 shiftwidth = 2
135138autocmd FileType json IndentLinesDisable
136139autocmd FileType markdown setlocal spell
137140
138- " ################### FUNCTIONS ######################
141+ " ### Functions ##################################
139142function ! ResizeMode ()
140143 let key = nr2char (getchar ())
141144 while key != " q" && key != " \<ESC> "
@@ -214,19 +217,19 @@ function! AlignWithMark(...)
214217 return " "
215218endfunction
216219
217- " ################### REMAPPINGS #####################
218- " --- Hotfix -----------------------------------------
220+ " ### Remappings ##################################
221+ " --- Hotfix --------------------------------------
219222cnoremap 3636 <c-u> undo<CR>
220223
221- " --- Should-Be-Defaults -----------------------------
224+ " --- Should-Be-Defaults --------------------------
222225cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
223226nnoremap c "_c
224227nnoremap Y y$
225228inoremap <c-v> <c-o> p
226229tnoremap <c-\> <c-\><c-n>
227230tmap <c-w> <c-\><c-w>
228231
229- " --- Functions ---------------------------------------
232+ " --- Functions -----------------------------------
230233nnoremap <silent> <c-w> r <c-w> t:call ResizeMode()<CR>
231234nnoremap <silent> <c-w> R :call ResizeMode()<CR>
232235
@@ -240,52 +243,56 @@ inoremap <silent> <s-Tab> <c-r>=OmniTab()<CR>
240243nnoremap <silent> gA :call AlignWithMark("i")<CR>
241244vnoremap <silent> gA :call AlignWithMark("s")<CR>
242245
243- " --- Testing ----------------------------------------
246+ " --- Testing -------------------------------------
244247nnoremap <silent> gw :w<CR>
245248nnoremap <silent> gN :tabnext<CR>
246249nnoremap <silent> gP :tabprevious<CR>
247250nnoremap <c-d> <c-d> zz
248251nnoremap <c-u> <c-u> zz
249252
250- " --- Autocomplete -----------------------------------
253+ " --- Autocomplete --------------------------------
251254inoremap <c-f> <c-x><c-f>
252255inoremap <c-l> <c-x><c-l>
253256inoremap <c-b> <c-x><c-p>
254257" ^ <c-x><c-p> block complete (continue completing where left off)
255258
256- " --- Splits/Buffers ---------------------------------
259+ " --- Splits/Buffers ------------------------------
257260nnoremap <silent> gn :bn<CR>
258261nnoremap <silent> gp :bp<CR>
259262nnoremap <silent> gbd :bd<CR>
260263nnoremap <silent> gbD :bd \| sbn<CR>
261264
262- " --- Coding -----------------------------------------
265+ " --- Writing -------------------------------------
266+ cnoremap Essayon Goyo \| ALEDisableBuffer \| setlocal fo+=a tw=81 nospell
267+ cnoremap Essayoff Goyo! \| ALEEnableBuffer \| setlocal fo-=a tw=0 spell
268+
269+ " --- Coding --------------------------------------
263270nnoremap goq <c-w> j<c-w> q
264271nnoremap gs :%s//g<Left><Left>
265272nnoremap gS :%s/<c-r><c-w> //g<Left><Left>
266273nnoremap gth :set hlsearch!<CR>
267274nnoremap gtl :IndentLinesToggle<CR>
268275
269- " --- SURROUND ---- ------------------------------------
276+ " --- Surround ------------------------------------
270277nmap dsf dt(ds(
271278nmap dsm dt[ds[
272279nmap dsl dt{ds{
273280nmap dsv dt<ds<
274281nmap g' ysiW"
275282
276- " --- EASY MOTION --- ---------------------------------
283+ " --- Easy Motion ---------------------------------
277284nmap gf <Plug> (easymotion-overwin-w)
278285nmap gF <Plug> (easymotion-bd-wl)
279286nmap g<c-f> <Plug> (easymotion-jumptoanywhere)
280287
281- " --- ALE LINTING --- ---------------------------------
288+ " --- Ale Linting ---------------------------------
282289nnoremap <silent> gaa :ALEFirst<CR>
283290nnoremap <silent> gan :ALENextWrap<CR>
284291nnoremap <silent> gap :ALEPreviousWrap<CR>
285292nnoremap <silent> gaf :ALEFix<CR>
286293nnoremap <silent> gad :ALEDetail<CR>
287294
288- " --- VIM-GO --- --------------------------------------
295+ " --- Vim-Go --------------------------------------
289296autocmd FileType go nnoremap goi :GoInfo<CR>
290297autocmd FileType go nnoremap got :GoTest<CR>
291298autocmd FileType go nnoremap goT :GoTestFunc!<CR>
@@ -303,7 +310,7 @@ autocmd FileType go IndentLinesDisable
303310autocmd FileType go highlight link Whitespace Conceal
304311autocmd FileType go set list listchars = tab :\|\ " keep trailing space
305312
306- " --- VIM-RUST --- ------------------------------------
313+ " --- Vim-Rust ------------------------------------
307314augroup Racer
308315 " autocmd!
309316 autocmd FileType rust nmap gd <Plug> (rust-def)
@@ -318,10 +325,10 @@ augroup Racer
318325 autocmd FileType rust nmap gtR :let g:ale_linters['rust'] = g:rustlint2<CR>
319326augroup END
320327
321- " --- Leader Key -------------------------------------
328+ " --- Leader Key ----------------------------------
322329let mapleader = " ,"
323330
324- " --- FZF --- -----------------------------------------
331+ " --- Fzf -----------------------------------------
325332let maplocalleader = " \<Space> "
326333nnoremap <LocalLeader> <LocalLeader> :Lines<CR>
327334nnoremap <LocalLeader> f :Files<CR>
0 commit comments