feat: Add Oil and Neotest to Neovim

This commit is contained in:
Michael Yockey
2024-05-17 20:32:56 -04:00
parent 1298bc4b13
commit da5c16e736
6 changed files with 51 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" },
"cloak.nvim": { "branch": "main", "commit": "6e5bcd50bebc5cdb7cd3a00eb3d97ab7c4cc3b94" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@@ -11,25 +12,27 @@
"cmp-tmux": { "branch": "main", "commit": "95b1b921802e6f60627b3e76afb9380fddd87f9a" },
"cmp-zsh": { "branch": "main", "commit": "c24db8e58fac9006ec23d93f236749288d00dec9" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" },
"git-blame.nvim": { "branch": "master", "commit": "ad1d1365c9189d89797fe8d559677d5f55dc2830" },
"gitmoji.nvim": { "branch": "main", "commit": "326ddf01cbf3425566a089126ece7e8bd2560601" },
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" },
"neotest-rspec": { "branch": "main", "commit": "201f4891b5a0edc2e5f12196f35726f4d4eca410" },
"nvim": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
"nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" },
"nvim-dap-ruby": { "branch": "main", "commit": "a2248b7b31f6f096b9e847e769afd00060e0aae4" },
"nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" },
"nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" },
"nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" },
"nvim-nio": { "branch": "master", "commit": "7fa5545299fc7a48d5ec74d27f414b862060095f" },
"nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "19f69a5b434470723c32311cdc4d8d0e8db76358" },
"nvim-web-devicons": { "branch": "master", "commit": "27eac98fd6675d29d0e19d4d0622fd7a3968483a" },
"nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" },
"nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" },
"oil.nvim": { "branch": "master", "commit": "f630887cd845a7341bc16488fe8aaecffe3aaa8a" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"rspec.nvim": { "branch": "main", "commit": "c9b9d530707221483ad737ca5329110b8e4b5a23" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },

View File

@@ -46,9 +46,6 @@ return {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint.enable(ev.buf, true)
end
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'

View File

@@ -0,0 +1,31 @@
return {
'nvim-neotest/neotest',
dependencies = {
'nvim-neotest/nvim-nio',
'nvim-lua/plenary.nvim',
'antoinemadec/FixCursorHold.nvim',
'nvim-treesitter/nvim-treesitter',
'olimorris/neotest-rspec',
},
config = function()
local neotest = require('neotest')
local rspec = require('neotest-rspec')
neotest.setup({
adapters = {
require('neotest-rspec'),
},
})
rspec({
rspec_cmd = function()
return vim.tbl_flatten({
'bin/rspec',
})
end
})
vim.keymap.set('n', '<leader>rn', function() require('neotest').run.run() end, { desc = 'Run nearest test' })
vim.keymap.set('n', '<leader>rf', function() require('neotest').run.run(vim.fn.expand("%")) end, { desc = 'Run current file tests' })
vim.keymap.set('n', '<leader>no', function() require('neotest').output.open({ enter = true, auto_close = true }) end, { desc = 'Open Neotest output window' })
end,
}

View File

@@ -0,0 +1,12 @@
return {
'stevearc/oil.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
view_options = {
show_hidden = true,
},
},
keys = {
{ '-', '<CMD>Oil<CR>', { desc = 'Open parent directory' } },
},
}

View File

@@ -1,23 +0,0 @@
return {
'mogulla3/rspec.nvim',
opts = {
allowed_file_format = function(filename)
return vim.endswith(filename, '_spec.rb')
end,
formatter = 'progress',
focus_on_last_spec_result_window = true,
open_quickfix_when_spec_failed = true,
last_result_path = vim.fn.stdpath('data') .. '/rspec_last_result',
last_failed_result_path = vim.fn.stdpath('data') .. '/rspec_last_failed_result',
jump_command = 'edit',
ignored_dirs_on_jump = {},
},
keys = {
{ '<leader>rn', '<cmd>RSpecNearest<cr>', desc = 'Run nearest spec' },
{ '<leader>rf', '<cmd>RSpecCurrentFile<cr>', desc = 'Run spec file' },
{ '<leader>rr', '<cmd>RSpecRerun<cr>', desc = 'Run last spec' },
{ '<leader>rF', '<cmd>RSpecOnlyFailures<cr>', desc = 'Run previously failed specs' },
{ '<leader>rR', '<cmd>RSpecShowLastResult<cr>', desc = 'Show last result' },
},
}

View File

@@ -1,5 +1,3 @@
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = 'Ex mode' })
-- Move highlights
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")