filetype plugin indent on
syntax on
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" minpac
silent! packadd minpac
call minpac#add('tpope/vim-repeat', {'type': 'opt'})
call minpac#add('tpope/vim-surround', {'type': 'opt'})
call minpac#add('tpope/vim-unimpaired', {'type': 'opt'})
+ call minpac#add('tpope/vim-endwise', {'type': 'opt'})
call minpac#add('tpope/vim-fugitive', {'type': 'opt'})
call minpac#add('tpope/vim-commentary', {'type': 'opt'})
call minpac#add('tpope/vim-vinegar', {'type': 'opt'})
+ call minpac#add('Yggdroot/indentLine', {'type': 'opt'})
call minpac#add('garbas/vim-snipmate', {'type': 'opt'})
call minpac#add('MarcWeber/vim-addon-mw-utils', {'type': 'opt'})
call minpac#add('tomtom/tlib_vim', {'type': 'opt'})
call minpac#add('junegunn/fzf.vim', {'type': 'opt'})
endif
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Key-mappings
+let mapleader = ' '
+let localmapleader = ' '
+
+nnoremap <leader>w :update<cr>
+nnoremap <leader>t :term<cr>
+nnoremap <leader>* :grep <cword> \| copen<cr><c-l>
+nnoremap <leader>+ :exe "resize " . (winheight(0) * 3/2)<cr>
+nnoremap <leader>- :exe "resize " . (winheight(0) * 2/3)<cr>
+"nnoremap <leader>html :-1read ~/.vim/template/html<CR>3jwf>a
+"nnoremap <leader>php :-1read ~/.vim/template/php<CR>2ja
+
+" Normal Mode
+nnoremap Y y$
+nnoremap n nzzzv
+nnoremap N Nzzzv
+
+" jk | Escaping!
+inoremap jk <Esc>
+xnoremap jk <Esc>
+cnoremap jk <C-c>
+
+" <Ctrl-hjkl> Jump windows
+noremap <C-h> <C-w><C-h>
+noremap <C-j> <C-w><C-j>
+noremap <C-k> <C-w><C-k>
+noremap <C-l> <C-w><C-l>
+tnoremap <C-j> <C-\><C-n><C-w>j
+tnoremap <C-k> <C-\><C-n><C-w>k
+tnoremap <C-l> <C-\><C-n><C-w>l
+tnoremap <C-h> <C-\><C-n><C-w>h
+
+" Vim command line
+cnoremap <C-p> <Up>
+cnoremap <C-n> <Down>
+cnoreabbrev w!! w !sudo tee "%"
+
+" Visual Mode indent
+vnoremap < <gv
+vnoremap > >gv
+
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" indentation
set softtabstop=2
set shiftwidth=2
set formatoptions+=j
" searching
-set incsearch
-set hlsearch
-set ignorecase
-set smartcase
+set incsearch hlsearch
+set ignorecase smartcase
set magic
set showmatch
set complete-=i
endif
" display
-set scrolloff=1
-set scrolljump=5
+set scrolloff=5
set sidescrolloff=5
set display+=lastline
set lazyredraw
"let g:netrw_altv = 1
"let g:netrw_winsize = 25
-" system
+" files
set path=.,,**
set shell=bash
let g:is_posix = 1
"let &t_EI.="\e[1 q"
"let &t_te.="\e[0 q"
-" Mappings
-let mapleader = "\<space>"
-
-noremap <C-h> <C-w><C-h>
-noremap <C-j> <C-w><C-j>
-noremap <C-k> <C-w><C-k>
-noremap <C-l> <C-w><C-l>
-
-" Terminal Mode
-tnoremap <C-h> <C-\><C-n><C-w>h
-tnoremap <C-j> <C-\><C-n><C-w>j
-tnoremap <C-k> <C-\><C-n><C-w>k
-tnoremap <C-l> <C-\><C-n><C-w>l
-
-" Normal Mode
-nnoremap n nzzzv
-nnoremap N Nzzzv
-nnoremap g= gg=Gg``
-nnoremap <silent><leader>+ :exe "resize " . (winheight(0) * 3/2)<cr>
-nnoremap <silent><leader>- :exe "resize " . (winheight(0) * 2/3)<cr>
-nnoremap <silent><leader>hs :noh<cr>
-nnoremap <silent><leader>v :edit $MYVIMRC<cr>
-nnoremap <silent><leader>s :term<cr>
-nnoremap <silent><leader>m :wa<CR>:Make<CR>
-nnoremap <silent><leader>* :grep <cword> \| copen<cr><c-l>
-nnoremap <silent><Leader>t :TagbarToggle<CR>
-"nnoremap <silent><leader>html :-1read ~/.vim/template/html<CR>3jwf>a
-"nnoremap <silent><leader>php :-1read ~/.vim/template/php<CR>2ja
-
-"" Visual Mode
-"vnoremap jk <esc>
-vmap < <gv
-vmap > >gv
-
-" Insert Mode
-"inoremap jk <esc>
-inoremap <C-U> <C-G>u<C-U>
-
-" Command Mode
-cnoremap <C-p> <Up>
-cnoremap <C-n> <Down>
-cnoreabbrev w!! w !sudo tee "%"
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Functions
" vimgrep file:line:coloumn:message
call system('firefox markdown-preview.html 1>/dev/null 2>/dev/null &')
endfunction
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
if has('autocmd')
augroup filetypes
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup end
- augroup vimrc
+ augroup vimrc
autocmd!
autocmd BufWritePost vimrc,gvimrc,vimrc.local source $MYVIMRC
augroup end
silent! packadd! vim-fugitive
silent! packadd! vim-commentary
silent! packadd! vim-vinegar
+silent! packadd! vim-endwise
silent! packadd! supertab
silent! packadd! fzf.vim
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+silent! packadd! indentLine
+"let g:indentLine_enabled = 1
+"let g:indentLine_setColors = 0
+"let g:indentLine_setConceal = 0
+autocmd! User indentLine doautocmd indentLine Syntax
+let g:indentLine_color_term = 239
+let g:indentLine_color_gui = '#616161'
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Airline
silent! packadd! vim-airline
let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])
endif
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ALE
-"silent! packadd! ale
+silent! packadd! ale
let g:ale_enabled = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""