- to get some of the functions/ functionality I missed from emacs into neovim and learn some lua
- main goal is better terminal interop
- there are several 'supported' frameworks or languages with extended funcitonality
- the main goal with these is to make commands that would otherwise be executed in the terminal easier
- they aren't full featured enough to stand on their own legs (yet) so I've kept them as part of termbro
-
CompileCurrent
-
CheatSheet
-
OpenTerm
- Node & Npm
- interactively run
npm
commands from project root - lsp server required (for finding root dir)
- interactively run
- Ruby & Ruby on Rails
- run the server
- open a console
- basic function for sending any command you might want
- uses project specific (
bin/rails
) for commands
- uses project specific (
- testing a file
- shows little 'x's where the tests are failing
- current buffer must be the file to be tested
- Django
- interactively run
manage.py
commands
- interactively run
- use these for all filetypes
- just some examples of how to integrate functions, not all represented
-- JS load
vim.api.nvim_create_autocmd(
"FileType",
{
pattern = {
"javascript",
},
command = [[
nnoremap <silent><buffer> <Space>Lb :LoadNode J<CR>
nnoremap <silent><buffer> <Space>Ls :LoadNode L<CR>
]],
}
)
-- ruby load
vim.api.nvim_create_autocmd(
"FileType",
{
pattern = {
"ruby",
},
command = [[
nnoremap <silent><buffer> <Space>Lb :LoadIRB J<CR>
nnoremap <silent><buffer> <Space>Ls :LoadIRB L<CR>
nnoremap <silent><buffer> <Space>rc :RailsCommand J true console --sandbox<CR>
nnoremap <silent><buffer> <Space>rr :RailsCommand J true server<CR>
]],
}
)
-- Python Django
vim.api.nvim_create_autocmd(
"FileType",
{
pattern = {
"python",
},
command = [[
nnoremap <silent><buffer> <Space>Lb :ManagePy J<CR>
nnoremap <silent><buffer> <Space>Ls :ManagePy L<CR>
set listchars=eol:↵,multispace:---+
]],
}
)
- add these to a Filetype autocommand
-- Cht.sh
local keymap = vim.keymap.set
keymap('n', '<Space>cs', "<cmd> CheatSheet<CR>", { noremap = true, silent = true })
-- Compile
keymap('n', '<Space>cc', "<cmd> CompileCurrent<CR>", { noremap = true, silent = true })
-- terminal
keymap({ 'n', 'i' }, '<C-c><C-z>', '<cmd> OpenTerm<CR>', { noremap = true, silent = true })
keymap('t', '<C-c><C-z>', '<C-\\><C-N> <cmd> OpenTerm<CR>]', { noremap = true, silent = true })