-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.vim
159 lines (138 loc) · 4.56 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
filetype off
" Bypass pyenv or virtualenv. Just use the user-local package, rather than
" expecting the current Python env to be sane, especially if being developed
" in, moreso if foreign.
let g:python_host_prog = '/usr/bin/python2'
let g:python3_host_prog = '/usr/bin/python3'
set rtp+=~/.config/nvim/bundle/vundle/
call vundle#rc()
Plugin 'altercation/vim-colors-solarized'
Plugin 'chrisbra/Recover.vim'
Plugin 'chrisbra/unicode.vim'
Plugin 'chrisbra/vim-diff-enhanced'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'edkolev/promptline.vim'
Plugin 'edkolev/tmuxline.vim'
Plugin 'gmarik/vundle'
Plugin 'godlygeek/tabular'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'justinmk/vim-dirvish'
Plugin 'mbbill/undotree'
Plugin 'mhinz/vim-startify'
Plugin 'michaeljsmith/vim-indent-object'
Plugin 'navarasu/onedark.nvim'
Plugin 'ngmy/vim-rubocop'
Plugin 'nvie/vim-flake8'
Plugin 'nvim-treesitter/nvim-treesitter'
Plugin 'paranoida/vim-airlineish'
Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'reedes/vim-wordy'
Plugin 'rliang/termedit.nvim'
Plugin 'RRethy/nvim-base16'
Plugin 'sainnhe/sonokai'
Plugin 'tanvirtin/monokai.nvim'
Plugin 'thinca/vim-visualstar'
Plugin 'tomasr/molokai'
Plugin 'tommcdo/vim-exchange'
Plugin 'tpope/vim-abolish'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-eunuch'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-projectionist'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
filetype plugin indent on
" tree-sitter does it for us at the right time
"syntax on
set guifont=Menlo:h24
if &t_Co >= 256
"let g:rehash256 = 1 " too pale
colorscheme molokai
"colorscheme base16-monokai
else
if &diff
colorscheme darkblue
endif
endif
set fillchars+=vert:█
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab
set shiftround
set autoindent
set indentkeys-=0#
set cinkeys-=0#
set hlsearch
set wildmenu
set wildmode=longest:full
set wmh=0
set laststatus=2
" tree-sitter now
"set foldmethod=syntax
set hidden
set incsearch
set autoread
" TODO: Mappings for cycling through these
set spelllang=en_ca
"set spelllang=fr_ca " FIXME: Region not supported
set nottimeout ttimeoutlen=-1
set cscopetag cscoperelative
set diffopt+=vertical
set undofile
set grepprg=rg\ --vimgrep\ --no-heading
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 1
let g:terminal_scrollback_buffer_size = 4096
nnoremap Y y$
nnoremap yY :%yank <C-r>=v:register<CR><CR>
nnoremap dD :%delete <C-r>=v:register<CR><CR>
" TODO: Repeatable/command version?
nmap cC dDi
nnoremap - <C-W>-
nnoremap + <C-W>+
nnoremap _ <C-W>_
nnoremap <Bar> <C-w><Bar>
" Keep the = mapping though because it's very useful.
nnoremap Q q:i
cnoremap <C-O> <Up>
" TODO: How to map without killing completion or a better mapping?
"cnoremap <C-I> <Down>
nnoremap ZA :qa!<CR>
nnoremap <silent> <Leader>t :tabs<CR>
nnoremap <silent> <Leader>b :buffers<CR>
" Stolen from Damian Conway
nnoremap <silent> <BS> :nohlsearch<CR>
nnoremap S :%s//g<Left><Left>
" Conflict with Pmenu bindings
"inoremap <C-e> <C-o><C-e>
"inoremap <C-y> <C-o><C-y>
" But what if I want to scroll rest of screen while inside Pmenu?
"inoremap <expr> <C-e> pumvisible() ? "\<C-e>" : "\<C-o>\<C-e>"
"inoremap <expr> <C-y> pumvisible() ? "\<C-y>" : "\<C-o>\<C-y>"
" FIXME: Conflicts with vim-endwise
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
" <Return> is already not that far and ingrained muscle memory for creating a
" new line—not that I couldn't unlearn it, yet this is right beside the
" backwards delete—<C-H>, so convenient and somehow oddly sensible, and kind
" of reminds of you of normal J doesn't it?
inoremap <C-j> <C-o>J
inoremap <C-l> <Del>
" https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
nnoremap <expr> n 'Nn'[v:searchforward]
nnoremap <expr> N 'nN'[v:searchforward]
" https://github.com/mhinz/vim-galore#dont-lose-selection-when-shifting-sidewards
xnoremap < <gv
xnoremap > >gv
" https://bluz71.github.io/2017/05/15/vim-tips-tricks.html#make-dot-work-over-visual-line-selections
xnoremap . :normal .<CR>
" Make macros work on each selected line individually, rather than making the
" selection a prefix/input state; assume macros were recorded starting in
" normal mode, and only meant to be run from normal mode.
xnoremap @ :'<,'>:normal @
nnoremap du :silent diffupdate<CR>
" https://ddrscott.github.io/blog/2016/yank-without-jank/
vnoremap <expr>y "my\"" . v:register . "y`y"
vnoremap <expr>Y "my\"" . v:register . "Y`y"
au TextYankPost * lua vim.highlight.on_yank {higroup="IncSearch", timeout=150, on_visual=true}