config/nvim/init.vim (view raw)
1" _ _ _ _
2"(_)_ __ (_) |___ _(_)_ __ ___
3"| | '_ \| | __\ \ / / | '_ ` _ \
4"| | | | | | |_ \ V /| | | | | | |
5"|_|_| |_|_|\__(_)_/ |_|_| |_| |_|
6"
7
8
9call plug#begin()
10Plug 'jiangmiao/auto-pairs'
11Plug 'airblade/vim-gitgutter'
12Plug 'git@fern:vim/vim-colors-plain'
13Plug 'dbeniamine/vim-mail', { 'for': ['mail'] }
14Plug 'tpope/vim-surround'
15" plugins for writing {{{
16Plug 'reedes/vim-pencil', { 'for': ['text', 'markdown'] }
17Plug 'plasticboy/vim-markdown', { 'for': ['text', 'markdown'] }
18" }}}
19Plug 'ervandew/supertab'
20Plug 'wellle/targets.vim'
21Plug 'tpope/vim-rsi'
22Plug 'zah/nim.vim', { 'for': ['nim'] }
23call plug#end()
24
25augroup restorecursor
26 autocmd BufReadPost *
27 \ if line("'\"") > 1 && line("'\"") <= line("$") |
28 \ execute "normal! g`\"" |
29 \ endif
30augroup END
31
32" basic settings
33set swapfile
34set dir=/tmp
35set nonumber
36set smartcase
37syntax on
38filetype plugin indent on
39set laststatus=2
40set hlsearch
41set incsearch
42set ignorecase
43set scrolloff=12
44set rtp+=~/.fzf
45set timeout timeoutlen=3000 ttimeoutlen=100
46set undodir=~/.vim/undodir
47set nowrap
48set nocursorline
49set nofoldenable
50set conceallevel=2
51set mouse=a
52set wildmenu
53set shiftwidth=4 " indent = 4 spaces
54set tabstop=4 " tab = 4 spaces
55set expandtab
56set softtabstop=4 " backspace through spaces
57set nocompatible
58set noshowmode
59set clipboard=unnamedplus
60set hidden
61
62" wildcard ignores
63set wildignore+=.git,.hg,.svn
64set wildignore+=*.aux,*.out,*.toc
65set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
66set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
67set wildignore+=*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
68set wildignore+=*.mp3,*.oga,*.ogg,*.wav,*.flac
69set wildignore+=*.eot,*.otf,*.ttf,*.woff
70set wildignore+=*.doc,*.pdf,*.cbr,*.cbz
71set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
72set wildignore+=*.swp,.lock,.DS_Store,._*
73
74" colorscheme
75colorscheme plain
76set background=dark
77
78" git gutter settings
79let g:gitgutter_override_sign_column_highlight = 0
80let g:gitgutter_sign_added = '+'
81let g:gitgutter_sign_modified = '±'
82let g:gitgutter_sign_removed = '-'
83let g:gitgutter_sign_removed_first_line = '^'
84let g:gitgutter_sign_modified_removed = '#'
85
86" comments are italicized
87hi Comment cterm=italic
88" color overrides
89hi CursorLine ctermbg=none
90
91" vim-pencil
92let g:pencil#textwidth = 72
93let g:pencil#conceallevel = 0
94
95augroup setMail
96 autocmd!
97 autocmd BufRead,BufNewFile /tmp/nail-* setlocal ft=mail
98augroup END
99
100" insert date
101abclear
102cabbrev dt read !~/bin/date.sh<cr>
103cabbrev tm read !date "+\%H:\%M"
104
105" change cursor
106" doesn't actually work :(
107if exists('$TMUX')
108 let &t_SI .= "\ePtmux;\e\e[6 q\e\\"
109 let &t_EI .= "\ePtmux;\e\e[2 q\e\\"
110 let &t_SR .= "\ePtmux;\e\e[4 q\e\\"
111else
112 let &t_SI .= "\e[6 q"
113 let &t_EI .= "\e[2 q"
114 let &t_SR .= "\e[4 q"
115endif