2019-03-20 13:27:54 +00:00
|
|
|
" vim: set foldmethod=marker foldlevel=0 nomodeline:
|
|
|
|
" ================================================================================
|
|
|
|
" .init.vim / .vimrc of Marty Oehme {{{
|
|
|
|
" ================================================================================
|
|
|
|
"
|
|
|
|
" - stolen from many different sources including
|
|
|
|
" Steve Losh
|
|
|
|
" Junegunn Choi
|
|
|
|
" Tim Pope
|
|
|
|
|
|
|
|
" }}}
|
|
|
|
" PLUGIN INSTALLATION - handled by VIM-PLUG {{{
|
|
|
|
" ================================================================================
|
|
|
|
"
|
2019-03-20 13:06:46 +00:00
|
|
|
" automatically install vim-plug if it does not exist
|
|
|
|
" Note: this installs it in the neovim folder, not the vim folder
|
2019-05-15 08:28:12 +00:00
|
|
|
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
|
2019-03-20 13:06:46 +00:00
|
|
|
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
2019-05-15 08:28:12 +00:00
|
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | q
|
2019-03-20 13:06:46 +00:00
|
|
|
endif
|
|
|
|
|
2019-03-20 15:09:48 +00:00
|
|
|
" automatically install any missing plugins
|
|
|
|
autocmd VimEnter *
|
|
|
|
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
|
|
|
\| PlugInstall --sync | q
|
|
|
|
\| endif
|
|
|
|
|
2019-03-13 14:08:39 +00:00
|
|
|
" defines plugin directory
|
2019-03-04 10:47:17 +00:00
|
|
|
" Install plugins from vim with :PlugInstall
|
2019-03-20 13:28:50 +00:00
|
|
|
silent! if plug#begin('~/.local/share/nvim/plugged')
|
2019-03-04 10:47:17 +00:00
|
|
|
|
2019-11-21 16:21:53 +00:00
|
|
|
" ultimately the only thing left here should be a
|
|
|
|
runtime! pluglist/**/*.vim
|
|
|
|
|
2019-11-18 21:55:15 +00:00
|
|
|
" Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } ->
|
|
|
|
" instructions: http://liuchengxu.org/vim-which-key/, needs setup tp become
|
|
|
|
" useful. TODO enable when setup is more settled down
|
2019-03-13 14:08:39 +00:00
|
|
|
|
2019-03-04 10:47:17 +00:00
|
|
|
call plug#end()
|
2019-03-20 13:28:50 +00:00
|
|
|
endif
|
2019-03-09 20:27:14 +00:00
|
|
|
|
2019-03-20 13:27:54 +00:00
|
|
|
" }}}
|
|
|
|
" VIM SETTINGS {{{
|
|
|
|
" ================================================================================
|
|
|
|
"
|
2019-03-13 14:08:39 +00:00
|
|
|
" set truecolor (neovim)
|
|
|
|
set termguicolors
|
|
|
|
|
2019-03-20 15:09:48 +00:00
|
|
|
" sets tabs to be 2 characters, expanded into spaces, but still removable with
|
2019-03-09 20:27:14 +00:00
|
|
|
" one press of backspace.
|
|
|
|
" great explanation: http://vimcasts.org/transcripts/2/en/
|
2019-03-17 18:45:29 +00:00
|
|
|
set tabstop=2
|
|
|
|
set shiftwidth=2
|
|
|
|
set softtabstop=2
|
2019-03-09 20:27:14 +00:00
|
|
|
set expandtab
|
|
|
|
|
2019-03-20 15:09:48 +00:00
|
|
|
" set cursor line highlighting, esp useful when using with bracket
|
|
|
|
" highlighting and you don't know which side of the brace the cursor is on
|
|
|
|
set cursorline
|
|
|
|
|
2019-03-09 20:27:14 +00:00
|
|
|
" shows linenumbers relative to the one you are on, for easy movement and
|
|
|
|
" dNUMBERd deletions
|
2019-03-20 15:09:48 +00:00
|
|
|
set number relativenumber
|
2019-03-09 20:27:14 +00:00
|
|
|
|
|
|
|
" keeps an undofile next to files so that you can even undo if vim is closed
|
|
|
|
" in between
|
|
|
|
set undofile
|
|
|
|
|
|
|
|
" ignores case by default but will use case when search is specifically not
|
|
|
|
" all lowercased
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
|
2019-03-13 14:08:39 +00:00
|
|
|
" whenever vim loses focus, save
|
|
|
|
au FocusLost * :wa
|
|
|
|
|
2019-03-13 16:18:47 +00:00
|
|
|
" disables showing us the current mode in the command line since airline takes
|
|
|
|
" care of it
|
|
|
|
set noshowmode
|
|
|
|
|
2019-03-17 18:45:29 +00:00
|
|
|
" highlight everything that goes over 80 columns
|
|
|
|
highlight ColorColumn ctermbg=magenta
|
|
|
|
call matchadd('ColorColumn', '\%81v', 100)
|
|
|
|
|
2019-09-18 14:01:43 +00:00
|
|
|
" Special setting for editing gopass files - make sure nothing leaks outside
|
|
|
|
" the directories it is supposed to
|
|
|
|
au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile
|
|
|
|
|
2019-03-20 13:27:54 +00:00
|
|
|
" }}}
|
|
|
|
" KEYBINDINGS {{{
|
|
|
|
" ================================================================================
|
2019-03-13 14:08:39 +00:00
|
|
|
"
|
2019-09-02 19:44:54 +00:00
|
|
|
|
2019-11-21 13:57:07 +00:00
|
|
|
" Begin mapping definitions
|
|
|
|
runtime! **/maps.vim
|
2019-06-04 11:28:15 +00:00
|
|
|
|
|
|
|
" }}}
|
|
|
|
" ABBREVIATIONS {{{
|
|
|
|
|
|
|
|
" Typos
|
|
|
|
iabbrev adn and
|
|
|
|
iabbrev waht what
|
|
|
|
iabbrev tehn then
|
|
|
|
iabbrev whit with
|
|
|
|
iabbrev whith with
|
|
|
|
|
|
|
|
" Text expansion
|
2019-11-21 13:57:07 +00:00
|
|
|
iabbrev mo@ marty.oehme@gmail.com
|
|
|
|
iabbrev mo.me@ <https://martyoeh.me/>
|
|
|
|
iabbrev mcc@ Copyright 2019 Marty Oehme, all rights reserved.
|
2019-06-04 11:28:15 +00:00
|
|
|
|
|
|
|
"
|
2019-03-20 13:27:54 +00:00
|
|
|
" }}}
|
|
|
|
" END
|
|
|
|
" ================================================================================
|