feats: nvim, emacs, shell

* nvim: Add copilot completions
* nvim: grug-far buffer won't show lualine & winbar now
* nvim: remove obsidian.nvim
* nvim: luasnip now works
* emacs: more keymaps in org-mode
* emacs: start customizing leader keys
* shell: Add more ls aliases
* shell: Add apt alias in fish
This commit is contained in:
js0ny 2025-02-10 22:37:58 +00:00
parent da0cc1d6e8
commit a506ee28ad
14 changed files with 120 additions and 31 deletions

View file

@ -43,6 +43,7 @@ local M = {
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲",
Copilot = "",
},
}

View file

@ -0,0 +1,13 @@
--- `map` default for `cmp.mapping`
local map = function(map)
return {
{ keys = "<C-n>", cmd = map.select_next_item(), opts = { desc = "Select next completion item" } },
{ keys = "<C-p>", cmd = map.select_prev_item(), opts = { desc = "Select previous completion item" } },
{ keys = "<C-f>", cmd = map.confirm({ select = true }), opts = { desc = "Confirm completion" } },
{ keys = "<Tab>", cmd = map.confirm({ select = true }), opts = { desc = "Confirm completion" } },
{ keys = "<C-Space>", cmd = map.complete(), opts = { desc = "Trigger completion" } },
{ keys = "<C-b>", cmd = map.abort(), opts = { desc = "Abort completion" } },
}
end
return map

View file

@ -20,17 +20,7 @@ utils.set_keymaps(keymaps_modifier)
M.nvim_tree_keymaps = require("keymaps.nvim-tree").plugin
--- `map` default for `cmp.mapping`
function M.cmp_nvim_keymaps(map)
return {
{ keys = "<C-n>", cmd = map.select_next_item(), opts = { desc = "Select next completion item" } },
{ keys = "<C-p>", cmd = map.select_prev_item(), opts = { desc = "Select previous completion item" } },
{ keys = "<C-y>", cmd = map.confirm({ select = true }), opts = { desc = "Confirm completion" } },
{ keys = "<Tab>", cmd = map.confirm({ select = true }), opts = { desc = "Confirm completion" } },
{ keys = "<C-Space>", cmd = map.complete(), opts = { desc = "Trigger completion" } },
{ keys = "<C-e>", cmd = map.abort(), opts = { desc = "Abort completion" } },
}
end
M.cmp_nvim_keymaps = require("keymaps.cmp_map")
-- local function set_markdown_keymaps(bufnr)
-- local opts = { noremap = true, silent = true, buffer = bufnr }

View file

@ -1,8 +1,24 @@
return {
{ import = "plugins.mod.nvim-cmp" },
{
"saadparwaiz1/cmp_luasnip"
},
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").load_standalone(
{
path = "~/.config/zed/snippets/c.json" }
)
end,
-- TODO: Remove this, simply delete this will let nvim-cmp not work
dependencies = { "rafamadriz/friendly-snippets" },
},
{ "rafamadriz/friendly-snippets" },
{
"zbirenbaum/copilot-cmp",
config = function()
require("copilot_cmp").setup()
end,
},
}

View file

@ -1,15 +1,37 @@
return {
{ "wakatime/vim-wakatime", lazy = false },
{ "voldikss/vim-floaterm" },
{ "CRAG666/betterTerm.nvim", opts = {
position = "bot",
size = 15,
} },
{ "CRAG666/code_runner.nvim", config = true },
{ import = "plugins.mod.obsidian-nvim" },
{
"CRAG666/betterTerm.nvim",
opts = {
position = "bot",
size = 15,
}
},
{ "CRAG666/code_runner.nvim", config = true },
-- { import = "plugins.mod.obsidian-nvim" },
{ import = "plugins.mod.which-keys-nvim" },
{
"github/copilot.vim",
lazy = false,
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
event = "BufReadPost",
opts = {
suggestion = {
enabled = not vim.g.ai_cmp,
auto_trigger = true,
hide_during_completion = vim.g.ai_cmp,
keymap = {
accept = "<M-f>",
next = "<M-]>",
prev = "<M-[>",
},
},
panel = { enabled = false },
filetypes = {
markdown = true,
help = true,
},
},
},
}

View file

@ -14,7 +14,7 @@ Remote | Git Branch | Diagnostics | Command | | MID | | Line:Column | Indent | E
local config = {
options = {
disabled_filetypes = {
statusline = { "NvimTree", "alpha" },
statusline = { "NvimTree", "alpha", "grug-far" },
},
-- Disable sections and component separators
component_separators = { left = "", right = "" },

View file

@ -47,9 +47,9 @@ return {
},
mapping = cmp.mapping.preset.insert(mapped),
sources = cmp.config.sources({
{ name = "copilot", priority = 10 },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "copilot" },
{ name = "lazydev", group_index = 0 },
}, {
{ name = "buffer" },

View file

@ -33,6 +33,7 @@ return {
"qf",
"floaterm",
"orgagenda",
"grug-far"
},
})
end,