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