-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
vim.b.copilot_enabled = false | ||
vim.g.copilot_filetypes = { ["*"] = false } | ||
|
||
-- https://zenn.dev/gentamura/articles/22ed20c9013b19 | ||
vim.g.copilot_no_tab_map = true | ||
local keymap = vim.keymap.set | ||
-- https://github.com/orgs/community/discussions/29817#discussioncomment-4217615 | ||
keymap( | ||
"i", | ||
"<C-g>", | ||
'copilot#Accept("<CR>")', | ||
{ silent = true, expr = true, script = true, replace_keycodes = false } | ||
) | ||
keymap("i", "<C-j>", "<Plug>(copilot-next)") | ||
keymap("i", "<C-k>", "<Plug>(copilot-previous)") | ||
keymap("i", "<C-o>", "<Plug>(copilot-dismiss)") | ||
keymap("i", "<C-s>", "<Plug>(copilot-suggest)") | ||
keymap("", "<Leader>c", function() | ||
vim.b.copilot_enabled = not vim.b.copilot_enabled | ||
if vim.b.copilot_enabled then | ||
print("Copilot Enabled!") | ||
else | ||
print("Copilot Disabled") | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
local iron = require("iron.core") | ||
local view = require("iron.view") | ||
local bracketed_paste = require("iron.fts.common").bracketed_paste | ||
local executable = function(exe) | ||
return vim.api.nvim_call_function('executable', {exe}) == 1 | ||
end | ||
|
||
iron.setup { | ||
config = { | ||
-- Whether a repl should be discarded or not | ||
scratch_repl = true, | ||
-- Your repl definitions come here | ||
repl_definition = { | ||
sh = { | ||
-- Can be a table or a function that | ||
-- returns a table (see below) | ||
command = {"zsh"} | ||
}, | ||
python = { | ||
command = function(meta) | ||
local filename = vim.api.nvim_buf_get_name(meta.current_bufnr) | ||
if string.match(filename, ".*%.py") then | ||
-- return executable("ptipython") and {"ptipython"} or {"ipython"} | ||
return executable("ipython") and {"ipython"} or {"python"} | ||
-- return {"ptpython"} | ||
elseif string.match(filename, ".*%.sage$") then | ||
return {"sage"} | ||
else | ||
return {"ipython"} | ||
end | ||
end, | ||
format = bracketed_paste | ||
} | ||
}, | ||
-- How the repl window will be displayed | ||
-- See below for more information | ||
-- repl_open_cmd = require('iron.view').bottom(40), | ||
-- repl_open_cmd = view.center("30%", 20) | ||
-- repl_open_cmd = view.top("10%") | ||
-- repl_open_cmd = "vertical botright 80 split" | ||
repl_open_cmd = view.split.vertical.botright(50) | ||
}, | ||
-- Iron doesn't set keymaps by default anymore. | ||
-- You can set them here or manually add keymaps to the functions in iron.core | ||
keymaps = { | ||
send_motion = "<space>sc", | ||
visual_send = "<space>sc", | ||
send_file = "<space>sf", | ||
send_line = "<space>sl", | ||
send_until_cursor = "<space>su", | ||
send_mark = "<space>sm", | ||
mark_motion = "<space>mc", | ||
mark_visual = "<space>mc", | ||
remove_mark = "<space>md", | ||
cr = "<space>s<cr>", | ||
interrupt = "<space>s<space>", | ||
exit = "<space>sq", | ||
clear = "<space>cl", | ||
}, | ||
-- If the highlight is on, you can change how it looks | ||
-- For the available options, check nvim_set_hl | ||
highlight = { | ||
italic = true | ||
}, | ||
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines | ||
} | ||
|
||
-- iron also has a list of commands, see :h iron-commands for all available commands | ||
vim.keymap.set('n', '<space>rs', '<cmd>IronRepl<cr>') | ||
vim.keymap.set('n', '<space>rr', '<cmd>IronRestart<cr>') | ||
vim.keymap.set('n', '<space>rf', '<cmd>IronFocus<cr>') | ||
vim.keymap.set('n', '<space>rh', '<cmd>IronHide<cr>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters