fix: astronvim - fix copilot's completion by <tab>, add comments

This commit is contained in:
Ryan Yin
2023-07-12 23:16:29 +08:00
parent 95df12c59e
commit 874a1ab939
3 changed files with 63 additions and 12 deletions

View File

@@ -18,7 +18,7 @@ return {
{ import = "astrocommunity.utility.noice-nvim" },
-- Fully featured & enhanced replacement for copilot.vim
-- <Tab> work with both auto completion in cmp and copilot
{ import = "astrocommunity.completion.copilot-lua" },
{ import = "astrocommunity.completion.copilot-lua-cmp" },
{ import = "astrocommunity.media.vim-wakatime" },
{ import = "astrocommunity.motion.leap-nvim" },
{ import = "astrocommunity.motion.flit-nvim" },
@@ -70,7 +70,6 @@ return {
-- neovim
"vim",
"lua",
-- operation & cloud native
"dockerfile",
"hcl",

View File

@@ -0,0 +1,21 @@
-- Mapping data with "desc" stored directly by vim.keymap.set().
--
-- Please use this mappings table to set keyboard mapping since this is the
-- lower level configuration and more robust one. (which-key will
-- automatically pick-up stored data by this setting.)
local utils = require "astronvim.utils"
return {
-- first key is the mode
n = {
-- second key is the lefthand side of the map
-- mappings seen under group name "Buffer"
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
-- quick save
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<leader>tp"] = { function() utils.toggle_term_cmd("ipython") end, desc = "ToggleTerm python" },
},
t = {
-- setting a mapping to false will disable it
-- ["<esc>"] = false,
},
}

View File

@@ -1,10 +1,37 @@
{ pkgs, astronvim, ... }:
# related folders:
# nvim's config: `~/.config/nvim`
# astronvim's user configuration: `$XDG_CONFIG_HOME/astronvim/lua/user`
# all plugins will be installed into(by lazy.nvim): `~/.local/share/nvim/`
# for details: https://astronvim.com/
###############################################################################
#
# AstroNvim's configuration and all its dependencies
#
# Related folders:
# nvim's config: `~/.config/nvim`
# astronvim's user configuration: `$XDG_CONFIG_HOME/astronvim/lua/user`
# all plugins will be installed into(by lazy.nvim): `~/.local/share/nvim/`
#
# For details: https://astronvim.com/
#
# Commands & shortcuts in AstroNvim
# Learn Neovim's Basics: `:Tutor`
# Opening file explorer: `<Space> + e`
# Focus Neotree to current file: `<Space> + o`
# Floating Terminal: `<Space> + tf`
# Horizontal Split Terminal: `<Space> + th`
# Vertical Split Terminal: `<Space> + tv`
# Opening LSP symbols: `<Space> + lS`
# Toggle buffer auto formatting: `<Space> + uf`
#
# Switching between windows: `<Ctrl> + h/j/k/l`
# Resizing windows: `<Ctrl> + Up/Down/Left/Right`
# Horizontal Split: `\`
# Vertical Split: `|`
# Next Buffer(Tab): `]b`
# Previous Buffer(Tab): `[b`
# Close Buffer: `<Space> + c`
# ......
# See https://astronvim.com/Basic%20Usage/walkthrough
#
#e#############################################################################
{
xdg.configFile = {
# base config
@@ -15,10 +42,10 @@
};
# my cusotom astronvim config, astronvim will load it after base config
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
"astronvim/lua/user/init.lua" = {
"astronvim/lua/user" = {
# update AstroNvim
onChange = "${pkgs.neovim}/bin/nvim --headless +quitall";
source = ./astronvim_user_init.lua;
source = ./astronvim_user;
};
};
@@ -103,20 +130,24 @@
# HTML/CSS/JSON/ESLint language servers extracted from vscode
nodePackages.vscode-langservers-extracted
#-- cloudnative
#-- CloudNative
nodePackages.dockerfile-language-server-nodejs
terraform
terraform-ls
jsonnet
jsonnet-language-server
#-- others
#-- Others
taplo # TOML language server / formatter / validator
nodePackages.yaml-language-server
# common
#-- Misc
tree-sitter # common language parser/highlighter
nodePackages.prettier # common code formatter
#-- Optional Requirements:
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
];
};