-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
218 lines (175 loc) · 5.46 KB
/
.vimrc
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
call plug#begin()
Plug 'jparise/vim-graphql'
Plug 'derekwyatt/vim-scala'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'vim-test/vim-test'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'morhetz/gruvbox'
" Vim Polyglot should load after language specific plugins.
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-abolish'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-repeat'
Plug 'SirVer/ultisnips'
Plug 'easymotion/vim-easymotion'
Plug 'AndrewRadev/splitjoin.vim'
Plug 'reedes/vim-pencil'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'hwartig/vim-seeing-is-believing'
" Additional text objects.
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-line'
Plug 'rhysd/vim-textobj-ruby'
Plug 'ngmy/vim-rubocop'
Plug 'bling/vim-airline'
Plug 'GEverding/vim-hocon'
Plug 'knubie/vim-kitty-navigator', {'do': 'cp ./*.py ~/.config/kitty/'}
Plug 'tpope/vim-vinegar' " Additions to the built-in netrw directory browser.
call plug#end()
set shell=/bin/sh
set nocompatible
runtime macros/matchit.vim
" Properly set the window title.
set title
let &titlestring='nvim'
" The arrow keys suck. Don't let them do anything.
noremap <up> <nop>
inoremap <up> <nop>
vnoremap <up> <nop>
noremap <down> <nop>
inoremap <down> <nop>
vnoremap <down> <nop>
noremap <left> <nop>
inoremap <left> <nop>
vnoremap <left> <nop>
noremap <right> <nop>
inoremap <right> <nop>
vnoremap <right> <nop>
""""""""""
" Settings
""""""""""
" Use the system clipboard.
set clipboard=unnamed,unnamedplus
" The default vim backspace options are a little lacking. This makes backspace
" work over the following in insert mode:
"
" * line breaks (eol)
" * automatically inserted indentation (indent)
" * the start of insert mode (start)
set backspace=2
set hlsearch " Highlight searches.
set relativenumber " Relative line numbering...
set number " with the current line number being absolute.
set cursorline " Highlight the current line.
set ignorecase " Make searches case insensitive.
set smartcase " Make searches case-sensitive if they contain upper-case.
set formatprg=par " Use par as the format program.
" Wildignore - files we don't want to find/search.
set wildignore+=*.rbc,*/doc/*,*/spec/cassettes/*,tags,*/junit/*
set spelllang=en " Set spelling region to English.
""""""""""""""""""""""""""
" Convenience Key Mappings
""""""""""""""""""""""""""
" Leader
let mapleader="\<space>"
let maplocalleader=","
" Save the current file
nnoremap <leader>w :w<CR>
" Enter visual line mode
nmap <leader><leader> V
" Skip the stupid command window
map q: :q
" Switch between two files
nnoremap <leader>; <c-^>
" Edit files in the current directory
cnoremap %% <C-R>=expand('%:h').'/'<cr>
" Clear the search buffer.
nnoremap <leader><CR> :nohlsearch<CR>
" Toggle spell-check.
nmap <silent> <leader>sp :set spell!<CR>
" Quickly edit vimrc.
nnoremap <leader>ev :tabedit $MYVIMRC<CR>
" Source vimrc.
nnoremap <leader>sv :source $MYVIMRC<CR>
" Paste that doesn't replace the default register.
vnoremap <leader>p "_dP
" Upcase the current word in normal mode.
nnoremap <leader>u viwU
" routes.rb and Gemfile
map <leader>gr :topleft :split config/routes.rb<cr>
map <leader>gg :topleft 100 :split Gemfile<cr>
map <leader>gd :topleft 100 :split config/database.yml<cr>
" Command-Dash to split screen
map <leader>v :vsplit<ESC><C-w><C-w>
map <leader>s :split<ESC><C-w><C-w>
" Visually select the text that was last edited/pasted (compare to gv)
nmap gV `[v`]
" Goto File Horizontal and Vertical Splits
map gfv <C-w>L
map gfs <C-w>f
" FZF Configuration
set rtp+=/opt/homebrew/opt/fzf
map <leader>f :GFiles<CR>
map <leader>b :Buffers<CR>
map <leader>cf :BCommits<CR>
map <leader>lf :BLines<CR>
map <leader>mf :Marks<CR>
map <leader>df :Files<CR>
" Unload Buffer Using Ctrl-W
nmap <C-x> :bd<CR>
" Easy Alignment Mappings
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
let g:easy_align_delimiters = { '>': { 'pattern': '->\|>' } }
" Convenient bindings for beginning and end of line.
nnoremap B ^
nnoremap E $
" Use AG as the VIM grep command.
set grepprg=ag\ --nogroup\ --nocolor
" Configure browser for Haskell Doc
let g:haddock_browser = "/usr/bin/chromium"
let g:haddock_browser_callformat = "%s %s"
" Pencil Configuration
let g:pencil#wrapModeDefault = 'soft'
augroup pencil
autocmd!
autocmd FileType markdown,mkd call pencil#init()
autocmd FileType text call pencil#init()
augroup END
" Disable code folding
set nofoldenable
" SplitJoin
nmap sj :SplitjoinSplit<cr>
nmap sk :SplitjoinJoin<cr>
" vim-markdown Configuration
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_frontmatter=1
" Limelight Configuration
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_paragraph_span = 1
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
" Configure Ruby Indentation
let g:ruby_indent_block_style = 'do'
" Seeing Is Believing Configuration
augroup seeingIsBelievingSettings
autocmd!
autocmd FileType ruby nmap <buffer> <leader>r <Plug>(seeing-is-believing-mark-and-run)
autocmd FileType ruby xmap <buffer> <leader>r <Plug>(seeing-is-believing-mark-and-run)
augroup END
" Enable filetype detection.
filetype plugin indent on
" Syntax and Colors
syntax enable
let g:gruvbox_contrast_dark = 'soft'
set background=dark " Setting dark mode
autocmd vimenter * colorscheme gruvbox
autocmd vimenter * highlight Normal ctermbg=NONE