-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
668 lines (632 loc) · 21.5 KB
/
init.vim
File metadata and controls
668 lines (632 loc) · 21.5 KB
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
" TODO: migrate to init.lua
" TODO: Move plugin configurations into separate Lua modules (e.g., `lua/plugins/`, `lua/config/`)
" TODO: Consider replacing `vim-test` with `neotest`/`neotest-rspec` for better integration
let g:mapleader=','
lua << EOF
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
"tpope/vim-sensible",
"tpope/vim-commentary",
"tpope/vim-fugitive",
"tpope/vim-rhubarb",
"tpope/vim-surround",
"tpope/vim-eunuch",
"tpope/vim-repeat",
"tpope/vim-bundler",
{
"tpope/vim-rails",
dependencies = {"tpope/vim-projectionist"},
},
"tpope/vim-characterize",
"tpope/vim-haml",
{
"tpope/vim-dispatch",
config = function()
vim.g.dispatch_quickfix_height = 25
vim.g.dispatch_tmux_height = 25
end
},
"tpope/vim-abolish",
"tpope/vim-capslock", -- software capslock: <C-g>c in insert mode
"tpope/vim-endwise",
"tpope/vim-projectionist",
"yegappan/greplace",
{
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" }, -- optional icon support
opts = {
winopts = {
height = 0.6,
width = 1.0,
row = 1,
border = "rounded",
},
files = {
true, -- uncomment to inherit all the below in your custom config
-- `file_edit_or_qf` opens a single selection or sends multiple selection to quickfix
-- replace `enter` with `file_edit` to open all files/bufs whether single or multiple
-- replace `enter` with `file_switch_or_edit` to attempt a switch in current tab first
-- ["enter"] = actions.file_edit_or_qf,
-- ["ctrl-s"] = actions.file_split,
-- ["ctrl-v"] = actions.file_vsplit,
-- ["ctrl-t"] = actions.file_tabedit,
-- ["alt-q"] = actions.file_sel_to_qf,
-- ["alt-Q"] = actions.file_sel_to_ll,
-- ["alt-i"] = actions.toggle_ignore,
-- ["alt-h"] = actions.toggle_hidden,
-- ["alt-f"] = actions.toggle_follow,
},
},
},
"AndrewRadev/splitjoin.vim",
-- <CR> text object for entire buffer
{
"vim-utils/vim-all",
dependencies = { "kana/vim-textobj-user" }
},
-- <Space> text object for whitespace
{
"vim-utils/vim-space",
dependencies = { "kana/vim-textobj-user" }
},
{
-- Arrow keys move visual select blocks
"zirrostig/vim-schlepp",
keys = {
{ "<up>", "<Plug>SchleppUp", mode = "v" },
{ "<down>", "<Plug>SchleppDown", mode = "v" },
{ "<left>", "<Plug>SchleppLeft", mode = "v" },
{ "<right>", "<Plug>SchleppRight", mode = "v" }
},
config = function()
vim.g.Schlepp_allowSquishingBlock = 1
vim.g.Schlepp_allowSquishingLines = 1
end,
},
"justinmk/vim-gtfo",
{
"talek/obvious-resize",
config = function()
vim.g.obvious_resize_default = 5
end,
keys = {
{ "<up>", ":<C-U>ObviousResizeUp<CR>", mode = "n", silent = true },
{ "<down>", ":<C-U>ObviousResizeDown<CR>", mode = "n", silent = true },
{ "<left>", ":<C-U>ObviousResizeLeft<CR>", mode = "n", silent = true },
{ "<right>", ":<C-U>ObviousResizeRight<CR>", mode = "n", silent = true },
},
},
"https://git.sr.ht/~ackyshake/spacegray.vim",
{
"honza/vim-snippets",
dependencies = {
"MarcWeber/vim-addon-mw-utils",
"tomtom/tlib_vim",
"SirVer/ultisnips"
}
},
{
"simplenote-vim/simplenote.vim",
config = function()
vim.cmd("source ~/.simplenoterc")
vim.g.SimplenoteNoteFormat = '%N%>[%D]'
vim.g.SimplenoteStrftime = '%Y-%m-%d %H:%M:%S'
end,
},
"jeetsukumaran/vim-indentwise",
"kopischke/vim-fetch", -- jump to line/col
"machakann/vim-highlightedyank",
"m1foley/vim-expresso",
"travisjeffery/vim-auto-mkdir",
"johngrib/vim-game-code-break",
{
"uptech/vim-ping-cursor",
config = function()
vim.g.ping_cursor_flash_milliseconds = 100
end
},
{
"tyru/open-browser.vim",
config = function()
vim.g.netrw_nogx = 1
end,
keys = {
{ "gx", "<Plug>(openbrowser-smart-search)", mode = "n" },
{ "gx", "<Plug>(openbrowser-smart-search)", mode = "v" },
},
},
"markonm/traces.vim", -- preview substitutions
{
"vim-test/vim-test",
config = function()
vim.g["test#strategy"] = "dispatch"
vim.g["test#ruby#rspec#options"] = {
nearest = "--backtrace --no-color",
file = "--format documentation --no-color",
suite = "--no-color --tag ~slow",
}
end
},
"powerman/vim-plugin-AnsiEsc",
-- language-specific plugins
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = { "solargraph", "standardrb" },
automatic_installation = true,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- Ruby LSP setup with solargraph
vim.lsp.config.solargraph = {
cmd = { "solargraph", "stdio" },
filetypes = { "ruby" },
root_markers = { "Gemfile", ".git" },
capabilities = capabilities,
settings = {
solargraph = {
diagnostics = false, -- Disable to avoid conflicts with standardrb
completion = true,
hover = true,
formatting = false, -- We'll use standardrb for formatting
}
}
}
-- StandardRB for Ruby formatting and linting
vim.lsp.config.standardrb = {
cmd = { "standardrb", "--lsp" },
filetypes = { "ruby" },
root_markers = { "Gemfile", ".git", ".standard.yml" },
capabilities = capabilities,
settings = {
standardrb = {
-- Enable formatting and linting
format = true,
lint = true,
}
}
}
-- Enable LSP servers for Ruby files
vim.api.nvim_create_autocmd('FileType', {
pattern = 'ruby',
callback = function()
vim.lsp.enable('solargraph')
vim.lsp.enable('standardrb')
end,
})
-- LSP keymaps
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<Leader>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<Leader>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', '<Leader>F', function()
vim.lsp.buf.format { async = true }
end, opts)
end,
})
-- Configure diagnostics
vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
})
-- Diagnostic signs
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end
},
{
"paulyeo21/vim-textobj-rspec",
dependencies = { "kana/vim-textobj-user" }
},
"sunaku/vim-ruby-minitest",
"ck3g/vim-change-hash-syntax",
{
"hashivim/vim-terraform",
config = function()
vim.g.terraform_fmt_on_save = 1
end
},
"elixir-editors/vim-elixir",
-- {
-- "mhinz/vim-mix-format",
-- config = function()
-- vim.g.mix_format_on_save = 1
-- end
-- },
{
"andyl/vim-textobj-elixir",
dependencies = { "kana/vim-textobj-user" }
},
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"j-hui/fidget.nvim",
},
config = function()
require("codecompanion").setup({
strategies = {
chat = {
adapter = "sfdc_eng_ai_model_gateway",
roles = {llm = "🤖", user = "Me",},
-- C-s submits to LLM instead of Return
keymaps = {
send = {
modes = { n = "<C-s>", i = "<C-s>" },
opts = {},
},
close = {
modes = { n = "<C-c>", i = "<C-c>" },
opts = {},
},
},
tools = {
-- Timeout waiting for user input/confirmation (1 hour)
opts = { wait_timeout = 3600000 },
},
},
},
adapters = {
http = {
sfdc_eng_ai_model_gateway = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "cmd:echo $SFDC_AI_API_HOST",
api_key = "cmd:echo $SFDC_AI_API_KEY",
},
schema = {
model = {
-- https://docs.internal.salesforce.com/ai/express-llm-gateway/home/
default = "claude-opus-4-5-20251101"
-- default = "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
},
temperature = {default = 0.2},
max_completion_tokens = {default = 4096},
},
})
end,
},
},
display = {
chat = {
intro_message = "CodeCompanion ✨ Press ? for options",
show_header_separator = true,
show_token_count = false,
},
},
})
-- CodeCompanion keymaps:
-- <C-a> opens CodeCompanionActions
vim.keymap.set({ "n", "v" }, "<C-a>", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true })
-- <Leader>a toggles CodeCompanionChat
vim.keymap.set({ "n", "v" }, "<Leader>a", "<cmd>CodeCompanionChat Toggle<cr>", { noremap = true, silent = true })
-- ga adds the visual selection to CodeCompanionChat
vim.keymap.set("v", "ga", "<cmd>CodeCompanionChat Add<cr>", { noremap = true, silent = true })
-- File picker function for CodeCompanion /file references
local function insert_file_with_picker()
require('fzf-lua').files({
prompt = "Select file to reference: ",
actions = {
['default'] = function(selected)
if selected and #selected > 0 then
local file_path = selected[1]
vim.api.nvim_put({"/file " .. file_path .. " "}, "c", true, true)
end
end
}
})
end
-- Shortcuts within CodeCompanion chat:
vim.api.nvim_create_autocmd("FileType", {
pattern = "codecompanion",
callback = function()
-- <C-d> inserts full_stack_dev tool for maximum vibing
vim.keymap.set("i", "<C-d>", "@{full_stack_dev} ", { buffer = true, noremap = true, silent = true })
-- <C-b> inserts buffer variable
vim.keymap.set("i", "<C-b>", "#{buffer} ", { buffer = true, noremap = true, silent = true })
-- <C-f> opens file picker and inserts /file reference
vim.keymap.set("i", "<C-f>", insert_file_with_picker, { buffer = true, noremap = true, silent = true })
end,
})
-- AI progress updates
local progress = require("fidget.progress")
local FidgetIntegration = {}
FidgetIntegration.handles = {}
function FidgetIntegration:store_progress_handle(id, handle)
self.handles[id] = handle
end
function FidgetIntegration:pop_progress_handle(id)
local handle = self.handles[id]
self.handles[id] = nil
return handle
end
function FidgetIntegration:create_progress_handle(request)
return progress.handle.create({
title = "",
message = "⏳",
lsp_client = {name = ""},
})
end
function FidgetIntegration:report_exit_status(handle, request)
if request.data.status == "success" then
handle.message = "✔"
elseif request.data.status == "error" then
handle.message = " Error"
else
handle.message = " Cancelled"
end
end
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestStarted",
group = group,
callback = function(request)
local handle = FidgetIntegration:create_progress_handle(request)
FidgetIntegration:store_progress_handle(request.data.id, handle)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestFinished",
group = group,
callback = function(request)
local handle = FidgetIntegration:pop_progress_handle(request.data.id)
if handle then
FidgetIntegration:report_exit_status(handle, request)
handle:finish()
end
end,
})
end
},
{
"LunarVim/bigfile.nvim",
config = function()
require("bigfile").setup({
filesize = 40, -- MB
})
end,
},
},
install = { colorscheme = { "habamax" } },
-- checker = { enabled = true }, -- automatically check for plugin updates
auto_install = true,
})
EOF
" set directory=.,./.tmp,/tmp//
" set directory=/tmp// "swap files
" set backupdir=/tmp,. "tilde files
set statusline=%<%f\ " filename
set statusline+=%-7h " help status
set statusline+=%-4m " modified flag
set statusline+=%-5r " readonly flag
if exists('*fugitive#statusline')
set statusline+=%{fugitive#statusline()}\ " Git status
endif
set statusline+=%=%-14.(%l,%c%V%) " line/column
set statusline+=%30(%=%<%P%) " rulerformat
set startofline
set number
set ignorecase
set smartcase
set sidescroll=10
set sidescrolloff=2
set lazyredraw
set expandtab
set softtabstop=2
set tabstop=2
set shiftwidth=2
set shiftround
set splitbelow splitright
set winminheight=0
set mouse= " disable mouse
set mousehide
set visualbell
set list " display extra whitespace
set synmaxcol=256
set hlsearch
set incsearch
set nohidden " don't close an unsaved buffer
set shortmess=aoOtT
let g:netrw_liststyle=3 " netrw default to tree view
" set printoptions+=header:0
set tags^=./.git/tags; " ctags support
let ruby_minlines = 100
let g:markdown_fenced_languages = ['ruby', 'rb=ruby', 'sh', 'bash=sh', 'javascript', 'js=javascript']
set nofoldenable
" set guifont=Monaco:h16
set background=dark
colorscheme spacegray
set termguicolors
let g:python3_host_prog = expand('~/.config/nvim/venv/bin/python')
set grepprg=ag\ --smart-case\ --vimgrep\ --path-to-ignore\ ~/.ignore
set grepformat=%f:%l:%c:%m
function! Grep(...)
" normal/visual mode
if a:0 > 0
" strip accidental newlines from visual mode
let s:grep_term = substitute(a:1, '\n\+$', '', '')
let s:interpret_as_literal = 1
" command-line mode
else
let s:grep_term = ''
let s:interpret_as_literal = 0
endif
if len(s:grep_term) < 3
let s:grep_term = input("Search: ")
let s:interpret_as_literal = 0
endif
if len(s:grep_term) >= 3
if s:interpret_as_literal
let s:grep_term = shellescape(s:grep_term)
let s:grep_term = substitute(s:grep_term, '[|#]', '\\\0', 'g')
execute 'silent grep! -Q --' s:grep_term
else
execute 'silent grep!' s:grep_term
endif
copen
resize 20
endif
redraw!
endfunction
nnoremap <silent> \ :call Grep()<CR>
nnoremap <silent> K :call Grep(expand('<cword>'))<CR>
vnoremap <silent> K "gy :call Grep(@g)<CR>:call setreg('g', [])<CR>
" ale + standardrb
let g:ale_linters = {'ruby': ['standardrb']}
let g:ale_fixers = {'ruby': ['standardrb']}
let g:ruby_indent_assignment_style = 'variable'
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 'never'
let g:ale_lint_on_insert_leave = 'never'
let g:ale_fix_on_save = 0
let g:ale_lint_on_save = 1
" recognize heex extention for Elixir templates
autocmd BufRead,BufNewFile *.html.heex set filetype=eelixir
" automatically format when saving Elixir
autocmd BufWritePre *.ex,*.exs Dispatch! mix format %
" quickfix: o opens file in split
augroup quickfix
autocmd!
autocmd FileType qf nnoremap <buffer> o <C-W><CR>
augroup end
" don't open binary files
augroup nonvim
autocmd!
autocmd BufRead *.png,*.jpg,*.pdf,*.gif,*.xls*,*.ppt*,*.doc,*.docx,*.rtf bd! | let &ft=&ft | echoerr "Binary file not opened."
augroup end
" escape ANSI escape sequences in log files
augroup logfile
autocmd!
autocmd BufReadPost *.log :AnsiEsc
augroup end
" make non-ascii chars stand out
autocmd BufReadPost * syntax match nonascii "[^\u0000-\u007F]"
highlight nonascii guibg=Red ctermbg=1 term=standout
" spellcheck git commit messages
autocmd BufRead,BufNewFile COMMIT_EDITMSG set spell
" -o = Don't continue comment when hitting o
" +l = Don't break long lines in insert mode
autocmd FileType * set formatoptions-=o formatoptions+=l
" tcsh-style command line
cnoremap <C-A> <Home>
" cnoremap <C-F> <S-Right>
" cnoremap <C-B> <S-Left>
cnoremap <C-E> <End>
" Typos
cabbrev q1 q!
cabbrev qa1 qa!
iabbrev contet context
noremap Q <silent>
noremap ZA :qa!<CR>
" Control key jumps between panes
noremap <C-k> <C-w>k
noremap <C-j> <C-w>j
noremap <C-h> <C-w>h
" C-e and C-y scroll 3 lines instead of 1
noremap <C-e> 3<C-e>
noremap <C-y> 3<C-y>
" expand %% to current directory in command-line mode
" http://vimcasts.org/episodes/the-edit-command/
cnoremap %% <C-r>=expand('%:h').'/'<CR>
" gp selects last paste
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" <C-l> modified from vim-sensible to ping cursor
nnoremap <silent> <C-l> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR>:PingCursor<CR><C-L>
" ,c replace until next underscore
nnoremap <Leader>c ct_
" ,| go to 80th column
nnoremap <Leader><Bar> 80<Bar>
vnoremap <Leader><Bar> 80<Bar>
" ,, open previously edited file
nnoremap <Leader><Leader> <C-^>
" ,<Space> strip all trailing whitespace from current file
nnoremap <Leader><Space> :%s/\s\+$//e<CR>
" ,d diff all
nnoremap <Leader>d :diffthis<CR><C-w><C-w>:diffthis<CR>
" ,D diff off
nnoremap <Leader>D :diffoff<CR><C-w><C-w>:diffoff<CR>
" ,n Simplenote list
nnoremap <Leader>n :SimplenoteList<CR>
" ,y use clipboard register: "+
nnoremap <Leader>y "+
vnoremap <Leader>y "+
" ,<UP> restore arrow keys
nnoremap <silent> <Leader><UP> :nunmap <LT>LEFT>\|nunmap <LT>RIGHT>\|nunmap <LT>DOWN>\|nunmap <LT>UP>\|echo 'Arrow keys restored.'<CR>
" ,5 !open current file
nnoremap <Leader>5 :!open %<CR>
" ,L git log -p
nnoremap <Leader>L :Git log -p %<CR>
" ,g Fugitive git status
nnoremap <Leader>g :Git<CR>
" ,j format JSON
nnoremap <Leader>j :%!jq .
" nnoremap <Leader>j :%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin, object_pairs_hook=collections.OrderedDict), indent=2)"<CR>:%s/\s\+$//e<CR>:set filetype=json<CR>
" ,f set filetype to ruby
nnoremap <Leader>f :set filetype=ruby<CR>
" ctrl-r ,d in insert/command mode inserts today's date
inoremap <silent> <C-r><Leader>d <C-r>=strftime("%Y-%m-%d")<CR>
cnoremap <C-r><Leader>d <C-r>=strftime("%Y-%m-%d")<CR>
" <C-p> FZF
nnoremap <C-p> <cmd>lua require('fzf-lua').files()<CR>
" ,h most recently used files
nnoremap <silent> <Leader>h <cmd>lua require('fzf-lua').oldfiles()<CR>
" ,w autopopulate GUS ticket in commit msg
nnoremap <Leader>w /^# Please eO4j/ W-l2yt-{o@0OdipOk
" vim-test mappings
nmap <Leader>t :TestFile<CR>
" TODO: change vim-test options per lanuage
" nmap <Leader>ft :TestFile --max-failures 1<CR>
nmap <Leader>ft :TestFile --fail-fast<CR>
nmap <Leader>s :TestNearest<CR>
nmap <Leader>is :Dispatch iex -S mix test %:<C-r>=line(".")<CR><CR>
" nmap <Leader>fs :TestNearest --max-failures 1<CR>
nmap <Leader>fs :TestNearest --fail-fast<CR>
nmap <Leader>l :TestLast<CR>
" nmap <Leader>fl :TestLast --max-failures 1<CR>
nmap <Leader>fl :TestLast --fail-fast<CR>
autocmd Filetype ruby call LoadRubyMaps()
function! LoadRubyMaps()
set textwidth=80
" vim-rails mappings
nnoremap <Leader>r :Rails<CR>
vnoremap <Leader>r :Rails<CR>
" ,: update Ruby hash syntax
vnoremap <silent> <Leader>: :ChangeHashSyntax<CR>
" ,m memoize a Ruby method
nmap <Leader>m [mwy$oreturn @0 if defined?(@0)jI@0 = l
endfunction