keymappings for neo

This commit is contained in:
Tim Gröger 2023-04-14 08:18:32 +02:00
parent 4afcfa7c33
commit 46df4817af
2 changed files with 24 additions and 16 deletions

View File

@ -1,38 +1,35 @@
return { return {
-- Configure AstroNvim updates -- Configure AstroNvim updates
updater = { updater = {
remote = "origin", -- remote to use remote = "origin", -- remote to use
channel = "stable", -- "stable" or "nightly" channel = "stable", -- "stable" or "nightly"
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
branch = "nightly", -- branch name (NIGHTLY ONLY) branch = "nightly", -- branch name (NIGHTLY ONLY)
commit = nil, -- commit hash (NIGHTLY ONLY) commit = nil, -- commit hash (NIGHTLY ONLY)
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
skip_prompts = false, -- skip prompts about breaking changes skip_prompts = false, -- skip prompts about breaking changes
show_changelog = true, -- show the changelog after performing an update show_changelog = true, -- show the changelog after performing an update
auto_quit = false, -- automatically quit the current session after a successful update auto_quit = false, -- automatically quit the current session after a successful update
remotes = { -- easily add new remotes to track remotes = { -- easily add new remotes to track
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
}, },
}, },
-- Set colorscheme to use -- Set colorscheme to use
-- colorscheme = "astrodark", -- colorscheme = "astrodark",
colorscheme = "catppuccin-latte", colorscheme = "catppuccin-latte",
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = { diagnostics = {
virtual_text = true, virtual_text = true,
underline = true, underline = true,
}, },
lsp = { lsp = {
-- customize lsp formatting options -- customize lsp formatting options
formatting = { formatting = {
-- control auto formatting on save -- control auto formatting on save
format_on_save = { format_on_save = {
enabled = true, -- enable or disable format on save globally enabled = true, -- enable or disable format on save globally
allow_filetypes = { -- enable format on save for specified filetypes only allow_filetypes = { -- enable format on save for specified filetypes only
-- "go", -- "go",
}, },
@ -54,7 +51,6 @@ return {
-- "pyright" -- "pyright"
}, },
}, },
-- Configure require("lazy").setup() options -- Configure require("lazy").setup() options
lazy = { lazy = {
defaults = { lazy = true }, defaults = { lazy = true },
@ -65,7 +61,6 @@ return {
}, },
}, },
}, },
-- This function is run last and is a good place to configuring -- This function is run last and is a good place to configuring
-- augroups/autocommands and custom filetypes also this just pure lua so -- augroups/autocommands and custom filetypes also this just pure lua so
-- anything that doesn't fit in the normal config locations above can go here -- anything that doesn't fit in the normal config locations above can go here

View File

@ -11,7 +11,10 @@ return {
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" }, ["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
["<leader>bD"] = { ["<leader>bD"] = {
function() function()
require("astronvim.utils.status").heirline.buffer_picker(function(bufnr) require("astronvim.utils.buffer").close(bufnr) end) require("astronvim.utils.status").heirline.buffer_picker(function(bufnr)
require("astronvim.utils.buffer").close(
bufnr)
end)
end, end,
desc = "Pick to close", desc = "Pick to close",
}, },
@ -20,6 +23,16 @@ return {
["<leader>b"] = { name = "Buffers" }, ["<leader>b"] = { name = "Buffers" },
-- quick save -- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command -- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<S-g>"] = { "<C-w>k" },
["<S-r>"] = { "<C-w>j" },
["<S-n>"] = { "<C-w>h" },
["<S-t>"] = { "<C-w>l" },
["<C-g>"] = { "<C-w>K" },
["<C-r>"] = { "<C-w>J" },
["<C-n>"] = { "<C-w>H" },
["<C-t>"] = { "<C-w>L" },
["<leader>lgd"] = { vim.lsp.buf.hover() }
}, },
t = { t = {
-- setting a mapping to false will disable it -- setting a mapping to false will disable it