astronvim_user icon indicating copy to clipboard operation
astronvim_user copied to clipboard

remap setting error

Open Thesoul20 opened this issue 1 year ago • 4 comments

In lua/mapping.lua file, I want to set some mapping about cursor moving, but always failed. My setting is here:

function M.core_mappings(mappings)
  if not mappings then mappings = require("astrocore").empty_map_table() end
  local maps = mappings
  if maps then
    maps.n["<Leader>n"] = false

    maps.i["<C-<CR>>"] = "<Esc>o"
    maps.i["<C-E>"] = "<Esc>A"
    maps.i["<C-I>"] = "<Esc>I"

    maps.n["<C-E>"] = "$"
    maps.n["<C-I>"] = "^"
...

So how can I remapping there keys normally?

By the way, the key of <Home> and <End> do not work normally within Neovim but others applications.

Thesoul20 avatar Aug 12 '24 15:08 Thesoul20

maps.n["<C-e>"] = "$"
maps.n["<C-i>"] = "^"

chaozwn avatar Aug 12 '24 15:08 chaozwn

maps.n["<C-e>"] = "$"
maps.n["<C-i>"] = "^"

When add those line at the function of function M.core_mappings(mappings), those do not work. But add at the function of function M.lsp_mappings(mappings) those work normally.

Because I was using a key remap software, which will remap C-E to End, so how to set end to $? The setting of maps.n["End"] = "$" do not work.

Thesoul20 avatar Aug 12 '24 15:08 Thesoul20

maps.n["<C-e>"] = "$"
maps.n["<C-i>"] = "^"

When add those line at the function of function M.core_mappings(mappings), those do not work. But add at the function of function M.lsp_mappings(mappings) those work normally.

Because I was using a key remap software, which will remap C-E to End, so how to set end to $? The setting of maps.n["End"] = "$" do not work.

This may be a matter of sequencing, and the core may be overwritten later.

chaozwn avatar Aug 13 '24 02:08 chaozwn

This may be a matter of sequencing, and the core may be overwritten later.

How to setting own map to overwritten the core default in a single file. And how to write? I'm sorry for my scarce knowledge about Lua and Astronvim.

Thesoul20 avatar Aug 13 '24 03:08 Thesoul20